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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.