Hi All, Input file: is an excel file read into SAS. Mother_dob is a numeric variable with the value 20130123 in the file Test. Wanted output file: I want mother_dob with the format yymmddn8 Result I got with the following code: the output file is still showing mother_dob with the yymmdd8. format. I noticed that in my following code after I do the formating of the date variable the values are still showing as in SAS date values. Could you please help me understand why the format yymmddn8 is not getting assigned in the below code. DATA final; SET test(keep=mother_dob obs=1); MOTHER_DOB1 = input(put(left(MOTHER_DOB),8.),YYMMDD8.); drop MOTHER_DOB ; rename MOTHER_DOB1 = MOTHER_DOB; format MOTHER_DOB yymmddn8.; RUN; I was able to assign mother_dob with yymmddn8. format with the following code but still did not understand why the above code did not work. Modified code: DATA final; SET test(keep=mother_dob obs=1); MOTHER_DOB1 = input(put(left(MOTHER_DOB),8.),YYMMDD8.); format MOTHER_DOB1 yymmddn8.; drop MOTHER_DOB ; rename MOTHER_DOB1 = MOTHER_DOB; RUN; Please share your thoughts. Thank you all in advance!
... View more