10-20-2011 04:52 PM
I have a dataset with a numeric variable with informat and format of 9.This numeric field has date value as below:
I tried to read in the variable in a Data step and change the format of date_var to mmddyy10. and created the dataset,but when I opened the dataset the value of date_var is showing in bestw format.
ie in my output dataset I am seeing the value of date_var as 20051020 instead of 10/20/2005.
I have also noticed in the log that there was a message when I opened the output dataset ,ie : Error in Format,bestw used instead.
Any idea why this is happening?
Thanks in advance.
10-20-2011 04:59 PM
It sounds like you read your dates as numbers. Thus, you have to use the input and put functions to convert them to date values. E.g.:
format date_var mmddyy10.;