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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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