<?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 CALL SYMPUTX: How to eliminate a redundant macro parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805746#M317394</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code in data _null_&amp;nbsp; is&amp;nbsp; :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;           CALL SYMPUTX(COMPRESS('NOM_Mode_n1'),propcase(lb_lg_1));&lt;BR /&gt;            CALL SYMPUTX(COMPRESS('NOM_Mode_n2'),propcase(lb_lg_2));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n3'),propcase(lb_lg_3));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n4'),propcase(lb_lg_4));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n5'),propcase(lb_lg_5));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n6'),propcase(lb_lg_6));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n7'),propcase(lb_lg_7));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n8'),propcase(lb_lg_8));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to reduce the code with this line :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    %do i=1 %to 8;
CALL SYMPUTX(COMPRESS('NOM_Mode_de_gest_n&amp;amp;i.'),propcase(lb_lg_gar_1));
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But while running this code&amp;nbsp; I have an error message:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ERROR: Symbolic variable name NOM_MODE_DE_GEST_N&amp;amp;I. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('NOM_Mode_de_'[12 of 21 characters shown],' '[12 of 50 characters shown]) at line &lt;BR /&gt;486 column 10 is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help me please to resolve this error ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
    <pubDate>Sun, 03 Apr 2022 20:27:04 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2022-04-03T20:27:04Z</dc:date>
    <item>
      <title>CALL SYMPUTX: How to eliminate a redundant macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805746#M317394</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code in data _null_&amp;nbsp; is&amp;nbsp; :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;nbsp;           CALL SYMPUTX(COMPRESS('NOM_Mode_n1'),propcase(lb_lg_1));&lt;BR /&gt;            CALL SYMPUTX(COMPRESS('NOM_Mode_n2'),propcase(lb_lg_2));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n3'),propcase(lb_lg_3));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n4'),propcase(lb_lg_4));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n5'),propcase(lb_lg_5));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n6'),propcase(lb_lg_6));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n7'),propcase(lb_lg_7));
			CALL SYMPUTX(COMPRESS('NOM_Mode_n8'),propcase(lb_lg_8));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would like to reduce the code with this line :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;    %do i=1 %to 8;
CALL SYMPUTX(COMPRESS('NOM_Mode_de_gest_n&amp;amp;i.'),propcase(lb_lg_gar_1));
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But while running this code&amp;nbsp; I have an error message:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ERROR: Symbolic variable name NOM_MODE_DE_GEST_N&amp;amp;I. must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX('NOM_Mode_de_'[12 of 21 characters shown],' '[12 of 50 characters shown]) at line &lt;BR /&gt;486 column 10 is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help me please to resolve this error ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you !&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 20:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805746#M317394</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-04-03T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUTX: How to eliminate a redundant macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805749#M317395</link>
      <description>&lt;P&gt;Use double quotes.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_1-1649017875827.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70078i2E123E417F9468CF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_1-1649017875827.png" alt="Patrick_1-1649017875827.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What's the purpose of the compress() function in above expression?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Apr 2022 20:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805749#M317395</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-04-03T20:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: CALL SYMPUTX: How to eliminate a redundant macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805750#M317396</link>
      <description>&lt;P&gt;Since you are running a DATA step, you need to use a DO loop, not a %DO loop.&amp;nbsp; For example,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array lb_lg_ {8};
do i=1 to 8;
   call symputx('NOM_Mode_n' || put(i, 1.), propcase(lb_lg_{i}));
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Apr 2022 21:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CALL-SYMPUTX-How-to-eliminate-a-redundant-macro-parameter/m-p/805750#M317396</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-04-03T21:13:15Z</dc:date>
    </item>
  </channel>
</rss>

