<?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: SAS Arrays in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772173#M245158</link>
    <description>&lt;P&gt;Please show an example of your starting data and what you expect the result after this is applied.&lt;/P&gt;
&lt;P&gt;It sounds very odd that you want the exact same values for every record in a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that arrays do not exist after the end of data step code. Array is only a technique for manipulating something while the data step runs. After the data step the only result is variables and their values. So you really do not have much of an array elsewhere.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 14:31:53 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-10-05T14:31:53Z</dc:date>
    <item>
      <title>SAS Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772154#M245150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement where I am trying to place all the &lt;U&gt;column names&lt;/U&gt; of a dateset into an &lt;U&gt;array using sas coding&lt;/U&gt;. Is there any possibility to that. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 13:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772154#M245150</guid>
      <dc:creator>Twinklex</dc:creator>
      <dc:date>2021-10-05T13:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772158#M245153</link>
      <description>&lt;P&gt;Are all your variables of the same type? If so, you can use the _all_. If not, you have to define them separately by their variable type. You can then use _numeric_ and _character_.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this: &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p08do6szetrxe2n136ush727sbuo.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/p08do6szetrxe2n136ush727sbuo.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specifically, look at the "array elements" section. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 13:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772158#M245153</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-10-05T13:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772168#M245157</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/387149"&gt;@Twinklex&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to create an array of character variables, say &lt;FONT face="courier new,courier"&gt;var1&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;var2&lt;/FONT&gt;, ..., containing the &lt;EM&gt;column names&lt;/EM&gt; (i.e. variable names) of the original dataset (e.g., SASHELP.CLASS), then try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select quote(trim(name)) into: varlist separated by ' '
from dictionary.columns
where libname='SASHELP' &amp;amp; memname='CLASS';
quit;

data want;
array var[&amp;amp;sqlobs] $32 (&amp;amp;varlist);
/* ... code using the array ... */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=sashelp.class(obs=0) out=_trans;
var _all_;
run;

proc transpose data=_trans out=_temp(drop=_:) prefix=var;
var _name_;
run;

data want;
set _temp;
array var[*] var:;
/* ... code using the array ... */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Oct 2021 14:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772168#M245157</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2021-10-05T14:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Arrays</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772173#M245158</link>
      <description>&lt;P&gt;Please show an example of your starting data and what you expect the result after this is applied.&lt;/P&gt;
&lt;P&gt;It sounds very odd that you want the exact same values for every record in a data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that arrays do not exist after the end of data step code. Array is only a technique for manipulating something while the data step runs. After the data step the only result is variables and their values. So you really do not have much of an array elsewhere.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 14:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Arrays/m-p/772173#M245158</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-10-05T14:31:53Z</dc:date>
    </item>
  </channel>
</rss>

