<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386800#M277242</link>
    <description>The second solution was not* using %syslput with %let for the libname.  As you said, just put the libname as usual before the connect prompt.  &lt;BR /&gt;&lt;BR /&gt;%Macro NITC_Test3;  /*Jacob Carter*/&lt;BR /&gt;&lt;BR /&gt;libname RTOT "H:\Shared\MDSEIMB\SFDS\SDS\Green Book\RTOT";&lt;BR /&gt;&lt;BR /&gt;%let nitcspwn = 165.xxx.4.xx xxxx;&lt;BR /&gt;options comamid=tcp remote=nitcspwn nosource ;&lt;BR /&gt;signon username=_prompt_ password=_prompt_ ;&lt;BR /&gt;&lt;BR /&gt;%syslput molist=&amp;amp;molist;&lt;BR /&gt;%syslput yrlist=&amp;amp;yrlist;&lt;BR /&gt;%syslput sv=&amp;amp;sv;&lt;BR /&gt;&lt;BR /&gt;rsubmit;filename code temp;&lt;BR /&gt;data _null_;&lt;BR /&gt;  file code;&lt;BR /&gt;  put&lt;BR /&gt;  '%macro regloop(yrlist, molist, sv);'&lt;BR /&gt; /'%let s=1; %let t=1;'&lt;BR /&gt; /'%let cntyr=%sysfunc(countw(&amp;amp;yrlist));'&lt;BR /&gt; /'%let cntmo=%sysfunc(countw(&amp;amp;molist));'&lt;BR /&gt; /' '&lt;BR /&gt; /'%do s=1 %to &amp;amp;cntyr;'&lt;BR /&gt; /'%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));'&lt;BR /&gt; /'%do t=1 %to &amp;amp;cntmo;'&lt;BR /&gt; /'%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));'&lt;BR /&gt; /'libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;'&lt;BR /&gt; /'proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;'&lt;BR /&gt; /'%end;%end;'&lt;BR /&gt; /'%mend;'&lt;BR /&gt;  ;&lt;BR /&gt;run;&lt;BR /&gt;%include code / source2;&lt;BR /&gt;%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;BR /&gt;endrsubmit;&lt;BR /&gt;signoff;&lt;BR /&gt;%mend NITC_Test3;</description>
    <pubDate>Wed, 09 Aug 2017 20:41:39 GMT</pubDate>
    <dc:creator>jakestat</dc:creator>
    <dc:date>2017-08-09T20:41:39Z</dc:date>
    <item>
      <title>How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386673#M277233</link>
      <description>&lt;P&gt;I am trying to pass local environment variables to a macro that is executed on a remote server using rsubmit. In the local environment I create the global var definitions, then call the macro %NITC_Remote; (the file is attached - and yes, I'm a novice). Thank you for your help.&lt;/P&gt;
&lt;P&gt;EDITOR's NOTE: SERVER INFORMATION **REDACTED**&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;options mprint symbolgen mlogic&lt;BR /&gt;mautosource sasautos= ('H:\......\.....\Macros'); /*Location of Remote_macro*/&lt;BR /&gt;&lt;BR /&gt;%macro gmacs;&lt;BR /&gt;%global molist yrlist sv;&lt;BR /&gt;%let mlist=03 06 09 12;&lt;BR /&gt;%let ylist=12 13 14 15 16 17;&lt;BR /&gt;%let sv=AS;&lt;BR /&gt;%mend gmacs;&lt;BR /&gt;%gmacs;&lt;BR /&gt;&lt;BR /&gt;%NITC_Remote(&amp;amp;mlist,&amp;amp;ylist,&amp;amp;sv);&lt;BR /&gt;&lt;BR /&gt;/*## MACRO CODE BEGINS HERE ##*/&lt;BR /&gt;%Macro NITC_Remote;&lt;BR /&gt;%let RTOT= H:/.../..../RTOT;&lt;BR /&gt;%syslput RTOT=&amp;amp;RTOT;&lt;BR /&gt;&lt;BR /&gt;%let nitcspwn = **redacted**;&lt;BR /&gt;options comamid=tcp remote=**redacted** nosource ;&lt;BR /&gt;signon username=_prompt_ password=_prompt_ ; /*OPENS SIGN ON PROMPT*/&lt;BR /&gt;&lt;BR /&gt;rsubmit;&lt;BR /&gt;%nrstr(%let molist=&amp;amp;mlist;)&lt;BR /&gt;%nrstr(%let yrlist=&amp;amp;ylist;)&lt;BR /&gt;%nrstr(%let sv=&amp;amp;sv;)&lt;BR /&gt;%macro regloop(yrlist, molist, sv);&lt;BR /&gt;%let s=1; %let t=1;&lt;BR /&gt;%let cntyr=%sysfunc(countw(&amp;amp;yrlist));&lt;BR /&gt;%let cntmo=%sysfunc(countw(&amp;amp;molist));&lt;BR /&gt;&lt;BR /&gt;%do s=1 %to &amp;amp;cntyr;&lt;BR /&gt;%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));&lt;BR /&gt;%do t=1 %to &amp;amp;cntmo;&lt;BR /&gt;%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));&lt;BR /&gt;&lt;BR /&gt;libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;&lt;BR /&gt;proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=&amp;amp;RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;&lt;BR /&gt;%end;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;&lt;BR /&gt;signoff;&lt;BR /&gt;%Mend NITC_Remote;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:39:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386673#M277233</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2022-08-16T14:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386692#M277234</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Here is what listed in the SAS Online Help&lt;/P&gt;
&lt;P&gt;"%SYSLPUT : Creates a new macro variable or modifies the value of an existing macro variable on a remote host or server. &lt;/P&gt;
&lt;DIV class="sgml"&gt;
&lt;P&gt;To use %SYSLPUT, you must have initiated a link between a local SAS session or client and a remote SAS session or server using the SIGNON command or SIGNON statement. For more information, see the documentation for SAS/CONNECT software."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, establish your connection first, via Signon statement, then from your local session, use %SYSLPUT to pass your global local macro variable(s) to the remote server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Ahmed&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 09 Aug 2017 16:10:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386692#M277234</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2017-08-09T16:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386716#M277235</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AhmedAl_Attar, &amp;nbsp;I have modified the macro language as follows. &amp;nbsp;The Log file is attached. &amp;nbsp;Still haveing trouble with the Libname statement. &amp;nbsp; Thank you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%Macro NITC_Remote;&lt;BR /&gt;%let RTOT= H:/...../...../...../RTOT;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%let nitcspwn = **redacted**;&lt;BR /&gt;options comamid=tcp remote=**redacted** nosource ;&lt;BR /&gt;signon username=_prompt_ password=_prompt_ ;&lt;/P&gt;
&lt;P&gt;%syslput RTOT=&amp;amp;RTOT;&lt;BR /&gt;%syslput molist=&amp;amp;molist;&lt;BR /&gt;%syslput yrlist=&amp;amp;yrlist;&lt;BR /&gt;%syslput sv=&amp;amp;sv;&lt;/P&gt;
&lt;P&gt;rsubmit;&lt;BR /&gt;%macro regloop(yrlist, molist, sv);&lt;BR /&gt;%let s=1; %let t=1;&lt;BR /&gt;%let cntyr=%sysfunc(countw(&amp;amp;yrlist));&lt;BR /&gt;%let cntmo=%sysfunc(countw(&amp;amp;molist));&lt;BR /&gt;&lt;BR /&gt;%do s=1 %to &amp;amp;cntyr;&lt;BR /&gt;%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));&lt;BR /&gt;%do t=1 %to &amp;amp;cntmo;&lt;BR /&gt;%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));&lt;/P&gt;
&lt;P&gt;libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;&lt;BR /&gt;proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;&lt;BR /&gt;%end;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;/P&gt;
&lt;P&gt;endrsubmit;&lt;/P&gt;
&lt;P&gt;signoff;&lt;BR /&gt;%Mend NITC_Remote;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 13:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386716#M277235</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2022-08-16T13:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386717#M277236</link>
      <description>&lt;P&gt;Use %SYSLPUT. &amp;nbsp;Change these lines&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;signon username=_prompt_ password=_prompt_ ;
rsubmit;
%nrstr(%let molist=&amp;amp;mlist;)
%nrstr(%let yrlist=&amp;amp;ylist;)
%nrstr(%let sv=&amp;amp;sv;)
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To this instead.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;signon username=_prompt_ password=_prompt_ ;
%syslput molist=&amp;amp;mlist;
%syslput yrlist=&amp;amp;ylist;
%syslput sv=&amp;amp;sv;
rsubmit;
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If that has trouble because you are calling %SYSLPUT inside of a macro then you might want to revert to the method that SAS used before they made the %SYSLPUT statement. &amp;nbsp;Here is a version of the %SYSLPUT() macro that they had back in SAS 6.12, renamed to avoid conflict with the new %SYSLPUT statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro syslput612(macvar,macval,remote=);
   options nosource nonotes;
   %let str=%str(rsubmit &amp;amp;remote;options nosource;)
    %nrstr(%let) %str(&amp;amp;macvar = &amp;amp;macval;options source;endrsubmit;);
   &amp;amp;str; options notes source;
%mend syslput612;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Code using macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;signon username=_prompt_ password=_prompt_ ;
%syslput612(molist,&amp;amp;mlist)
%syslput612(yrlist,&amp;amp;ylist)
%syslput612(sv,&amp;amp;sv)
rsubmit;
...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 17:18:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386717#M277236</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-09T17:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386722#M277237</link>
      <description>Tom, after I modified based on your first option (also suggested by Ahmed), that part of it worked (i think).  Not there is a libname that does not assign.  (see log attached).</description>
      <pubDate>Wed, 09 Aug 2017 17:26:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386722#M277237</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2017-08-09T17:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386729#M277238</link>
      <description>&lt;P&gt;Looks like the local macro is expanding some of the macro logic before pushing the generated macro definition to the remote session.&lt;/P&gt;
&lt;P&gt;Can you take the remote macro defintion out of the local macro definition?&lt;/P&gt;
&lt;P&gt;Or move it to the remote as text instead and then compile it?&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;EDITOR's NOTE: SERVER INFORMATION **REDACTED**&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro NITC_Remote;
%let RTOT= H:/...../...../...../RTOT;

%let nitcspwn =**redacted**;
options comamid=tcp remote=nitcspwn nosource ;
signon username=_prompt_ password=_prompt_ ;
%syslput RTOT=&amp;amp;RTOT;
%syslput molist=&amp;amp;molist;
%syslput yrlist=&amp;amp;yrlist;
%syslput sv=&amp;amp;sv;
rsubmit;
filename code temp;
data _null_;
  file code;
  put
  '%macro regloop(yrlist, molist, sv);'
 /'%let s=1; %let t=1;'
 /'%let cntyr=%sysfunc(countw(&amp;amp;yrlist));'
 /'%let cntmo=%sysfunc(countw(&amp;amp;molist));'
 /' '
 /'%do s=1 %to &amp;amp;cntyr;'
 /'%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));'
 /'%do t=1 %to &amp;amp;cntmo;'
 /'%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));'
 /'libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;'
 /'proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;'
 /'%end;%end;'
 /'%mend;'
  ;
run;
%include code / source2;
%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);
endrsubmit;
signoff;
%mend NITC_Remote;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386729#M277238</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-08-16T14:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386775#M277239</link>
      <description>&lt;P&gt;&lt;BR /&gt;Tom, I see there is still a problem with the libname assignment. At least now it is recognizing the file names (with distinct months) and file size at the remote location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Attached is the log file. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...........&lt;BR /&gt;12 +%do s=1 %to &amp;amp;cntyr;&lt;BR /&gt;13 +%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));&lt;BR /&gt;14 +%do t=1 %to &amp;amp;cntmo;&lt;BR /&gt;15 +%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));&lt;BR /&gt;16 +libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;&lt;BR /&gt;17 +proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;&lt;BR /&gt;18 +%end;%end;&lt;BR /&gt;19 +%mend;&lt;BR /&gt;NOTE: %INCLUDE (level 1) ending.&lt;BR /&gt;20 %regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;BR /&gt;NOTE: Libref TOTS1203 was successfully assigned as follows:&lt;BR /&gt; Engine: V9&lt;BR /&gt; Physical Name: NAP95AS.ASUS.D1203SUM.USRGN.SAS.DATA&lt;/P&gt;
&lt;P&gt;ERROR: Libname RTOT is not assigned.&lt;BR /&gt;ERROR: Download function terminated. The data set created may be unusable.&lt;BR /&gt;NOTE: The data set TOTS1203.RTTOTS has 20181 observations and 40 variables.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: The PROCEDURE DOWNLOAD used 0.00 CPU seconds and 21901K.&lt;/P&gt;
&lt;P&gt;NOTE: The address space has used a maximum of 980K below the line and 26192K above the line.&lt;/P&gt;
&lt;P&gt;NOTE: Libref TOTS1206 was successfully assigned as follows:&lt;BR /&gt; Engine: V9&lt;BR /&gt; Physical Name: NAP95AS.ASUS.D1206SUM.USRGN.SAS.DATA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 19:18:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386775#M277239</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2017-08-09T19:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386785#M277240</link>
      <description>&lt;P&gt;You need to create the target libref on the local SAS session before running PROC DOWNLOAD on the remote session.&lt;/P&gt;
&lt;PRE&gt;17 +proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;
...
NOTE: Libref TOTS1203 was successfully assigned as follows:
Engine: V9
Physical Name: NAP95AS.ASUS.D1203SUM.USRGN.SAS.DATA
ERROR: Libname RTOT is not assigned.
ERROR: Download function terminated.&lt;/PRE&gt;
&lt;P&gt;So add a LIBNAME statement before the local macro call. Or if in the macro call then before the RSUBMIT/ENDRSUBMIT block.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname RTOT "......";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if you meant to create a WORK dataset then remove the extra period from the OUT= value.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;out=work.RTOT&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 19:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386785#M277240</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-08-09T19:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386797#M277241</link>
      <description>&lt;P&gt;Tom, That works... so, now I realize we have two solutions. In the beginning, %nrstr() should have been used on the %let, %do, %if.&lt;BR /&gt;&lt;SPAN&gt;EDITOR's NOTE: SERVER INFORMATION **REDACTED**&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;%let nitcspwn = &lt;CODE class=" language-sas"&gt;**redacted**&lt;/CODE&gt;;&lt;BR /&gt;options comamid=tcp remote=nitcspwn nosource ;&lt;BR /&gt;signon username=_prompt_ password=_prompt_ ;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%syslput molist=&amp;amp;molist;&lt;BR /&gt;%syslput yrlist=&amp;amp;yrlist;&lt;BR /&gt;%syslput sv=&amp;amp;sv;&lt;BR /&gt;&lt;BR /&gt;rsubmit;&lt;BR /&gt;%macro regloop(yrlist, molist, sv);&lt;BR /&gt;%nrstr(%let s=1;) %nrstr(%let t=1;)&lt;BR /&gt;%nrstr(%let cntyr=%sysfunc(countw(&amp;amp;yrlist));)&lt;BR /&gt;%nrstr(%let cntmo=%sysfunc(countw(&amp;amp;molist));)&lt;BR /&gt;&lt;BR /&gt;%nrstr(%do s=1 %to &amp;amp;cntyr;)&lt;BR /&gt;%nrstr(%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));)&lt;BR /&gt;%nrstr(%do t=1 %to &amp;amp;cntmo;)&lt;BR /&gt;%nrstr(%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));)&lt;BR /&gt;&lt;BR /&gt;libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;&lt;BR /&gt;proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;&lt;BR /&gt;%end;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;&lt;BR /&gt;signoff;&lt;BR /&gt;%Mend NITC_Remote;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2022 14:28:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386797#M277241</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2022-08-16T14:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I pass global variable to a remote macro to be run on a remote system using RSUBMIT.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386800#M277242</link>
      <description>The second solution was not* using %syslput with %let for the libname.  As you said, just put the libname as usual before the connect prompt.  &lt;BR /&gt;&lt;BR /&gt;%Macro NITC_Test3;  /*Jacob Carter*/&lt;BR /&gt;&lt;BR /&gt;libname RTOT "H:\Shared\MDSEIMB\SFDS\SDS\Green Book\RTOT";&lt;BR /&gt;&lt;BR /&gt;%let nitcspwn = 165.xxx.4.xx xxxx;&lt;BR /&gt;options comamid=tcp remote=nitcspwn nosource ;&lt;BR /&gt;signon username=_prompt_ password=_prompt_ ;&lt;BR /&gt;&lt;BR /&gt;%syslput molist=&amp;amp;molist;&lt;BR /&gt;%syslput yrlist=&amp;amp;yrlist;&lt;BR /&gt;%syslput sv=&amp;amp;sv;&lt;BR /&gt;&lt;BR /&gt;rsubmit;filename code temp;&lt;BR /&gt;data _null_;&lt;BR /&gt;  file code;&lt;BR /&gt;  put&lt;BR /&gt;  '%macro regloop(yrlist, molist, sv);'&lt;BR /&gt; /'%let s=1; %let t=1;'&lt;BR /&gt; /'%let cntyr=%sysfunc(countw(&amp;amp;yrlist));'&lt;BR /&gt; /'%let cntmo=%sysfunc(countw(&amp;amp;molist));'&lt;BR /&gt; /' '&lt;BR /&gt; /'%do s=1 %to &amp;amp;cntyr;'&lt;BR /&gt; /'%let yr=%scan(&amp;amp;yrlist,&amp;amp;s,%str( ));'&lt;BR /&gt; /'%do t=1 %to &amp;amp;cntmo;'&lt;BR /&gt; /'%let mo=%scan(&amp;amp;molist,&amp;amp;t,%str( ));'&lt;BR /&gt; /'libname tots&amp;amp;yr.&amp;amp;mo. "NAP95&amp;amp;sv..&amp;amp;sv.US.D&amp;amp;yr.&amp;amp;mo.SUM.USRGN.SAS.DATA" disp=shr;'&lt;BR /&gt; /'proc download data=tots&amp;amp;yr.&amp;amp;mo..rttots out=RTOT.&amp;amp;sv._rttots&amp;amp;yr.&amp;amp;mo.;run;'&lt;BR /&gt; /'%end;%end;'&lt;BR /&gt; /'%mend;'&lt;BR /&gt;  ;&lt;BR /&gt;run;&lt;BR /&gt;%include code / source2;&lt;BR /&gt;%regloop(&amp;amp;yrlist, &amp;amp;molist, &amp;amp;sv);&lt;BR /&gt;endrsubmit;&lt;BR /&gt;signoff;&lt;BR /&gt;%mend NITC_Test3;</description>
      <pubDate>Wed, 09 Aug 2017 20:41:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-pass-global-variable-to-a-remote-macro-to-be-run-on-a/m-p/386800#M277242</guid>
      <dc:creator>jakestat</dc:creator>
      <dc:date>2017-08-09T20:41:39Z</dc:date>
    </item>
  </channel>
</rss>

