I have a question about something I must have forgotten...
Why does test1 fail, but not test2 or test3?
data test1;
informat d date9.;
input d 1-9;
datalines;
01JAN1999
;
data test2;
length dTxt $9;
input dTxt 1-9;
d = input (dTxt, date9.);
datalines;
01JAN1999
;
data test3;
input d :date9.;
datalines;
01JAN1999
;
PG
According to the documentation:
Note: You cannot use an informat with column input.
According to the documentation:
Note: You cannot use an informat with column input.
That settles that! Thanks.
PG
Use @.
data test1b;
informat d date9.;
format d date9.;
input @1 d ;
put d=;
datalines;
01JAN1999
;
data test1c;
format d date9.;
input @1 d date9.;
put d=;
datalines;
01JAN1999
;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.