<?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 macrovar would not resolve; parallel wont run in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462818#M117863</link>
    <description>&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;options sascmd="C:\Program Files\SAS 9.4\x86\SASFoundation\9.4\sas.exe"&lt;BR /&gt;autosignon;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro parallel(n);/*n = # of parallel processes*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let p=1;&lt;BR /&gt;%let id1=&amp;amp;n+1;&lt;BR /&gt;%do%while (&amp;amp;p&amp;lt; &amp;amp;id1);&lt;/P&gt;&lt;P&gt;rsubmit para&amp;amp;p wait=no sysrputsync=yes;&lt;BR /&gt;options remote=cpsc01 comamid=tcp;&lt;BR /&gt;/* ---------------------------------------------------------------- */&lt;BR /&gt;filename rlink "C:\Users\dylan.liu\Documents\psc01.txt";&lt;BR /&gt;signon cpsc01;&lt;BR /&gt;%syslput p=&amp;amp;p;&lt;/P&gt;&lt;P&gt;%macro testttt (jobnum);&lt;BR /&gt;%syslput jobnum=&amp;amp;jobnum;&lt;/P&gt;&lt;P&gt;rsubmit; /*Tells SAS to submit to UNIX, as opposed to PC */&lt;BR /&gt;libname ndw oracle user=B1xxx7361_OTSUKA_CUSTOM password=B1xxx7361 path=paa schema=B1xxx7361_OTSUKA_CUSTOM;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;rsubmit;&lt;BR /&gt;options obs=MAX;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;%let _EFIREC_ = 0; /* clear export record count macro variable */&lt;BR /&gt;file "/fs501.1/SAS/FINAL_RPT_1803_TEST&amp;amp;jobnum..csv" delimiter=',' DSD DROPOVER lrecl=32767;&lt;BR /&gt;if _n_ = 1 then /* write column names or labels */&lt;BR /&gt;do;&lt;BR /&gt;put&lt;BR /&gt;"IMSID"&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;set NDW.FINAL_RPT_1803_unknown end=EFIEOD;&lt;BR /&gt;format IMS_RXER_ID $7.;&lt;BR /&gt;do;&lt;BR /&gt;EFIOUT + 1;&lt;BR /&gt;PUT IMS_RXER_ID $ @;&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;if EFIEOD then call symputx('_EFIREC_',EFIOUT);&lt;BR /&gt;run;&lt;BR /&gt;%mend testttt;&lt;BR /&gt;&lt;BR /&gt;%testttt(&amp;amp;p);&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;%let p=%eval(&amp;amp;p+1);&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%mend parallel;&lt;/P&gt;&lt;P&gt;%parallel(4);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;macrovar &amp;amp;p would not resolve; parallel wont run. Please advise.&lt;/P&gt;</description>
    <pubDate>Wed, 16 May 2018 19:33:57 GMT</pubDate>
    <dc:creator>laeotropic</dc:creator>
    <dc:date>2018-05-16T19:33:57Z</dc:date>
    <item>
      <title>macrovar would not resolve; parallel wont run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462818#M117863</link>
      <description>&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;options sascmd="C:\Program Files\SAS 9.4\x86\SASFoundation\9.4\sas.exe"&lt;BR /&gt;autosignon;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro parallel(n);/*n = # of parallel processes*/&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let p=1;&lt;BR /&gt;%let id1=&amp;amp;n+1;&lt;BR /&gt;%do%while (&amp;amp;p&amp;lt; &amp;amp;id1);&lt;/P&gt;&lt;P&gt;rsubmit para&amp;amp;p wait=no sysrputsync=yes;&lt;BR /&gt;options remote=cpsc01 comamid=tcp;&lt;BR /&gt;/* ---------------------------------------------------------------- */&lt;BR /&gt;filename rlink "C:\Users\dylan.liu\Documents\psc01.txt";&lt;BR /&gt;signon cpsc01;&lt;BR /&gt;%syslput p=&amp;amp;p;&lt;/P&gt;&lt;P&gt;%macro testttt (jobnum);&lt;BR /&gt;%syslput jobnum=&amp;amp;jobnum;&lt;/P&gt;&lt;P&gt;rsubmit; /*Tells SAS to submit to UNIX, as opposed to PC */&lt;BR /&gt;libname ndw oracle user=B1xxx7361_OTSUKA_CUSTOM password=B1xxx7361 path=paa schema=B1xxx7361_OTSUKA_CUSTOM;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;rsubmit;&lt;BR /&gt;options obs=MAX;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;%let _EFIREC_ = 0; /* clear export record count macro variable */&lt;BR /&gt;file "/fs501.1/SAS/FINAL_RPT_1803_TEST&amp;amp;jobnum..csv" delimiter=',' DSD DROPOVER lrecl=32767;&lt;BR /&gt;if _n_ = 1 then /* write column names or labels */&lt;BR /&gt;do;&lt;BR /&gt;put&lt;BR /&gt;"IMSID"&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;set NDW.FINAL_RPT_1803_unknown end=EFIEOD;&lt;BR /&gt;format IMS_RXER_ID $7.;&lt;BR /&gt;do;&lt;BR /&gt;EFIOUT + 1;&lt;BR /&gt;PUT IMS_RXER_ID $ @;&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;if EFIEOD then call symputx('_EFIREC_',EFIOUT);&lt;BR /&gt;run;&lt;BR /&gt;%mend testttt;&lt;BR /&gt;&lt;BR /&gt;%testttt(&amp;amp;p);&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;/P&gt;&lt;P&gt;%let p=%eval(&amp;amp;p+1);&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%mend parallel;&lt;/P&gt;&lt;P&gt;%parallel(4);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;macrovar &amp;amp;p would not resolve; parallel wont run. Please advise.&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 19:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462818#M117863</guid>
      <dc:creator>laeotropic</dc:creator>
      <dc:date>2018-05-16T19:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: macrovar would not resolve; parallel wont run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462824#M117864</link>
      <description>&lt;P&gt;This doesn't do what you think it's doing, you need to use %EVAL() here to get the value you need, you can test it with the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let n=5;
%let id1=&amp;amp;n+1;&lt;BR /&gt;%put &amp;amp;id1.;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So your code should likely be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let id1=%eval(&amp;amp;n+1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20139"&gt;@laeotropic&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;options sascmd="C:\Program Files\SAS 9.4\x86\SASFoundation\9.4\sas.exe"&lt;BR /&gt;autosignon;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%macro parallel(n);/*n = # of parallel processes*/&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;%let p=1;&lt;BR /&gt;%let id1=&amp;amp;n+1;&lt;BR /&gt;%do%while (&amp;amp;p&amp;lt; &amp;amp;id1);&lt;/P&gt;
&lt;P&gt;rsubmit para&amp;amp;p wait=no sysrputsync=yes;&lt;BR /&gt;options remote=cpsc01 comamid=tcp;&lt;BR /&gt;/* ---------------------------------------------------------------- */&lt;BR /&gt;filename rlink "C:\Users\dylan.liu\Documents\psc01.txt";&lt;BR /&gt;signon cpsc01;&lt;BR /&gt;%syslput p=&amp;amp;p;&lt;/P&gt;
&lt;P&gt;%macro testttt (jobnum);&lt;BR /&gt;%syslput jobnum=&amp;amp;jobnum;&lt;/P&gt;
&lt;P&gt;rsubmit; /*Tells SAS to submit to UNIX, as opposed to PC */&lt;BR /&gt;libname ndw oracle user=B1xxx7361_OTSUKA_CUSTOM password=B1xxx7361 path=paa schema=B1xxx7361_OTSUKA_CUSTOM;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;rsubmit;&lt;BR /&gt;options obs=MAX;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;BR /&gt;%let _EFIERR_ = 0; /* set the ERROR detection macro variable */&lt;BR /&gt;%let _EFIREC_ = 0; /* clear export record count macro variable */&lt;BR /&gt;file "/fs501.1/SAS/FINAL_RPT_1803_TEST&amp;amp;jobnum..csv" delimiter=',' DSD DROPOVER lrecl=32767;&lt;BR /&gt;if _n_ = 1 then /* write column names or labels */&lt;BR /&gt;do;&lt;BR /&gt;put&lt;BR /&gt;"IMSID"&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;set NDW.FINAL_RPT_1803_unknown end=EFIEOD;&lt;BR /&gt;format IMS_RXER_ID $7.;&lt;BR /&gt;do;&lt;BR /&gt;EFIOUT + 1;&lt;BR /&gt;@PUT IMS_RXER_ID $ @;&lt;BR /&gt;;&lt;BR /&gt;end;&lt;BR /&gt;if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */&lt;BR /&gt;if EFIEOD then call symputx('_EFIREC_',EFIOUT);&lt;BR /&gt;run;&lt;BR /&gt;%mend testttt;&lt;BR /&gt;&lt;BR /&gt;%testttt(&amp;amp;p);&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;/P&gt;
&lt;P&gt;%let p=%eval(&amp;amp;p+1);&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;%mend parallel;&lt;/P&gt;
&lt;P&gt;%parallel(4);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;macrovar &amp;amp;p would not resolve; parallel wont run. Please advise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 May 2018 19:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462824#M117864</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-05-16T19:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: macrovar would not resolve; parallel wont run</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462913#M117878</link>
      <description>&lt;P&gt;Your whole approach is likely to be problematic. Doing remote SUBMITs to multiple SAS sessions inside a macro&amp;nbsp;means that you are spreading your macro logic across all those sessions and hoping it all synchronises OK, even though all of those "child" sessions are not aware they are embedded in a macro that is defined only in the primary SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A better approach would be to use the DATA step CALL EXECUTE to generate your required statements in open SAS code, rather than contained inside a SAS macro.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2018 00:39:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macrovar-would-not-resolve-parallel-wont-run/m-p/462913#M117878</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-05-17T00:39:51Z</dc:date>
    </item>
  </channel>
</rss>

