<?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: Invalid symbolic variable name issue in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339150#M77359</link>
    <description>&lt;P&gt;Sorry, this doesn't answer your question, but what on earth are you doing? &amp;nbsp;Macro lists and variables all over the place, far overcomplicated messy code?&lt;/P&gt;
&lt;P&gt;If you really need - and I would strongly advise there are far better methods - a list of macro variables called PE1/2/3 date then do it in a datastep:&lt;/P&gt;
&lt;PRE&gt;%let prog_kw=201701,201702,201703,201704,201705,201706,201707,201708,201709,201710,201711;

data a;
  do i=1 to countw("&amp;amp;prog_kw.",",") by 3;
    call symputx(cats('pe1_',scan("&amp;amp;prog_kw.",i,',')),"","g");
    call symputx(cats('pe2_',scan("&amp;amp;prog_kw.",i+1,',')),"","g");
    call symputx(cats('pe3_',scan("&amp;amp;prog_kw.",i+2,',')),"","g");
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Also note, "&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201702 and PE_201703 for first iteration." - you will not get this, all the assignments are within the loop, so all area assigned scan(1), then next loop scan(2) etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Again, this really isn't the best method of achieving whatever it is your doing, if this came cross my desk I would delete it without even looking at it.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Mar 2017 09:41:46 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-03-08T09:41:46Z</dc:date>
    <item>
      <title>Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339147#M77358</link>
      <description>&lt;P&gt;hi to all,&lt;/P&gt;&lt;P&gt;my&amp;nbsp;code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  %let L_cnt=%sysfunc(countw(%quote(&amp;amp;PROG_KW_LIST)));
  %put &amp;amp;=L_cnt;
  %put &amp;amp;=PROG_KW_LIST;
  %do i1 = 1 %to &amp;amp;L_cnt;
    %let PROG_KW=%qscan(%quote(&amp;amp;PROG_KW_LIST.),&amp;amp;i1.,%str(,));
    %put &amp;amp;=PROG_KW;
    %put before global;
    %global PE1_&amp;amp;PROG_KW PE2_&amp;amp;PROG_KW PE3_&amp;amp;PROG_KW;
    %put after global;&lt;BR /&gt;.....&lt;BR /&gt;&lt;BR /&gt;  %end;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRIKE&gt;I expect global variables PE1_201701, PE2_201702 and PE_201703 for first iteration.&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;correction:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I expect global variables PE1_201701, PE2_201701 and PE3_201701 for first iteration.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;L_CNT=11
PROG_KW_LIST=201701,201702,201703,201704,201705,201706,201707,201708,201709,201710,201711
PROG_KW=201701
before global
ERROR: Invalid symbolic variable name 201701.
ERROR: Invalid symbolic variable name 201701.
ERROR: Invalid symbolic variable name 201701.
after global&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why is this?&lt;/P&gt;&lt;P&gt;thank you very much,&lt;/P&gt;&lt;P&gt;defaz&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339147#M77358</guid>
      <dc:creator>defaz</dc:creator>
      <dc:date>2017-03-08T10:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339150#M77359</link>
      <description>&lt;P&gt;Sorry, this doesn't answer your question, but what on earth are you doing? &amp;nbsp;Macro lists and variables all over the place, far overcomplicated messy code?&lt;/P&gt;
&lt;P&gt;If you really need - and I would strongly advise there are far better methods - a list of macro variables called PE1/2/3 date then do it in a datastep:&lt;/P&gt;
&lt;PRE&gt;%let prog_kw=201701,201702,201703,201704,201705,201706,201707,201708,201709,201710,201711;

data a;
  do i=1 to countw("&amp;amp;prog_kw.",",") by 3;
    call symputx(cats('pe1_',scan("&amp;amp;prog_kw.",i,',')),"","g");
    call symputx(cats('pe2_',scan("&amp;amp;prog_kw.",i+1,',')),"","g");
    call symputx(cats('pe3_',scan("&amp;amp;prog_kw.",i+2,',')),"","g");
  end;
run;&lt;/PRE&gt;
&lt;P&gt;Also note, "&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201702 and PE_201703 for first iteration." - you will not get this, all the assignments are within the loop, so all area assigned scan(1), then next loop scan(2) etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Again, this really isn't the best method of achieving whatever it is your doing, if this came cross my desk I would delete it without even looking at it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339150#M77359</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-08T09:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339152#M77360</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note, "&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201702 and PE_201703 for first iteration." - you will not get this, all the assignments are within the loop, so all area assigned scan(1), then next loop scan(2) etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;...&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;sorry, typo:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201701 and PE3_201701 for first iteration.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;BTW the is a lot of more&amp;nbsp; code in the loop, e.g. some PROC SQL....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope it's clear now.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 09:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339152#M77360</guid>
      <dc:creator>defaz</dc:creator>
      <dc:date>2017-03-08T09:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339155#M77362</link>
      <description>&lt;P&gt;Then slight update:&lt;/P&gt;
&lt;PRE&gt;%let prog_kw=201701,201702,201703,201704,201705,201706,&lt;WBR /&gt;201707,201708,201709,201710,201711;

data a;
  do i=1 to countw("&amp;amp;prog_kw.",",") ;
    call symputx(cats('pe1_',scan("&amp;amp;prog_kw.",i,',')),"","g&lt;WBR /&gt;");
    call symputx(cats('pe2_',scan("&amp;amp;prog_kw.",i,',')),"",&lt;WBR /&gt;"g");
    call symputx(cats('pe3_',scan("&amp;amp;prog_kw.",i,',')),"",&lt;WBR /&gt;"g");
  end;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, on "&lt;SPAN&gt;BTW the is a lot of more&amp;nbsp; code in the loop, e.g. some PROC SQL...." - it doesn't matter if there is a million lines of code, and it directs a space shuttle to the moon, this really is not the way to go. &amp;nbsp;Why do you need those dates as macro variable names, that sounds bad. &amp;nbsp;Why do you need all those macro varaibles, that also sounds bad. &amp;nbsp;It sounds very much like you have not heard of by group processing and data modelling and are trying to fix this lack of understanding with macro code. &amp;nbsp; It will fail, and you will be forever trying to maintain it. &amp;nbsp;Trust me, there are far better ways of doing whatever it is your tring to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339155#M77362</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-08T10:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339157#M77364</link>
      <description>&lt;P&gt;Do it much simpler:&lt;/P&gt;
&lt;P&gt;Wrap your core code in a macro with the three parameters. Avoid any month codes or similar in the macro variable names. Just use param1,param2,param3.&lt;/P&gt;
&lt;P&gt;In a data _null_ step, read your parameters from cards/datalines and call the macro with call execute and the parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you are doing now is like shaking cocktails with nitroglyzerine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339157#M77364</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-08T10:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339159#M77365</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Then slight update:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also note, on "&lt;SPAN&gt;BTW the is a lot of more&amp;nbsp; code in the loop, e.g. some PROC SQL...." - it doesn't matter if there is a million lines of code, and it directs a space shuttle to the moon, this really is not the way to go. &amp;nbsp;Why do you need those dates as macro variable names, that sounds bad. &amp;nbsp;Why do you need all those macro varaibles, that also sounds bad. &amp;nbsp;It sounds very much like you have not heard of by group processing and data modelling and are trying to fix this lack of understanding with macro code. &amp;nbsp; It will fail, and you will be forever trying to maintain it. &amp;nbsp;Trust me, there are far better ways of doing whatever it is your tring to do.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Don't judge on things you don't know about.&lt;/P&gt;&lt;P&gt;I&amp;nbsp;have to maintain some 100K&amp;nbsp;lines of SAS code written&amp;nbsp;by others and prepare data for 3rd party software within a given data model.&lt;/P&gt;&lt;P&gt;No budget for reengeneering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:22:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339159#M77365</guid>
      <dc:creator>defaz</dc:creator>
      <dc:date>2017-03-08T10:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339161#M77367</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macrovariables generated by %qscan contain spaces. You can remove them with %trim.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339161#M77367</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-08T10:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339162#M77368</link>
      <description>My explanation is wrong but the solution works.&lt;BR /&gt;Using %scan instead of %qscan also avoids getting this error message.</description>
      <pubDate>Wed, 08 Mar 2017 10:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339162#M77368</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-08T10:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339164#M77370</link>
      <description>&lt;P&gt;The problem is, I do know about it, and have had to do this several times. &amp;nbsp;Patching up badly engineered code just ends up with badly patched badly engineered code that falls over every time it is run and fails any audit. &amp;nbsp;Anyways, its up to you, the code should answer your question.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 10:46:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339164#M77370</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-03-08T10:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339168#M77373</link>
      <description>&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings10/147-2010.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings10/147-2010.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"A macro-quoting function uses&lt;BR /&gt;hexadecimal delta characters to mask special characters in the value of a macro variable. These delta characters&lt;BR /&gt;can often cause syntax errors in code that appears to be completely acceptable in the log."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;321&amp;nbsp; %let a=%quote(10);&lt;BR /&gt;322&amp;nbsp; %global b&amp;amp;a.;&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Macro variable A resolves to 10&lt;BR /&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro quoting have been&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unquoted for printing.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 11:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339168#M77373</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2017-03-08T11:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339169#M77374</link>
      <description>&lt;P&gt;I don't see in your code assigning values to the global macro variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  %let L_cnt=%sysfunc(countw(%quote(&amp;amp;PROG_KW_LIST)));
  %put &amp;amp;=L_cnt;
  %put &amp;amp;=PROG_KW_LIST;
  %do i1 = 1 %to &amp;amp;L_cnt;
    %let PROG_KW=%qscan(%quote(&amp;amp;PROG_KW_LIST.),&amp;amp;i1.,%str(,));
    %put &amp;amp;PROG_KW;                     /* line edited, the equal sign was droped */
    %put before global;
    %global PE1_&amp;amp;PROG_KW PE2_&amp;amp;PROG_KW PE3_&amp;amp;PROG_KW;
    %put after global;.....  %end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;e.g. - you defined macro variable:&amp;nbsp;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;CODE class=" language-sas"&gt;PE1_&amp;amp;PROG_KW&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;Do you have somewhere code like: &amp;nbsp;&lt;STRONG&gt;%LET&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;PE1_&amp;amp;PROG_KW = ...;&lt;/STRONG&gt; to assign its value ?&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 11:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339169#M77374</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-03-08T11:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339176#M77376</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;defaz wrote&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;No budget for reengeneering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's the typical stupid line that keeps totally ******* code alive. That "budget" is always there, it's just payed for in the future, when the stinking mess causes problems after problems after problems. Kick that "code" into the can where it belongs and write something that is worth maintaining.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 11:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339176#M77376</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-03-08T11:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid symbolic variable name issue</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339279#M77405</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/120967"&gt;@defaz&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, "&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201702 and PE_201703 for first iteration." - you will not get this, all the assignments are within the loop, so all area assigned scan(1), then next loop scan(2) etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;...&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;sorry, typo:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I expect global variables PE1_201701, PE2_201701 and PE3_201701 for first iteration.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BTW the is a lot of more&amp;nbsp; code in the loop, e.g. some PROC SQL....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I hope it's clear now.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since the variable scope is supposed to be &lt;STRONG&gt;global&lt;/STRONG&gt; there is&amp;nbsp;little reason&amp;nbsp; to have it imbedded in code that generates lots of other items. This may be an indication that the whole process could/should be broken into smaller pieces or macro modules, each of which may be easier to maintain and document.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 15:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Invalid-symbolic-variable-name-issue/m-p/339279#M77405</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-08T15:41:53Z</dc:date>
    </item>
  </channel>
</rss>

