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 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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