Can someone of you help me understand what's wrong with this code? I could see missing values in 'dt' in the result.
data test; dt=intnx("year",today(),-1,same); format dt date9.; run;
@David_Billa wrote:
No, it's not clear to me. 'same' is not the keyword here?
Hint: you did not type code with 'same', you typed code with same
Is not the log clear in this case in identifying the error?
69 data test; 70 dt=intnx("year",today(),-1,same); 71 format dt date9.; 72 run; NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 70:28 NOTE: Variable same is uninitialized. NOTE: Argument 4 to function INTNX('year',22837,-1,' .') at line 70 column 4 is invalid. dt=. same=. _ERROR_=1 _N_=1
It says the variable SAME is uninitialized, you can't use it.
Can you figure out what to change to make this work?
@David_Billa wrote:
No, it's not clear to me. 'same' is not the keyword here?
Hint: you did not type code with 'same', you typed code with same
Always keep in mind: anything that is not a number, a format (where appropriate) or enclosed in quotes is always interpreted as a variable name.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.