07-01-2015 02:33 PM
I need some help. I'm trying to have SAS read Nonstandard data from a comma-delimited raw data file, and no matter what I do it will not process the date correctly. The issue is with the BirthDate data, the raw file has them formatted DD/MM/YYYY. I specified on the input statement to have BirthDate:ddmmyy10. but SAS is processing all the date outputs as JAN1960 or DEC1959. For example, one of the raw birth dates is 16/10/1986 but SAS is displaying it as JAN1960. Below is my code, partial output, and the raw data. Can anyone see what I am doing wrong?
Here is my code:
input First :$20. Last :$20. ID
Gender :$1. BirthDate:ddmmyy10. Age AgeGroup :$12.;
drop ID Age;
format BirthDate DTMONYY7.;
proc print data=work.customers label;
proc contents data=work.customers varnum;
Here is a partial output:
Variables in Creation Order
Format Informat Label
Here is the raw data file edited with X's for this thread: (it is a csv file)
Need further help from the community? Please ask a new question.