<?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 Macro loop to get particular array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709422#M218142</link>
    <description>&lt;P&gt;For every parameter, there is needed different scope of subcategories. I'm trying to do these by getting the respective array name for the respective parameter's name in the macro loop, but I can't find the way to get the array name in the loop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro arrs(j);&lt;BR /&gt;%do i=1 %to %dim(arr.&amp;amp;j);&lt;BR /&gt;category=arr1(i);&lt;BR /&gt;output;&lt;BR /&gt;%end;&lt;BR /&gt;%mend arrs;&lt;/P&gt;&lt;P&gt;data mock;&lt;BR /&gt;length param category $200;&lt;/P&gt;&lt;P&gt;array arr1(4) $200 ("Safety Analysis Set [a]" "Safety Run-in Set [b]" "Efficacy Evaluable Set (c)" "Immunogenity Analysis Set (d)");&lt;BR /&gt;array arr2(2) $200 ("Completed Study" "Discontinued Study");&lt;BR /&gt;array arr3(2) $200 ("Competed Treatment" "Terminated Treatment");&lt;BR /&gt;array arr4(6) $200 ("Death" "Lost to Follow-up" "Withdrawal by patient from study" "Termination of study by sponsor"&lt;BR /&gt;"Completed 24 months of therapy" "Other");&lt;/P&gt;&lt;P&gt;do id=1 to 6;&lt;BR /&gt;param=put(id,param.);&lt;BR /&gt;%arrs(id);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2021 14:15:34 GMT</pubDate>
    <dc:creator>kaet78ha</dc:creator>
    <dc:date>2021-01-05T14:15:34Z</dc:date>
    <item>
      <title>Macro loop to get particular array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709422#M218142</link>
      <description>&lt;P&gt;For every parameter, there is needed different scope of subcategories. I'm trying to do these by getting the respective array name for the respective parameter's name in the macro loop, but I can't find the way to get the array name in the loop.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro arrs(j);&lt;BR /&gt;%do i=1 %to %dim(arr.&amp;amp;j);&lt;BR /&gt;category=arr1(i);&lt;BR /&gt;output;&lt;BR /&gt;%end;&lt;BR /&gt;%mend arrs;&lt;/P&gt;&lt;P&gt;data mock;&lt;BR /&gt;length param category $200;&lt;/P&gt;&lt;P&gt;array arr1(4) $200 ("Safety Analysis Set [a]" "Safety Run-in Set [b]" "Efficacy Evaluable Set (c)" "Immunogenity Analysis Set (d)");&lt;BR /&gt;array arr2(2) $200 ("Completed Study" "Discontinued Study");&lt;BR /&gt;array arr3(2) $200 ("Competed Treatment" "Terminated Treatment");&lt;BR /&gt;array arr4(6) $200 ("Death" "Lost to Follow-up" "Withdrawal by patient from study" "Termination of study by sponsor"&lt;BR /&gt;"Completed 24 months of therapy" "Other");&lt;/P&gt;&lt;P&gt;do id=1 to 6;&lt;BR /&gt;param=put(id,param.);&lt;BR /&gt;%arrs(id);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:15:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709422#M218142</guid>
      <dc:creator>kaet78ha</dc:creator>
      <dc:date>2021-01-05T14:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro loop to get particular array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709425#M218144</link>
      <description>&lt;P&gt;What is this %DIM() macro your code is trying to call?&lt;/P&gt;
&lt;P&gt;Perhaps you just meant to write:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro arrs(j);
do i=1 to dim(arr&amp;amp;j);
  category=arr&amp;amp;j(i);
  output;
end;
%mend arrs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or perhaps you wanted to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro arrs;
%local j;
%do j=1 %to 4;
param=put(&amp;amp;j,param.);
do i=1 to dim(arr&amp;amp;j);
  category=arr&amp;amp;j(i);
  output;
end;
%end;
%mend arrs;
data mock;
  length param category $200;
  array arr1(4) $200 ("Safety Analysis Set [a]" "Safety Run-in Set [b]" "Efficacy Evaluable Set (c)" "Immunogenity Analysis Set (d)");
  array arr2(2) $200 ("Completed Study" "Discontinued Study");
  array arr3(2) $200 ("Competed Treatment" "Terminated Treatment");
  array arr4(6) $200 ("Death" "Lost to Follow-up" "Withdrawal by patient from study" "Termination of study by sponsor"
"Completed 24 months of therapy" "Other");
%arrs;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 14:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709425#M218144</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-05T14:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro loop to get particular array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709440#M218157</link>
      <description>&lt;P&gt;For this problem it is probably easier to forget the arrays and the macro.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mock;
  length param category $200;
  param=put(1,param.);
  do category=
"Safety Analysis Set [a]","Safety Run-in Set [b]","Efficacy Evaluable Set (c)","Immunogenity Analysis Set (d)";
    output;
  end;
  param=put(2,param.);
  do category="Completed Study","Discontinued Study";
    output;
  end;
...&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Jan 2021 15:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-loop-to-get-particular-array/m-p/709440#M218157</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-05T15:42:31Z</dc:date>
    </item>
  </channel>
</rss>

