Hi Photo.
First you have to drop the LENGTH statement : it's telling SAS that the D1 variable is character type -- which obviously it is not, since it's a date. If you want the dates stored as character (preventing the use of SAS date functions), see point 3.
Second you have to add : before the DDMMYY informat in the INPUT statement, since the total length of the dates is not always the same (from 8 to 10). The 10 figure at the end of the informat will then be considered as the maximum length of data to read before delimiter.
Third, if you want to get D1 as a character variable, replace the :DDMMYY10. informat for D1 for :$10. and you don't even need the LENGTH statement anyway.
That would lead to : [pre]
data f11;
infile cards dlm =',' ;
input status $ salary d1 :ddmmyy10. age title $ gender duration mar $ ;
format d1 ddmmyy10. ;
cards ;
AAA,13000,14/5/1978,32,MR,1,6,A
BBB,30000,25/7/1955,52,MR,1,12,B
CCC,12000,3/5/1978,29,MRS,0,12,C
;
run;[/pre]
or
[pre]
data f11;
infile cards dlm =',' ;
input status $ salary d1 :$10. age title $ gender duration mar $ ;
cards ;
AAA,13000,14/5/1978,32,MR,1,6,A
BBB,30000,25/7/1955,52,MR,1,12,B
CCC,12000,3/5/1978,29,MRS,0,12,C
;
run;[/pre]
Regards,
Olivier