DATA Step, Macro, Functions and more

need to finish this by am, can't make it work

Reply
Contributor
Posts: 60

need to finish this by am, can't make it work

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.
Super User
Posts: 19,867

Re: need to finish this by am, can't make it work

Posted in reply to sasuser1000
Replace symgetn('es') with &es. if the macro variable can be resolved at compile time.
Contributor
Posts: 60

Re: need to finish this by am, can't make it work

Reeza, you are a genius! thanks so much Smiley Happy
Ask a Question
Discussion stats
  • 2 replies
  • 196 views
  • 0 likes
  • 2 in conversation