<?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: SAS Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695539#M212259</link>
    <description>I have 3 data sets named ref&amp;amp;i._&amp;amp;j  where &amp;amp;i refers to the number of subj&lt;BR /&gt;while the &amp;amp;j refers to the repetition.&lt;BR /&gt;&lt;BR /&gt;The data sets contain the following columns &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;an1&lt;BR /&gt;&lt;BR /&gt;COL1&lt;BR /&gt;&lt;BR /&gt;COL2&lt;BR /&gt;&lt;BR /&gt;COL3&lt;BR /&gt;&lt;BR /&gt;Treat&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;These ref data set will be set to aref&amp;amp;i._&amp;amp;j respective data sets.&lt;BR /&gt;&lt;BR /&gt;For the data set aref1._1, I would like to retain the columns an1, col1, and&lt;BR /&gt;treat whereas for aref1._2 I would like to retain columns an1, col2, and&lt;BR /&gt;treat.  For aref1._3 I would like to retain an1, col3, and treat.  Hopefully&lt;BR /&gt;this will sufficiently clarify what I want.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
    <pubDate>Fri, 30 Oct 2020 17:00:35 GMT</pubDate>
    <dc:creator>jacksonan123</dc:creator>
    <dc:date>2020-10-30T17:00:35Z</dc:date>
    <item>
      <title>SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695491#M212235</link>
      <description>&lt;P&gt;I have generated files&amp;nbsp;ref1_1 and&amp;nbsp;ref1_2&amp;nbsp; where the first number refers to the subject while the second is the repetition.&amp;nbsp; An example ref file is below and will have multiple columns depending upon the number of reps. The posted has 3 since &amp;amp;j=3.&amp;nbsp; What I would like to do is keep an1, Col&amp;amp;j, and treat where the column that is retained matches the &amp;amp;j (eg, for AREF1._1 an1,col1, and treat) whereas for AREF1._2 it would be an1,col2, and treat. I need to know how to create a macrovariable out of the columns so that the desired one can be put into the keep statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example ref file.&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="64" height="19" style="height: 14.4pt; width: 48pt;"&gt;an1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;COL1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;COL2&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;COL3&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;Treat&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;ka1&lt;/TD&gt;
&lt;TD align="right"&gt;4.4E+08&lt;/TD&gt;
&lt;TD align="right"&gt;0.649438&lt;/TD&gt;
&lt;TD align="right"&gt;-0.22775&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;ka2&lt;/TD&gt;
&lt;TD align="right"&gt;2E+09&lt;/TD&gt;
&lt;TD align="right"&gt;1.004508&lt;/TD&gt;
&lt;TD align="right"&gt;-0.17851&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;cl&lt;/TD&gt;
&lt;TD align="right"&gt;8.35E+08&lt;/TD&gt;
&lt;TD align="right"&gt;7.486796&lt;/TD&gt;
&lt;TD align="right"&gt;6.484179&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;vf&lt;/TD&gt;
&lt;TD align="right"&gt;5.19E+08&lt;/TD&gt;
&lt;TD align="right"&gt;8.70274&lt;/TD&gt;
&lt;TD align="right"&gt;7.372281&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;D1&lt;/TD&gt;
&lt;TD align="right"&gt;92912286&lt;/TD&gt;
&lt;TD align="right"&gt;2.528415&lt;/TD&gt;
&lt;TD align="right"&gt;0.134371&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;lag&lt;/TD&gt;
&lt;TD align="right"&gt;1.88E+08&lt;/TD&gt;
&lt;TD align="right"&gt;1.673499&lt;/TD&gt;
&lt;TD align="right"&gt;1.299389&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD height="19" style="height: 14.4pt;"&gt;logit&lt;/TD&gt;
&lt;TD align="right"&gt;-1883756&lt;/TD&gt;
&lt;TD align="right"&gt;0.333883&lt;/TD&gt;
&lt;TD align="right"&gt;-0.71054&lt;/TD&gt;
&lt;TD&gt;BREF&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%MACRO bootR;
%do i=1% to 34;
%DO j=1% to 3;
DATA  AREF&amp;amp;i._&amp;amp;j;
set ref&amp;amp;i._&amp;amp;j;
Treat='BREF';
run;

DATA  BTES&amp;amp;i._&amp;amp;j;
set TES&amp;amp;i._&amp;amp;j;
Treat='ATES';

run;

PROC EXPORT DATA=aref1_1
            OUTFILE= '/folders/myfolders/IMLSUBGEN/ref1_1.csv' 
            DBMS=CSV REPLACE;
PROC EXPORT DATA=aref2_2
            OUTFILE= '/folders/myfolders/IMLSUBGEN/ref2_2.csv' 
            DBMS=CSV REPLACE;
RUN; 
%end;
%end;
%mend bootR;
%bootR;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 14:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695491#M212235</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T14:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695496#M212237</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I need to know how to create a macrovariable out of the columns so that the desired one can be put into the keep statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is your question how to extract the last digit of the file name (ref1_2) into a macro variable? Or is your question how to determine the number of columns from the contents of the data set?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 14:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695496#M212237</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-30T14:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695497#M212238</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Please find attached one possible solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data ref1_1;&lt;BR /&gt;&amp;nbsp; infile cards;&lt;BR /&gt;&amp;nbsp; input ant1 $ col1 col2 col3 treat $;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cards;&lt;BR /&gt;ka1 4.4E+08 0.649438 -0.22775 BREF&lt;BR /&gt;ka2 2E+09 1.004508 -0.17851 BREF&lt;BR /&gt;cl 8.35E+08 7.486796 6.484179 BREF&lt;BR /&gt;vf 5.19E+08 8.70274 7.372281 BREF&lt;BR /&gt;D1 92912286 2.528415 0.134371 BREF&lt;BR /&gt;lag 1.88E+08 1.673499 1.299389 BREF&lt;BR /&gt;logit -1883756 0.333883 -0.71054 BREF&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%MACRO bootR;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%do i=1% to 34;&lt;BR /&gt;&amp;nbsp; %DO j=1% to 3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;DATA AREF&amp;amp;i._&amp;amp;j(keep=ant1 col&amp;amp;j treat);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;set ref1_1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Treat='BREF';&lt;BR /&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;/*Not sure what TES&amp;amp;i.&amp;amp;j is so commenting it out*/&lt;BR /&gt;/*DATA BTES&amp;amp;i._&amp;amp;j;*/&lt;BR /&gt;/*set TES&amp;amp;i._&amp;amp;j;*/&lt;BR /&gt;/*Treat='ATES';*/&lt;BR /&gt;/**/&lt;/P&gt;
&lt;P&gt;/*run;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA=aref1_1&lt;BR /&gt;OUTFILE= '/folders/myfolders/IMLSUBGEN/ref1_1.csv' &lt;BR /&gt;DBMS=CSV REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC EXPORT DATA=aref2_2&lt;BR /&gt;OUTFILE= '/folders/myfolders/IMLSUBGEN/ref2_2.csv' &lt;BR /&gt;DBMS=CSV REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%mend bootR;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%bootR;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 15:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695497#M212238</guid>
      <dc:creator>CarmineVerrell</dc:creator>
      <dc:date>2020-10-30T15:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695510#M212245</link>
      <description>My question is how to keep the column that matches the &amp;amp;j for the AREF data&lt;BR /&gt;set from the ref&amp;amp;i,_&amp;amp;j data set in addition to the columns  an1 and treat .&lt;BR /&gt;For an actual run there could be 1000 columns (i.e., col1 col2..col1000) and&lt;BR /&gt;&amp;amp;j for ref would  be Do j=1% to 1000.&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2020 15:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695510#M212245</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T15:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695517#M212249</link>
      <description>&lt;P&gt;So, first you said "&lt;SPAN&gt;I need to know how to create a macrovariable out of the columns" and now you say "how to keep the column that matches the &amp;amp;j". These are not the same, and before I go ahead and write code, I want to be 100% sure I understand your request.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 15:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695517#M212249</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-30T15:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695526#M212255</link>
      <description>I need to retain the desired columns.  My initial thoughts was that it could&lt;BR /&gt;be best done via a macrovariable, but based upon you response and expertise&lt;BR /&gt;that would not be the way to go.&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:31:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695526#M212255</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T16:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695535#M212257</link>
      <description>This will not work because I will have in my actual runs %DO j=1% to 1000&lt;BR /&gt;which means that I would have to code the set ref1_1 many times up to set&lt;BR /&gt;ref1_1000 which is not practical.&lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695535#M212257</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695536#M212258</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44100"&gt;@jacksonan123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I need to retain the desired columns. My initial thoughts was that it could&amp;nbsp;be best done via a macrovariable, but based upon you response and expertise&amp;nbsp;that would not be the way to go.&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I never said this. I am still asking for clarification.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 16:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695536#M212258</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-30T16:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695539#M212259</link>
      <description>I have 3 data sets named ref&amp;amp;i._&amp;amp;j  where &amp;amp;i refers to the number of subj&lt;BR /&gt;while the &amp;amp;j refers to the repetition.&lt;BR /&gt;&lt;BR /&gt;The data sets contain the following columns &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;an1&lt;BR /&gt;&lt;BR /&gt;COL1&lt;BR /&gt;&lt;BR /&gt;COL2&lt;BR /&gt;&lt;BR /&gt;COL3&lt;BR /&gt;&lt;BR /&gt;Treat&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;These ref data set will be set to aref&amp;amp;i._&amp;amp;j respective data sets.&lt;BR /&gt;&lt;BR /&gt;For the data set aref1._1, I would like to retain the columns an1, col1, and&lt;BR /&gt;treat whereas for aref1._2 I would like to retain columns an1, col2, and&lt;BR /&gt;treat.  For aref1._3 I would like to retain an1, col3, and treat.  Hopefully&lt;BR /&gt;this will sufficiently clarify what I want.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2020 17:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695539#M212259</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T17:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695566#M212265</link>
      <description>&lt;P&gt;I am sorry but I don't understand, as the coding example i have provided gives you what you have described in a previous response(see below-response i am talking about). If it is not giving you the right results can you please clarify? Thanks so much.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For the data set aref1._1, I would like to retain the columns an1, col1, and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;treat whereas for aref1._2 I would like to retain columns an1, col2, and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;treat. For aref1._3 I would like to retain an1, col3, and treat. Hopefully&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this will sufficiently clarify what I want.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 18:03:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695566#M212265</guid>
      <dc:creator>CarmineVerrell</dc:creator>
      <dc:date>2020-10-30T18:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695585#M212272</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;EXTERNAL&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In words this is my best explanation:&lt;/P&gt;
&lt;P&gt;For the data set aref1._1, I would like to retain the columns an1, col1, and&lt;BR /&gt;treat whereas for aref1._2 I would like to retain columns an1, col2, and&lt;BR /&gt;treat. For aref1._3 I would like to retain an1, col3, and treat. Hopefully&lt;BR /&gt;this will sufficiently clarify what I want.&lt;/P&gt;
&lt;P&gt;I will try again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For each data set DATA&amp;nbsp; AREF&amp;amp;i._&amp;amp;j where &amp;amp;i refers to subject and &amp;amp;j refers to replicate.The data ref&amp;amp;i._&amp;amp;j which are replicate data sets for a subject in this case subject 1.&amp;nbsp; These will be set to AREF&amp;amp;i._&amp;amp;j dependent upon the &amp;amp;i and &amp;amp;j values.The data sets REF&amp;amp;i._&amp;amp;j (i.e., ref1_1 and ref1_2) contain the following columns an1, col1,col2, and col3For each data set the columns contain values (e.g., col2 &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="64"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;0.649438&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;1.004508&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;7.486796&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;8.70274&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;2.528415&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;1.673499&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="64"&gt;
&lt;P&gt;0.333883&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For any given subjects &amp;nbsp;AREF1_1 and AREF1_2 I would like to have REF1_1 and REF1_2 set to those AREF files respectively.&amp;nbsp; The set files and the column to be kept are determined by the subject and the replication.&amp;nbsp; For AREF1_1 col1 is kept while for AREF1_2 col2 is kept.&amp;nbsp; In summary, &amp;nbsp;the col number corresponding to the &amp;amp;j value is kept.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully this is a clearer explanation.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2020 20:29:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695585#M212272</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T20:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695587#M212274</link>
      <description>When I used your code:&lt;BR /&gt;&lt;BR /&gt;%MACRO bootR;&lt;BR /&gt;%do i=1% to 34;&lt;BR /&gt;%DO j=1% to 3;&lt;BR /&gt;DATA  AREF&amp;amp;i._&amp;amp;j(keep=an1 col&amp;amp;j);&lt;BR /&gt;set ref1_1;&lt;BR /&gt;Treat='BREF';&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;I get the following errors in the log.&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;SYMBOLGEN:  Macro variable J resolves to 3&lt;BR /&gt;&lt;BR /&gt;22: LINE and COLUMN cannot be determined.&lt;BR /&gt;&lt;BR /&gt;NOTE 242-205: NOSPOOL is on. Rerunning with OPTION SPOOL might allow&lt;BR /&gt;recovery of the LINE and COLUMN where the error has occurred.&lt;BR /&gt;&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATA,&lt;BR /&gt;DBLABEL, DBMS, DEBUG, FILE, LABEL, OUTFILE, OUTTABLE, &lt;BR /&gt;&lt;BR /&gt;               REPLACE, TABLE, _DEBUG_.  &lt;BR /&gt;&lt;BR /&gt; SYMBOLGEN:  Macro variable J resolves to 3&lt;BR /&gt;&lt;BR /&gt;200: LINE and COLUMN cannot be determined.&lt;BR /&gt;&lt;BR /&gt;NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the&lt;BR /&gt;LINE and COLUMN where the error has occurred.&lt;BR /&gt;&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;BR /&gt;&lt;BR /&gt;NOTE: PROCEDURE EXPORT used (Total process time):&lt;BR /&gt;&lt;BR /&gt;       real time           0.00 seconds&lt;BR /&gt;&lt;BR /&gt;       cpu time            0.00 seconds&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Fri, 30 Oct 2020 20:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695587#M212274</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-30T20:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695684#M212327</link>
      <description>&lt;P&gt;Using symput allows one to keep the desired column for each AREF&amp;amp;i._&amp;amp;j data sets and solves the post.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

%MACRO bootR;
%do i=1% to 34;
%DO j=1% to 3;
DATA  AREF&amp;amp;i._&amp;amp;j(keep=an1 col&amp;amp;j treat);
set ref&amp;amp;i._&amp;amp;j;
call symput ("col&amp;amp;j", col1);
Treat='BREF';

run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 31 Oct 2020 20:59:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro/m-p/695684#M212327</guid>
      <dc:creator>jacksonan123</dc:creator>
      <dc:date>2020-10-31T20:59:52Z</dc:date>
    </item>
  </channel>
</rss>

