BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
David_Billa
Rhodochrosite | Level 12

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;
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@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

 

 

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
David_Billa
Rhodochrosite | Level 12
No, it's not clear to me. 'same' is not the keyword here?
PaigeMiller
Diamond | Level 26

@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

 

 

--
Paige Miller

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1146 views
  • 3 likes
  • 3 in conversation