<?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: How do I make an array out of the following data set? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544045#M150426</link>
    <description>&lt;P&gt;I was wondering if you could help me figure out what I could do if there are missing values (.) in the Value column?&lt;/P&gt;</description>
    <pubDate>Mon, 18 Mar 2019 17:14:34 GMT</pubDate>
    <dc:creator>MartSas</dc:creator>
    <dc:date>2019-03-18T17:14:34Z</dc:date>
    <item>
      <title>How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544034#M150418</link>
      <description>&lt;P&gt;Dataset:&lt;/P&gt;&lt;P&gt;Obs OT Quant Value&lt;BR /&gt;1 1 1 10&lt;BR /&gt;2 1 2 10&lt;BR /&gt;3 1 3 15&lt;BR /&gt;4 1 4 20&lt;BR /&gt;5 1 5 20&lt;BR /&gt;6 1 6 25&lt;BR /&gt;7 2 1 10&lt;BR /&gt;8 2 2 15&lt;BR /&gt;9 2 3 20&lt;BR /&gt;10 2 4 25&lt;BR /&gt;11 2 5 25&lt;BR /&gt;12 2 6 30&lt;BR /&gt;13 3 1 10&lt;BR /&gt;14 3 2 15&lt;BR /&gt;15 3 3 15&lt;BR /&gt;16 3 4 20&lt;BR /&gt;17 3 5 25&lt;BR /&gt;18 3 6 25&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to have an array that describes it like: if OT=1, Quant=1 then Value=10&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544034#M150418</guid>
      <dc:creator>MartSas</dc:creator>
      <dc:date>2019-03-18T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544035#M150419</link>
      <description>&lt;P&gt;SAS Arrays only involve variables on one row or observation of a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You probably should provide a more complete description of what you are actually needing to do. Provide input and output data set examples, preferably using data step code and pasting such into a code box opened with the forum's {I} icon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may also be a good idea to explain how you actually are going to use the resulting data set/array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544035#M150419</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-18T16:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544036#M150420</link>
      <description>&lt;P&gt;So your question about an array does not seem to apply to this data set, as far as I can see.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I'm trying to have an array that describes it like: if OT=1, Quant=1 then Value=10&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In your data step, use:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if ot=1 and quant=1 then value=10;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;No array needed.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:43:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544036#M150420</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-18T16:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544038#M150421</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input obs $ OT Quant Value	 ;
cards;
1 1 1 10
2 1 2 10
3 1 3 15
4 1 4 20
5 1 5 20
6 1 6 25
7 2 1 10
8 2 2 15
9 2 3 20
10 2 4 25
11 2 5 25
12 2 6 30
13 3 1 10
14 3 2 15
15 3 3 15
16 3 4 20
17 3 5 25
18 3 6 25
;
data want;
if _n_=1 then 
do until(lr);
set have end=lr;
array  D{3,6} ;
d(OT,quant)=value;
end;&lt;BR /&gt;retain d;
/*Now do your look up*/
set have;/*read your dataset and do whatever*/
/*whatever*/
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 16:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544038#M150421</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-18T16:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544045#M150426</link>
      <description>&lt;P&gt;I was wondering if you could help me figure out what I could do if there are missing values (.) in the Value column?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 17:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544045#M150426</guid>
      <dc:creator>MartSas</dc:creator>
      <dc:date>2019-03-18T17:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544046#M150427</link>
      <description>&lt;P&gt;Sure&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/266783"&gt;@MartSas&lt;/a&gt;&amp;nbsp; &amp;nbsp;What's your requirement?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I answered basically&lt;EM&gt;&lt;STRONG&gt; how do you make an array?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want anything bigger, no matter complex or simple, just open up a new thread specifically stating your objective. Do not hesitate or feel shy. We all have been a learner/still learning.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyways, what we need is&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1. HAVE dataset sample&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2. Your WANT dataset sample&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3. An explanation of what you want to accomplish&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's all we need. If the objective is different to your subject here&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;how do you make an array?&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt; I suggest you open up a new thread and write the above 3&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 17:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544046#M150427</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-03-18T17:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make an array out of the following data set?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544214#M150493</link>
      <description>&lt;P&gt;SAS/IML is the right way to do this.&lt;/P&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;data have;
input obs $ OT Quant Value	 ;
cards;
1 1 1 10
2 1 2 10
3 1 3 15
4 1 4 20
5 1 5 20
6 1 6 25
7 2 1 10
8 2 2 15
9 2 3 20
10 2 4 25
11 2 5 25
12 2 6 30
13 3 1 10
14 3 2 15
15 3 3 15
16 3 4 20
17 3 5 25
18 3 6 25
;

proc iml;
use have;
read all var {value ot quant} into x[c=vname];
close;
z=full(x);
print z;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Mar 2019 12:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-make-an-array-out-of-the-following-data-set/m-p/544214#M150493</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-03-19T12:20:12Z</dc:date>
    </item>
  </channel>
</rss>

