Input of dates in SAS

2

Please try to enter dates in the input form of the SAS Enterprise Guide version 7.1, but in any case the result always comes out in numerical form, here is an example of the code:

data work.family;
infile datalines;
input relation $ first_name $ birthdate: mmddyy10.;
cards;
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51
run;

In the bithdate variable, the addition or removal of the colon, or change in the size of the format always results in the date in numerical form and does not date:

relation   first_name birthdate
son        Frank      10623
daughter   June       10220
brother    Samuel     -3271
    
asked by anonymous 16.06.2016 / 15:12

1 answer

1

I do not know if this is exactly your question, but just tell FORMAT.

Example:

data work.family;  
infile datalines;  
input relation $ first_name $ birthdate: mmddyy10.;  
format birthdate DDMMYY8.;  
cards;  
son Frank 01/31/89  
daughter June 12-25-87  
brother Samuel 01/17/51  
run;
    
10.11.2016 / 18:37