Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8858041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:44:10+00:00 2026-06-14T14:44:10+00:00

I have data in csv format with a certain timestamp field in this format:

  • 0

I have data in csv format with a certain timestamp field in this format:

‘ 2009-07-30 20:50:19’

How can I read that into a SS dataset? Ive been trying this, but to no avail.

             data filecontents;
             infile       "C:\es.txt" dlm=',' MISSOVER DSD firstobs=2 lrecl=32767 ;
             input  START_TIME :ANYDTDTM. 
             FORMAT START_TIME datetime.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:44:11+00:00Added an answer on June 14, 2026 at 2:44 pm

    Seems fine to me. The below code works on my machine (9.3 TSM2). What happens for you? Are you just missing a semicolon after the input statement (your example code is)?

    data test;
    infile "c:\temp\test.csv" dlm=',' missover;
    input 
        dtvar :YMDDTTM.
        var1 $
        var2 $;
    format dtvar DATETIME19.;
    put dtvar= DATETIME19.;
    run;
    

    result:

    608  data test;
    609  infile "c:\temp\test.csv" dlm=',' missover;
    610  input
    611      dtvar :YMDDTTM.
    612      var1 $
    613      var2 $;
    614  format dtvar DATETIME19.;
    615  put dtvar= DATETIME19.;
    616  run;
    
    NOTE: The infile "c:\temp\test.csv" is:
          Filename=c:\temp\test.csv,
          RECFM=V,LRECL=256,File Size (bytes)=31,
          Last Modified=20Nov2012:20:20:51,
          Create Time=20Nov2012:20:17:51
    
    dtvar=30JUL2009:20:50:19
    NOTE: 1 record was read from the infile "c:\temp\test.csv".
          The minimum record length was 29.
          The maximum record length was 29.
    NOTE: The data set WORK.TEST has 1 observations and 3 variables.
    NOTE: DATA statement used (Total process time):
          real time           0.03 seconds
          cpu time            0.00 seconds
    

    For what it’s worth, YMDDTTMw.d is the specific informat for that (ANYDTDTM. will work as well of course).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some data in CSV format that I want to pull into an
I have a data file in CSV format that has the some data like
I have two groups of files that contain data in CSV format with a
I have CSV data loaded into a multidimensional array. In this way each row
I have one field when importing that can contain large data, it seems that
Hi I have data in a csv file format that Id like to import
I have data from travel diaries which has been read in from a csv
I have a data structure created using read.csv() of dimensions 130, 395. I am
I have a number of images and a CSV data file that I want
I have some questions about importing data from Excel/CSV File into SQL Server. Let

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.