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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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 lock in 2025 pricing—just $495!

Register now

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
  • 1241 views
  • 3 likes
  • 3 in conversation