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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.