07-10-2014 02:56 AM
How to read date from a txt file?
am trying to read this way.But saw some errors
1 arun joy 12/6/1989
input no @2 name $9. @12 dob ddmmyy10.;
07-24-2014 01:01 PM
I would use a colon ( modifier on the ddmmyy10. informat instead of changing the informat length.
format dob date9.;
The colon basically allows SAS to stop processing as soon as it hits the space in position 10, and translate the string of 9 characters instead of expecting all 10. The problem with the simple solution of changing the format length is that if you have a date longer than that like 14/10/2014, only reading 9 characters will give you incorrect results.
Hope this helps your understanding,
Need further help from the community? Please ask a new question.