<?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 Arrays, Indicator, missing array in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540540#M149123</link>
    <description>&lt;P&gt;I have the following data set.&amp;nbsp; I would like to create another separate array c1_1-c1_10 and c2_1-c2_1 where they are assigned 1 from the start a{1, j} &amp;gt;0 till b{i, j}=1.&amp;nbsp; For example, a1_3 through a1_7 is equal to 1.&amp;nbsp; And, b1_5 is equal to 1.&amp;nbsp; Therefore, the array c1_1 - c1_10 would have c1_3 through c1_5 equal to 1 and rest equal to ".".&amp;nbsp; &amp;nbsp;Let me know if you need further clarification.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;input a1_1-a1_10 a2_1-a2_10 b1_1-b1_10 b2_1-b2_10;&lt;BR /&gt;datalines;&lt;BR /&gt;. . 1 1 1 1 1 . . . . . . . 1 1 1 1 1 . . . . . . 1 . . . . . . . . 1 . . . . .&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would like to the result to look something like following data set.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data c;&lt;BR /&gt;input c1_1-c1_10 c2_1-c2_10;&lt;BR /&gt;datalines;&lt;BR /&gt;. . 1 1 1 1 . . . . . . . . 1 . . . . .&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;c1_1&amp;nbsp; c1_2&amp;nbsp; c1_3 c1_4 c1_5 c1_6 c1_7 c1_8 c1_9 c1_10&amp;nbsp; &amp;nbsp;c2_1 c2_2 c2_3 c2_4 c2_5 c2_6 c2_7 c2_8 c2_9 c2_10&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;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&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; 1&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;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2019 18:48:11 GMT</pubDate>
    <dc:creator>smend</dc:creator>
    <dc:date>2019-03-05T18:48:11Z</dc:date>
    <item>
      <title>Arrays, Indicator, missing array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540540#M149123</link>
      <description>&lt;P&gt;I have the following data set.&amp;nbsp; I would like to create another separate array c1_1-c1_10 and c2_1-c2_1 where they are assigned 1 from the start a{1, j} &amp;gt;0 till b{i, j}=1.&amp;nbsp; For example, a1_3 through a1_7 is equal to 1.&amp;nbsp; And, b1_5 is equal to 1.&amp;nbsp; Therefore, the array c1_1 - c1_10 would have c1_3 through c1_5 equal to 1 and rest equal to ".".&amp;nbsp; &amp;nbsp;Let me know if you need further clarification.&amp;nbsp; Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data a;&lt;BR /&gt;input a1_1-a1_10 a2_1-a2_10 b1_1-b1_10 b2_1-b2_10;&lt;BR /&gt;datalines;&lt;BR /&gt;. . 1 1 1 1 1 . . . . . . . 1 1 1 1 1 . . . . . . 1 . . . . . . . . 1 . . . . .&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would like to the result to look something like following data set.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data c;&lt;BR /&gt;input c1_1-c1_10 c2_1-c2_10;&lt;BR /&gt;datalines;&lt;BR /&gt;. . 1 1 1 1 . . . . . . . . 1 . . . . .&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;c1_1&amp;nbsp; c1_2&amp;nbsp; c1_3 c1_4 c1_5 c1_6 c1_7 c1_8 c1_9 c1_10&amp;nbsp; &amp;nbsp;c2_1 c2_2 c2_3 c2_4 c2_5 c2_6 c2_7 c2_8 c2_9 c2_10&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;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&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; 1&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;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 18:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540540#M149123</guid>
      <dc:creator>smend</dc:creator>
      <dc:date>2019-03-05T18:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays, Indicator, missing array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540601#M149155</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255229"&gt;@smend&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have the following data set.&amp;nbsp; I would like to create another separate array c1_1-c1_10 and c2_1-c2_1 where they are assigned 1 from the start a{1, j} &amp;gt;0 till b{i, j}=1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, a1_3 through a1_7 is equal to 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And, b1_5 is equal to 1.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, the array c1_1 - c1_10 would have c1_3 through c1_5 equal to 1 and rest equal to ".".&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I am not seeing the impact role&amp;nbsp;of the B variable, and what happens with there are gaps in a1_3 through a1_7 (such as a1_5 is missing)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint: cut back on the scale so you can provide more concrete examples, such as a1_1 to a1_5&amp;nbsp; instead of a1_10 and provide a few more worked examples.&lt;/P&gt;
&lt;P&gt;Your statement:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Therefore, the array c1_1 - c1_10 would have c1_3 through c1_5 equal to 1 and rest equal to ".".&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;looks a lot like c1_1-c1_10 is a copy of a1_1 to a1_10. If not provide why not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you haven't shown any definitions for arrays that might help as to what you think an array in this instance would be. I see potential for at least 6 arrays in the solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 21:35:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540601#M149155</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-05T21:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays, Indicator, missing array</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540606#M149159</link>
      <description>&lt;P&gt;Like this?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data HAVE;
  input A1_1-A1_10 A2_1-A2_10 B1_1-B1_10 B2_1-B2_10;
datalines;
. . 1 1 1 1 1 . . . . . . . 1 1 1 1 1 . . . . . . 1 . . . . . . . . 1 . . . . .
run;

data WANT; 
  array A1_[10]; 
  array A2_[10]; 
  array B1_[10]; 
  array B2_[10]; 
  array C1_[10]; 
  array C2_[10]; 
  set HAVE;
  do I=whichn(1,of A1_[*]) to whichn(1,of B1_[*]);
    C1_[I]=1;
  end;
  do I=whichn(1,of A2_[*]) to whichn(1,of B2_[*]);
    C2_[I]=1;
  end;
run;

proc print noobs;
  var C:;
run;
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;C1_1&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_2&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_3&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_4&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_5&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_6&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_7&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_8&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_9&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C1_10&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_1&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_2&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_3&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_4&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_5&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_6&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_7&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_8&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_9&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;C2_10&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;TD class="r data"&gt;.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2019 22:09:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-Indicator-missing-array/m-p/540606#M149159</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-03-05T22:09:13Z</dc:date>
    </item>
  </channel>
</rss>

