<?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: Arrays for two variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750811#M236229</link>
    <description>i want to get thru arrays so I am trying</description>
    <pubDate>Mon, 28 Jun 2021 13:46:38 GMT</pubDate>
    <dc:creator>BrahmanandaRao</dc:creator>
    <dc:date>2021-06-28T13:46:38Z</dc:date>
    <item>
      <title>Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750802#M236222</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
set sashelp.class;
array new1(*) $ Name ;
array new2(*) $ Sex;
do i =1 to dim(new1);
if new1= i then uppcase(new1(i));
if new2=i then lowcase(new2(i));
end;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here i want get Name in caps and sex in small case&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 13:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750802#M236222</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-06-28T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750806#M236225</link>
      <description>&lt;P&gt;Why do you think you need an array?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
  set sashelp.class;
  name=upcase(name);
  sex=lowcase(sex);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jun 2021 13:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750806#M236225</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-28T13:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750811#M236229</link>
      <description>i want to get thru arrays so I am trying</description>
      <pubDate>Mon, 28 Jun 2021 13:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750811#M236229</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2021-06-28T13:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750814#M236231</link>
      <description>&lt;P&gt;Here is an array based method to do the same, so you can see how to define and use an array.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
  set sashelp.class;
  array x name sex;
  do index=1 to 2;
    if index=1 then x[index]=upcase(x[index]);
    else if index=2 then x[index]=lowcase(x[index]);
  end;
  drop index;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(Note that in this case it is silly to use an array, but if your real case had dozens or hundreds of variables you wanted to process an array would make sense)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 13:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750814#M236231</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-28T13:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750815#M236232</link>
      <description>&lt;P&gt;Good idea to write test programs and inspect the results.&amp;nbsp; Here's a variation on your program that might speed up the learning process:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
set sashelp.class;
array new (*) $ Name sex;
do i =1 to dim(new);
   put 'Before:  ' _all_;
   new{i} = upcase(new{i});
   put 'Middle:  ' _all_;
   new{i} = lowcase(new{i});
   put 'After:  ' _all_;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Jun 2021 13:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750815#M236232</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-06-28T13:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750844#M236243</link>
      <description>This is the wrong use for an array and that's what you need to learn from this question. &lt;BR /&gt;Arrays in SAS are used as variable shortcut references and you typically operate on the same row. So if you want to do something to 30 different variables in the same observations then use an array. If you want to do something to every value in a column then you WOULD NOT use an array in that case. &lt;BR /&gt;&lt;BR /&gt;There are cases where you would use an array to work on values between rows but given your questions this is beyond anything you're doing at this point.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:25:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750844#M236243</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-28T15:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750847#M236245</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i want to get thru arrays so I am trying&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One thing to learn about ARRAYs is when to use ARRAYs and when to not use ARRAYs. This is a case where you should not be using ARRAYs, and that's the lesson you need to learn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You use ARRAYs when there are many columns and you want to execute the same code on each column. Here are several examples of actually using ARRAYs, please take a look.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lestmtsref/n00gp8yc3x6rcgn1la2w81ru9lb6.htm#n0esdajl6h4fbdn16oy22o98x8jz" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmmvacdc/9.4/lestmtsref/n00gp8yc3x6rcgn1la2w81ru9lb6.htm#n0esdajl6h4fbdn16oy22o98x8jz&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:41:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750847#M236245</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-06-28T15:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arrays for two variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750850#M236248</link>
      <description>&lt;P&gt;Here's a tutorial on using Arrays in SAS&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-arrays/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-arrays/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Arrays-for-two-variables/m-p/750850#M236248</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-28T15:58:58Z</dc:date>
    </item>
  </channel>
</rss>

