BookmarkSubscribeRSS Feed
sg_kr
Obsidian | Level 7

Hi ,

i have a file with date variable of different date types like date9. ,date10. & mmddyy10.

 

i want to import all together into one dataset with one format and informat.

 

can i use anydtdte here, does it work?

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Try it, its what it is for, though you might be better off importing as text and applying your own set of imputation rules (i.e. we have dates as ISO - text, and numeric, and date and time in separate variables, hence we have original , parts, and imputed).

Reeza
Super User

If you have mmddyy and ddmmyy it's likely to get it wrong. Hopefully you don't 

Are those date types all in the same column in the same file? 
If so, anydtdte is likely your best choice, but it may not be 100% accurate. Is that ok for what you're doing?

 


@sg_kr wrote:

Hi ,

i have a file with date variable of different date types like date9. ,date10. & mmddyy10.

 

i want to import all together into one dataset with one format and informat.

 

can i use anydtdte here, does it work?


 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 535 views
  • 0 likes
  • 3 in conversation