Help using Base SAS procedures

Macro for remote problem

Reply
Regular Contributor
Posts: 222

Macro for remote problem


Hello Everyone!

I have a problem to create a macro in local for running a remote code: method 1 works well,but method 2 doesn't work. what is the problem with method 2??

Thanks!

Mike

rsubmit;

data  z;

x=123;

run;

endrsubmit;

method 1:/*create remote macro,this method works well*/

rsubmit;

%macro mm;

data _null_;

set z;

call symputx('aaa',x);

run;

%put &aaa;

%mend mm;

%mm; /*this will show 123 in the log*/

endrsubmit;

method 2:/*create a local macro*/


%macro mm2;
rsubmit;
data _null_;
set z;
call symputx('bbb',x);
run;
%put &bbb;
endrsubmit;
%mend mm2;

%mm2; /*This will not work ,why?*/

Regular Contributor
Posts: 222

Re: Macro for remote problem

To simply the question like this:

rsubmit;
%let aaa=123456;

endrsubmit;

/***********************************************/

rsubmit;

%put &aaa;/*this works*/

endrsubmit;

/**********************************************************/

%macro kk;
rsubmit;
%put &aaa;
endrsubmit;
%mend kk;
%kk;/*This doesn't work*/

Thanks!

Regular Contributor
Posts: 222

Re: Macro for remote problem

Contributor
Posts: 45

Re: Macro for remote problem

Thanks for that...I always wondered why I coudn't assign a macro in my remote session

Regular Contributor
Posts: 222

Re: Macro for remote problem

%macro mm2;

 

%nrstr(

rsubmit;

data _null_;

set z;

call symputx('bbb',x);

run;

%put &bbb;

endrsubmit;

);

%mend mm2; 

%mm2;

Ask a Question
Discussion stats
  • 4 replies
  • 247 views
  • 0 likes
  • 2 in conversation