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
;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.