BookmarkSubscribeRSS Feed
sasuser1000
Calcite | Level 5
This is part of my code, end_session is numeric

I receive an error
"Invalid number conversion on SYMGETN.",


%macro ADJUST;


data _null_;
set list1 ;
if id=1 then call symput('es',end_session);
run;

data a;
set temp (firstobs=1 obs=SYMGETn('es')) ;
run;

%let es=;

%mend;
%adjust

%put _ALL_;
%put adjust_session;




NOTE: Line generated by the invoked macro "ADJUST".
1 data a;
1 ! set temp (firstobs=1 obs=SYMGETn('es')) ; run;
-------
23
MPRINT(ADJUST): data a;
ERROR: Invalid number conversion on SYMGETN.
MPRINT(ADJUST): set temp (firstobs=1 obs=SYMGETn('es')) ;
MPRINT(ADJUST): run;

ERROR 23-7: Invalid value for the OBS option.

NOTE: The SAS System stopped processing this step because of errors.
2 REPLIES 2
Reeza
Super User
Replace symgetn('es') with &es. if the macro variable can be resolved at compile time.
sasuser1000
Calcite | Level 5
Reeza, you are a genius! thanks so much 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 982 views
  • 0 likes
  • 2 in conversation