can someone help me resolve this error? I except date value from this code. e.g. 10-09-2078
data test;
dt=input('43352',MMDDYY10.);
format dt MMDDYY10.;
run;
Log:
26 data test;
27 dt=input('43352',MMDDYY10.);
28 format dt MMDDYY10.;
29 run;
NOTE: Invalid argument to function INPUT at line 27 column 4.
dt=. _ERROR_=1 _N_=1
NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to
missing values
@David_Billa wrote:
I except date value from this code. e.g. 10-09-2078
But your input string of
'43352'
very clearly does not match the structure of your date, which is required by the MMDDYY10. informat.
Simply read it as a number:
data _null_;
dt = input('43352',5.);
format dt yymmdd10.;
put dt=;
run;
Log:
69 data _null_;
70 dt = input('43352',5.);
71 format dt yymmdd10.;
72 put dt=;
73 run;
dt=2078-09-10
What do you expect from this code?
I except date value from this code. e.g. 10-09-2078
@David_Billa wrote:
I except date value from this code. e.g. 10-09-2078
But your input string of
'43352'
very clearly does not match the structure of your date, which is required by the MMDDYY10. informat.
Simply read it as a number:
data _null_;
dt = input('43352',5.);
format dt yymmdd10.;
put dt=;
run;
Log:
69 data _null_;
70 dt = input('43352',5.);
71 format dt yymmdd10.;
72 put dt=;
73 run;
dt=2078-09-10
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.