<?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: Call Symputx doesn't work? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366931#M64890</link>
    <description>&lt;P&gt;Some test data in the form of a datastep would help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are lists of variables not "--". &amp;nbsp;Anyways, if there are multple calls of symput, i.e. more rows than one resolve, then that messes up the system. &amp;nbsp;You could of course simplfy the code to:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vcolumn (where=(libname="WORK" and memname="TEST")) end=last;
  if _n_=1 then call execute('proc datasets library=work; modify test; rename ');
  call execute(catx('=',name,tranwrd(tranwrd(name,"nad_dx","bd_dx"),"nad_cert",bd_dx_cert")));
  if last then call execute(';quit;run;');
run;&lt;/PRE&gt;
&lt;P&gt;This will generate one proc datasets code which will do the renaming (note proc datasets is better at resources for these header changes). &amp;nbsp;Althought the question arises, why renaming these, they must have been created somewhere, just update there, or alternatively, normalise your data - this makes it far easier to work for programming (so data goes down as question + value pairs), you could simplfy your process then, and if at the end you need data across then transpose at the end.&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2017 12:54:15 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-06-14T12:54:15Z</dc:date>
    <item>
      <title>Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366922#M64887</link>
      <description>&lt;P&gt;Good morning,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a macro to rename variables based on different conditions.&amp;nbsp;&amp;nbsp; I got N1=18 and N2=16 from Proc means statement.&amp;nbsp; Then, I would like to assign 'num' to different values based on different 'If-then'&amp;nbsp;conditions.&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally, I call the macro.&amp;nbsp; However, I got an error massage from Log, showing below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;contents&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=have (keep=NAME);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; temp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; have;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; substr(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'nad_dx'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; N1=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;else&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; substr(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'nad_cert'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; N2=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=temp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;n&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Var&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;_numeric_&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;Output&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;out&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;=want &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;sum&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; =;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;Run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; macro;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; want;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; substr(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'nad_dx'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symputx(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'num'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, N1, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'G'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;if&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; substr(name,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;, &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;8&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;)=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'nad_cert'&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;then&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;call&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; symputx (&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'num'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, N2, &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'G'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; rename;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; test;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nad_dx_1-nad_dx_&amp;amp;num=bd_dx_1-bd_dx_&amp;amp;num;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nad_cert_1-nad_cert_&amp;amp;num=bd_dx_cert_1-bd_dx_cert_&amp;amp;num;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;27 data rename;&lt;/P&gt;&lt;P&gt;28 set test;&lt;/P&gt;&lt;P&gt;29 rename nad_dx_1-nad_dx_&amp;amp;num=bd_dx_1-bd_dx_&amp;amp;num;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 73&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUM not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUM not resolved.&lt;/P&gt;&lt;P&gt;30 rename nad_cert_1-nad_cert_&amp;amp;num=bd_dx_cert_1-bd_dx_cert_&amp;amp;num;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 76&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUM not resolved.&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference NUM not resolved.&lt;/P&gt;&lt;P&gt;ERROR 73-322: Expecting an =.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;&lt;P&gt;31 run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.RENAME may be incomplete. When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;observations and 34 variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I would like to the final statement showing as below, please advice how to fix it.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nad_dx_1-nad_dx_18=bd_dx_1-bd_dx_18;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;rename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; nad_cert_1-nad_cert_16=bd_dx_cert_1-bd_dx_cert_16;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 14:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366922#M64887</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-14T14:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366927#M64889</link>
      <description>&lt;P&gt;I bet that your dataset want does not have a matching value for&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if substr(name,1, 6)='nad_dx'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if substr(name,1, 8)='nad_cert'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it looks like the values are there, watch out for leading blanks.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 12:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366927#M64889</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-06-14T12:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366931#M64890</link>
      <description>&lt;P&gt;Some test data in the form of a datastep would help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are lists of variables not "--". &amp;nbsp;Anyways, if there are multple calls of symput, i.e. more rows than one resolve, then that messes up the system. &amp;nbsp;You could of course simplfy the code to:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set sashelp.vcolumn (where=(libname="WORK" and memname="TEST")) end=last;
  if _n_=1 then call execute('proc datasets library=work; modify test; rename ');
  call execute(catx('=',name,tranwrd(tranwrd(name,"nad_dx","bd_dx"),"nad_cert",bd_dx_cert")));
  if last then call execute(';quit;run;');
run;&lt;/PRE&gt;
&lt;P&gt;This will generate one proc datasets code which will do the renaming (note proc datasets is better at resources for these header changes). &amp;nbsp;Althought the question arises, why renaming these, they must have been created somewhere, just update there, or alternatively, normalise your data - this makes it far easier to work for programming (so data goes down as question + value pairs), you could simplfy your process then, and if at the end you need data across then transpose at the end.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 12:54:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366931#M64890</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-06-14T12:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366935#M64891</link>
      <description>&lt;P&gt;Your proc means won't create a variable called NAME unless there is a variable called name in your dataset. However, if there were, it would contain a numeric value because that is what you instructed proc means to produce.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366935#M64891</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-06-14T13:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366954#M64892</link>
      <description>&lt;P&gt;The reason that the macro varaible is NOT created is because the CALL SYMPUTX() never runs.&lt;/P&gt;
&lt;P&gt;But your logic seems flawed. &amp;nbsp;What are you trying to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to find how many variables in TEMP start with the characters NAD_DX then you could do something like this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set test ;
  array n1 nad_dx_:;
  array n2 nad_cert_: ;
  call symputx('n1',dim(n1));
  call symputx('n2',dim(n2));
  stop;
run;

data rename ;
  set test;
  rename nad_dx_1-nad_dx_&amp;amp;n1=bd_dx_1-bd_dx_&amp;amp;n1;
  rename nad_cert_1-nad_cert_&amp;amp;n2=bd_dx_cert_1-bd_dx_cert_&amp;amp;n2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366954#M64892</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-14T13:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366957#M64894</link>
      <description>&lt;P&gt;Have you taken the &lt;STRONG&gt;free&lt;/STRONG&gt; online SAS Programming 1 course? This page has a link to the course:&amp;nbsp; &lt;A href="https://support.sas.com/edu/elearning.html?ctry=us&amp;amp;productType=library" target="_blank"&gt;https://support.sas.com/edu/elearning.html?ctry=us&amp;amp;productType=library&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:45:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366957#M64894</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-14T13:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366959#M64895</link>
      <description>&lt;P&gt;I passed both base and adv tests.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:46:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366959#M64895</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-14T13:46:57Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366965#M64896</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the variable num is not created in 'macro' if the condition is not fulfilled but you still try to resolve it in 'rename'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc means data=temp n;
   Var _numeric_;
   Output out=want sum =;
Run;

 
%macro doit;
   %let num=;
   data macro;
      set want;
      if substr(name,1, 6)='nad_dx' then call symputx('num', N1, 'G');
      if substr(name,1, 8)='nad_cert' then call symputx ('num', N2, 'G');
   run;


   data rename;
      set test;
      %if &amp;amp;num. ne %then %do;
         rename nad_dx_1-nad_dx_&amp;amp;num=bd_dx_1-bd_dx_&amp;amp;num;
         rename nad_cert_1-nad_cert_&amp;amp;num=bd_dx_cert_1-bd_dx_cert_&amp;amp;num;
      %end;
   run;

%mend doit;
%doit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Jun 2017 13:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366965#M64896</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-06-14T13:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366974#M64897</link>
      <description>&lt;P&gt;Actually defining a %LOCAL macro variable and then using CALL SYMPUTX() with the 'G' or 'GLOBAL' option will cause confusion.&lt;/P&gt;
&lt;P&gt;The CALL SYMPUTX() will update the GLOBAL macro variable named NUM but the later references to &amp;amp;NUM inside the macro will use the value of the LOCAL macro variable with the same name.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77163"&gt;@Oligolas&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the variable num is not created in 'macro' if the condition is not fulfilled but you still try to resolve it in 'rename'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc means data=temp n;
   Var _numeric_;
   Output out=want sum =;
Run;

 
%macro doit;
   %let num=;
   data macro;
      set want;
      if substr(name,1, 6)='nad_dx' then call symputx('num', N1, 'G');
      if substr(name,1, 8)='nad_cert' then call symputx ('num', N2, 'G');
   run;


   data rename;
      set test;
      %if &amp;amp;num. ne %then %do;
         rename nad_dx_1-nad_dx_&amp;amp;num=bd_dx_1-bd_dx_&amp;amp;num;
         rename nad_cert_1-nad_cert_&amp;amp;num=bd_dx_cert_1-bd_dx_cert_&amp;amp;num;
      %end;
   run;

%mend doit;
%doit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2017 14:19:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/366974#M64897</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-06-14T14:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/367194#M64904</link>
      <description>&lt;P&gt;Thanks for all of your great help. &amp;nbsp;I learn a lot here.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 00:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/367194#M64904</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-15T00:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Call Symputx doesn't work?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/367195#M64905</link>
      <description>&lt;P&gt;Thanks for your effort, Oligolas.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jun 2017 00:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Call-Symputx-doesn-t-work/m-p/367195#M64905</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2017-06-15T00:48:59Z</dc:date>
    </item>
  </channel>
</rss>

