DATA Step, Macro, Functions and more

Import dates variable from CSV

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Import dates variable from CSV

[ Edited ]

Hello, I am trying to import from a csv file and the source format of a date variable is: 1994 04 11 00:00:00

 

This is piece of the program I am using. It was working fine before there was change in the system default for the format:

 

input
ID :10.
Date : DATE12.

Thanks in advance.


Accepted Solutions
Solution
‎08-18-2016 05:53 PM
Super User
Posts: 11,343

Re: Import dates variable from CSV

try YYMMDD10. for an informat.

 

Or to minimize future issues use an informat statement:

 

informat date anydtdte32. ;

and don't have the format on the input.

View solution in original post


All Replies
Solution
‎08-18-2016 05:53 PM
Super User
Posts: 11,343

Re: Import dates variable from CSV

try YYMMDD10. for an informat.

 

Or to minimize future issues use an informat statement:

 

informat date anydtdte32. ;

and don't have the format on the input.

Occasional Contributor
Posts: 7

Re: Import dates variable from CSV

Perfect! Thanks so much...You are my SAS Idol Smiley Wink

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 285 views
  • 1 like
  • 2 in conversation