<?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: Macro for transforming multiple tables based on a code. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-transforming-multiple-tables-based-on-a-code/m-p/456933#M115802</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;&lt;BR /&gt;%macro tsp(icdNum);&lt;BR /&gt;
proc transpose data=&amp;amp;icdNum out=_&amp;amp;icdNum;
var l:;
run;

proc transpose data=_&amp;amp;icdNum out=__&amp;amp;icdNum;
by _name_;
var col:;
run;
&lt;BR /&gt;data ___&amp;amp;icdNum;
set __&amp;amp;icdNum;
where col1 ne '';
run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD7);&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD8);&lt;BR /&gt;
%tsp(ICD9);&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD10);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Might work :)?&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Apr 2018 16:00:33 GMT</pubDate>
    <dc:creator>FredrikE</dc:creator>
    <dc:date>2018-04-24T16:00:33Z</dc:date>
    <item>
      <title>Macro for transforming multiple tables based on a code.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-transforming-multiple-tables-based-on-a-code/m-p/456923#M115801</link>
      <description>&lt;P&gt;Hi everyone&lt;/P&gt;
&lt;P&gt;A quick one. i have a code that transforms a table (ICD10 into __ICD10):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

proc transpose data=ICD10 out=_ICD10;
var l:;
run;

proc transpose data=_ICD10 out=__ICD10;
by _name_;
var col:;
run;

data ___ICD10;
set __ICD10;
where col1 ne '';
run;
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem is that I need to do the same thing for ICD7, ICD8, ICD9 and ICD10. My question is, is there a way to care a macro version from the above code to call and use with&amp;nbsp; ICD7-ICD10 instead of repeating the code? All intermediate files can also be deleted to avoid cluttering.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 20:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-transforming-multiple-tables-based-on-a-code/m-p/456923#M115801</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2018-04-24T20:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for transforming multiple tables based on a code.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-transforming-multiple-tables-based-on-a-code/m-p/456933#M115802</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;rsubmit;&lt;BR /&gt;%macro tsp(icdNum);&lt;BR /&gt;
proc transpose data=&amp;amp;icdNum out=_&amp;amp;icdNum;
var l:;
run;

proc transpose data=_&amp;amp;icdNum out=__&amp;amp;icdNum;
by _name_;
var col:;
run;
&lt;BR /&gt;data ___&amp;amp;icdNum;
set __&amp;amp;icdNum;
where col1 ne '';
run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD7);&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD8);&lt;BR /&gt;
%tsp(ICD9);&lt;BR /&gt;&lt;BR /&gt;%tsp(ICD10);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;endrsubmit;&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Might work :)?&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2018 16:00:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-transforming-multiple-tables-based-on-a-code/m-p/456933#M115802</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2018-04-24T16:00:33Z</dc:date>
    </item>
  </channel>
</rss>

