Hey,
can you tell me how i can manage partial dates in SAS? I would like to import a csv-file with a date-variable (the format in the csv-file is like: 10102000 or 1965 or 091922).
How can i 'tell' SAS, that 10102000 should have the format ddmmyyyy, 091922 the format mmyyyy and 1965 yyyy?? My idea was to import the variable as character-format and then ask with the length-function for the value-length and make 3 new variables for each format, like:
if length(birthdate)EQ 8 Then do;
test=input(birthdate,ddmmyy10.);
format test ddmmyy10.;
end;
if length(birthdate)EQ 6 Then do;
test2=input(birthdate, mmyy7);
format test2 mmyy7.;
end;
if length(birthdate) EQ 4 Then do;
test3=input(birthdate,year.);
format test3 year.;
end;
for test everythings works fine but for test2 and test3 not 😞 do you have any idea?
thanks in advance!
Marie
... View more