<?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: Using Arrays in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743363#M232726</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I have the arrays and the specific example of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/24470"&gt;@nrk1787db1&lt;/a&gt;&amp;nbsp;in mind.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 24 May 2021 13:07:15 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-05-24T13:07:15Z</dc:date>
    <item>
      <title>Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743212#M232631</link>
      <description>I want to use two array variables . Example studname, percentage. I want to repeat the loop for 40 students and create the dataset. Pls help.</description>
      <pubDate>Sun, 23 May 2021 12:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743212#M232631</guid>
      <dc:creator>sas_it</dc:creator>
      <dc:date>2021-05-23T12:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743215#M232634</link>
      <description>&lt;PRE&gt;Data A ;
ARRAY studname {40} $ studname1-studname40 ;
ARRAY percentage {40} perc1-perc40 ;
 do i=1 to 40 ;
   StudName[i]= 'A' || put(i,2.) ;
   percentage[i]=1 + i*2 ;
 end ;
run ;

Proc print ;
&lt;/PRE&gt;
&lt;P&gt;See if this helps&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 13:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743215#M232634</guid>
      <dc:creator>nrk1787db1</dc:creator>
      <dc:date>2021-05-23T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743233#M232647</link>
      <description>Thank you. Can you pls explain the program also.</description>
      <pubDate>Sun, 23 May 2021 15:13:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743233#M232647</guid>
      <dc:creator>sas_it</dc:creator>
      <dc:date>2021-05-23T15:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743265#M232669</link>
      <description>&lt;P&gt;Can you clarify what you want?&lt;/P&gt;
&lt;P&gt;If you just want to make a dataset with 40 students you don't normally need to use any arrays.&lt;/P&gt;</description>
      <pubDate>Sun, 23 May 2021 22:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743265#M232669</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-23T22:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743301#M232690</link>
      <description>I want to create dataset for 100 students and upLoad on VA for dashboard.</description>
      <pubDate>Mon, 24 May 2021 04:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743301#M232690</guid>
      <dc:creator>sas_it</dc:creator>
      <dc:date>2021-05-24T04:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743359#M232724</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/24470"&gt;@nrk1787db1&lt;/a&gt;&amp;nbsp;for the wonderful solution.&lt;BR /&gt;I see&amp;nbsp; that all the array elements (both for student and percentage) come in a single row.&lt;BR /&gt;Can we not have one row for each students.&lt;BR /&gt;Thus the dataset will have two columns and 40&amp;nbsp; rows instead of one row and 80 columns.&lt;BR /&gt;Thanks once again&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 12:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743359#M232724</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-24T12:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743361#M232725</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/361272"&gt;@sas_it&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I want to create dataset for 100 students and upLoad on VA for dashboard.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Normally to create a dataset you just read in the data from some source.&amp;nbsp; Such as lines of text included in the program.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data students;
  input id age score ;
cards;
1 12 100
2 13 85
3 14 78
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to make up example data you can use a DO loop with an OUTPUT statement to write multiple observations.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data students;
  do id=1 to 100;
     output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Again arrays really do not come into play here.&amp;nbsp; Arrays are for when you have multiple variables that contain similar data and you want to loop over them (or index into them).&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 12:52:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743361#M232725</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-24T12:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743363#M232726</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I have the arrays and the specific example of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/24470"&gt;@nrk1787db1&lt;/a&gt;&amp;nbsp;in mind.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 13:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743363#M232726</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-24T13:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743366#M232727</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131732"&gt;@Sajid01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I have the arrays and the specific example of&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/24470"&gt;@nrk1787db1&lt;/a&gt;&amp;nbsp;in mind.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Again no arrays needed.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data students;
  length name $8 percent 8;
  do i=1 to 40;
    name = cats('A',put(i,z2.));
    percent=1 + 2*i ;
    output;
  end;
  drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 210px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59707iFE2647BAC27B6525/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 May 2021 13:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743366#M232727</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-05-24T13:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743379#M232731</link>
      <description>Thank you.</description>
      <pubDate>Mon, 24 May 2021 14:27:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-Arrays/m-p/743379#M232731</guid>
      <dc:creator>sas_it</dc:creator>
      <dc:date>2021-05-24T14:27:39Z</dc:date>
    </item>
  </channel>
</rss>

