<?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: Why macro variable is not resolved when the code run in parallel in EGuide in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505001#M135217</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240610"&gt;@Suja&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I didn't know that EG allows for parallel processing. What this must mean technically though: Each parallel process runs in its own workspace session/its own environment. Everything specific to a Workspace session won't be available to another Workspace session (i.e. work tables, macro variables and the like).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this reason a macro variable defined in the one session (code) won't be available in the other session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Oct 2018 08:43:58 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2018-10-17T08:43:58Z</dc:date>
    <item>
      <title>Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504889#M135174</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have setup parallel processing in Eguide recently using File -&amp;gt; Project Properties -&amp;gt; Code Submission -&amp;gt; Allow parallel execution on the same server.&lt;/P&gt;&lt;P&gt;My EG project run 'Main' code first and then run the other two codes&amp;nbsp;parallel.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have setup&amp;nbsp; country and include_section_personal as a global variables. But one of the code is keep failing with the below error. Can anyone help with this issue? Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference INCLUDE_SECTION_PERSONAL not resolved.&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;BR /&gt;&amp;amp;include_section_personal = 1 and &amp;amp;country = AU&lt;BR /&gt;WARNING: Apparent symbolic reference COUNTRY not resolved.&lt;BR /&gt;ERROR: The macro AU_PERSONAL will stop executing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 20:55:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504889#M135174</guid>
      <dc:creator>Suja</dc:creator>
      <dc:date>2018-10-16T20:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504891#M135175</link>
      <description>&lt;P&gt;Can you post code&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 20:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504891#M135175</guid>
      <dc:creator>sidpesar</dc:creator>
      <dc:date>2018-10-16T20:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504898#M135179</link>
      <description>&lt;P&gt;I have two sub code which is running parallel after Main code. One of the code is working fine with these macro variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main code:&lt;/P&gt;&lt;P&gt;/* Global variable */&lt;BR /&gt;%global country application_date&amp;nbsp; include_section_personal;&lt;/P&gt;&lt;P&gt;%let country = AU;&lt;/P&gt;&lt;P&gt;%let include_section_personal = 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub code (Personal):&lt;/P&gt;&lt;P&gt;%macro read_personal;&lt;BR /&gt;%if &amp;amp;include_section_personal = 1 and &amp;amp;country = AU %then %do;&lt;BR /&gt;data personal_attribute;&lt;/P&gt;&lt;P&gt;set pss.personal_attribute;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504898#M135179</guid>
      <dc:creator>Suja</dc:creator>
      <dc:date>2018-10-16T21:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504899#M135180</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240610"&gt;@Suja&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have setup parallel processing in Eguide recently using File -&amp;gt; Project Properties -&amp;gt; Code Submission -&amp;gt; Allow parallel execution on the same server.&lt;/P&gt;
&lt;P&gt;My EG project run 'Main' code first and then run the other two codes&amp;nbsp;parallel.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have setup&amp;nbsp; country and include_section_personal as a global variables. But one of the code is keep failing with the below error. Can anyone help with this issue? Thanks in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;STRONG&gt;WARNING: Apparent symbolic reference INCLUDE_SECTION_PERSONAL not resolved.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;BR /&gt;&amp;amp;include_section_personal = 1 and &amp;amp;country = AU&lt;BR /&gt;WARNING: Apparent symbolic reference COUNTRY not resolved.&lt;BR /&gt;ERROR: The macro AU_PERSONAL will stop executing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The highlighted text usually indicates a value was not assigned to the macro variable. It may indicate that the macro variable that had the value assigned was spelled differently or that the code to assign it has not been run when encountered.&lt;/P&gt;
&lt;P&gt;The error is because that variable was blank. The other warnings indicate that you may have a recurring assignment problem as &amp;amp;country was not assigned either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sequence of errors makes me suspect that you may have been attempting to reference data set variable values with macro variable names. That doesn't work.&lt;/P&gt;
&lt;P&gt;Post the code for the macro AU_PERSONAL and the code that called the macro&amp;nbsp;in a code box opened using the forum's {I} icon.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 21:12:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504899#M135180</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-16T21:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504986#M135212</link>
      <description>&lt;P&gt;Macro variables are local to a single SAS instance. As soon as you use parallel execution, only the one node running on the instance where the macro variable was created will work, all others will fail.&lt;/P&gt;
&lt;P&gt;You need to find another method to propagate your metadata into the nodes.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;Code1:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
cutoff = 15;
call symputx('cutoff',put(cutoff,best.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Code2:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
cutoff = 15;
call symputx('cutoff',put(cutoff,best.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Code3:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data after;
set sashelp.class;
where age ge &amp;amp;cutoff;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Parallel execution is enabled for the project, code2 and code3 are connected to code1.&lt;/P&gt;
&lt;P&gt;When the process flow is executed, code2 fails (symbolic reference not resolved), while code3 works.&lt;/P&gt;
&lt;P&gt;This works:&lt;/P&gt;
&lt;P&gt;Code1:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sasuser.tempvar;
name = 'cutoff';
value = '15';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Code2:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sasuser.tempvar;
call symputx(name,value);
run;

data before;
set sashelp.class;
where age &amp;lt; &amp;amp;cutoff;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Code3:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sasuser.tempvar;
call symputx(name,value);
run;

data after;
set sashelp.class;
where age ge &amp;amp;cutoff;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use any permanent library where you have write permission.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 07:58:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/504986#M135212</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-17T07:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505001#M135217</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240610"&gt;@Suja&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I didn't know that EG allows for parallel processing. What this must mean technically though: Each parallel process runs in its own workspace session/its own environment. Everything specific to a Workspace session won't be available to another Workspace session (i.e. work tables, macro variables and the like).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For this reason a macro variable defined in the one session (code) won't be available in the other session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 08:43:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505001#M135217</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2018-10-17T08:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505360#M135323</link>
      <description>&lt;P&gt;Thanks KurtBremser for your solution. I'm using sashelp.vmacro to save the global variable to permenant library and assigning back the global variable in the submodule code. The below solutions is working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main Module:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Global variables */&lt;BR /&gt;%global country application_date include_section_personal ;&lt;/P&gt;&lt;P&gt;%let country = AU;&lt;BR /&gt;%let application_date = today()-60;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname append "F:\SAS Data";&lt;/P&gt;&lt;P&gt;%PUT _GLOBAL_;&lt;/P&gt;&lt;P&gt;/* Save Globale variables into Append library */&lt;BR /&gt;data Append.vars;&lt;BR /&gt;set sashelp.vmacro(where=(scope='GLOBAL'));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Submodule (Personal):&lt;/P&gt;&lt;P&gt;libname append "F:\SAS Data";&lt;/P&gt;&lt;P&gt;/* Place the macro variable(s) back into the GLOBAL symbol table from Append library */&lt;BR /&gt;data _null_;&lt;BR /&gt;set append.vars(where=(scope='GLOBAL'));&lt;BR /&gt;if substr(name,1,3) ne 'SYS' then do;&lt;BR /&gt;call execute('%global '||strip(name)||';');&lt;BR /&gt;call execute('%let '||strip(name)||'='||strip(value)||';');&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your help!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 21:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505360#M135323</guid>
      <dc:creator>Suja</dc:creator>
      <dc:date>2018-10-17T21:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why macro variable is not resolved when the code run in parallel in EGuide</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505401#M135339</link>
      <description>&lt;P&gt;Thanks KurtBremser for your solution. I'm using sashelp.vmacro to save the global variable to permenant library and assigning back the global variable in the submodule code. The below solutions is working fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main Module:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Global variables */&lt;BR /&gt;%global country application_date include_section_personal ;&lt;/P&gt;&lt;P&gt;%let country = AU;&lt;BR /&gt;%let application_date = today()-60;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname append "F:\SAS Data";&lt;/P&gt;&lt;P&gt;%PUT _GLOBAL_;&lt;/P&gt;&lt;P&gt;/* Save Globale variables into Append library */&lt;BR /&gt;data Append.vars;&lt;BR /&gt;set sashelp.vmacro(where=(scope='GLOBAL'));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Submodule (Personal):&lt;/P&gt;&lt;P&gt;libname append "F:\SAS Data";&lt;/P&gt;&lt;P&gt;/* Place the macro variable(s) back into the GLOBAL symbol table from Append library */&lt;BR /&gt;data _null_;&lt;BR /&gt;set append.vars(where=(scope='GLOBAL'));&lt;BR /&gt;if substr(name,1,3) ne 'SYS' then do;&lt;BR /&gt;call execute('%global '||strip(name)||';');&lt;BR /&gt;call execute('%let '||strip(name)||'='||strip(value)||';');&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all your help!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 23:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-macro-variable-is-not-resolved-when-the-code-run-in-parallel/m-p/505401#M135339</guid>
      <dc:creator>Suja</dc:creator>
      <dc:date>2018-10-17T23:53:43Z</dc:date>
    </item>
  </channel>
</rss>

