%macro new;
options mprint mlogic;
OPTIONS COMAMID = TCP;
%LET _host_user=xxxx;
%let _host_pass=xxxx;
%LET Rsysv = rysa 7280;
signon Rsysv user="&_host_user" password="&_host_pass" noscript;
rsubmit;
data new;
x=5;
run;
data _null_;
call symputx('y',2);
run;
%if &y=2 %then %do;
proc download data=new;
run;
%end;
endrsubmit;
%mend;
%new
how can i use below condition correctly in remote session
%if &y=2 %then %do;
You should enter the %IF into a internal macro submitted to the remote host:
%macro new;
options mprint mlogic;
OPTIONS COMAMID = TCP;
%LET _host_user=xxxx;
%let _host_pass=xxxx;
%LET Rsysv = rysa 7280;
signon Rsysv user="&_host_user" password="&_host_pass" noscript;
rsubmit;
data new;
x=5;
run;
data _null_;
call symputx('y',2);
run;
%macro check(arg);
%if &arg=2 %then %do;
proc download data=new;
run;
%end;
%mend check;
%check(&y);
endrsubmit;
%mend;
%new;
You should enter the %IF into a internal macro submitted to the remote host:
%macro new;
options mprint mlogic;
OPTIONS COMAMID = TCP;
%LET _host_user=xxxx;
%let _host_pass=xxxx;
%LET Rsysv = rysa 7280;
signon Rsysv user="&_host_user" password="&_host_pass" noscript;
rsubmit;
data new;
x=5;
run;
data _null_;
call symputx('y',2);
run;
%macro check(arg);
%if &arg=2 %then %do;
proc download data=new;
run;
%end;
%mend check;
%check(&y);
endrsubmit;
%mend;
%new;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
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.
Ready to level-up your skills? Choose your own adventure.