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
;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.