<?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 Array question in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Array-question/m-p/74427#M16033</link>
    <description>Hi I have data set like this&lt;BR /&gt;
&lt;BR /&gt;
data var;&lt;BR /&gt;
   input Variables:$20.;&lt;BR /&gt;
   cards;&lt;BR /&gt;
aa&lt;BR /&gt;
bb&lt;BR /&gt;
cc&lt;BR /&gt;
dd&lt;BR /&gt;
ee&lt;BR /&gt;
ff&lt;BR /&gt;
;;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
and would like to convert to something like this&lt;BR /&gt;
&lt;BR /&gt;
LIST1       LIST2       LIST3       LIST4        LIST5       LIST6&lt;BR /&gt;
aa,bb       bb,aa              &lt;BR /&gt;
aa,bb,cc  aa,cc,bb   bb,aa,cc   bb,cc,aa    cc,aa,bb   cc,bb,aa&lt;BR /&gt;
then 4&lt;BR /&gt;
then 5&lt;BR /&gt;
and so on&lt;BR /&gt;
..&lt;BR /&gt;
..&lt;BR /&gt;
..&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Then use these list in an array to shorten the code below&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
set test;&lt;BR /&gt;
if new_var in ("aa bb","bb aa")   then number='01';&lt;BR /&gt;
if new_var in ("aa bb cc","aa cc bb","bb aa cc","bb cc aa","cc aa bb","cc bb aa")   then number='02';&lt;BR /&gt;
and so on.&lt;BR /&gt;
&lt;BR /&gt;
Thank you

Message was edited by: coi</description>
    <pubDate>Tue, 06 Oct 2009 05:19:00 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-10-06T05:19:00Z</dc:date>
    <item>
      <title>Array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-question/m-p/74427#M16033</link>
      <description>Hi I have data set like this&lt;BR /&gt;
&lt;BR /&gt;
data var;&lt;BR /&gt;
   input Variables:$20.;&lt;BR /&gt;
   cards;&lt;BR /&gt;
aa&lt;BR /&gt;
bb&lt;BR /&gt;
cc&lt;BR /&gt;
dd&lt;BR /&gt;
ee&lt;BR /&gt;
ff&lt;BR /&gt;
;;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
and would like to convert to something like this&lt;BR /&gt;
&lt;BR /&gt;
LIST1       LIST2       LIST3       LIST4        LIST5       LIST6&lt;BR /&gt;
aa,bb       bb,aa              &lt;BR /&gt;
aa,bb,cc  aa,cc,bb   bb,aa,cc   bb,cc,aa    cc,aa,bb   cc,bb,aa&lt;BR /&gt;
then 4&lt;BR /&gt;
then 5&lt;BR /&gt;
and so on&lt;BR /&gt;
..&lt;BR /&gt;
..&lt;BR /&gt;
..&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Then use these list in an array to shorten the code below&lt;BR /&gt;
&lt;BR /&gt;
data test;&lt;BR /&gt;
set test;&lt;BR /&gt;
if new_var in ("aa bb","bb aa")   then number='01';&lt;BR /&gt;
if new_var in ("aa bb cc","aa cc bb","bb aa cc","bb cc aa","cc aa bb","cc bb aa")   then number='02';&lt;BR /&gt;
and so on.&lt;BR /&gt;
&lt;BR /&gt;
Thank you

Message was edited by: coi</description>
      <pubDate>Tue, 06 Oct 2009 05:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-question/m-p/74427#M16033</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-10-06T05:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Array question</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Array-question/m-p/74428#M16034</link>
      <description>Explore using SAS PROC TRANSPOSE to take your vertical observations and create a horizontal perspective.&lt;BR /&gt;
&lt;BR /&gt;
Though I'm not totally clear about the origin of new_var, you can use an ARRAY declaration and reference a variable prefix, such as LIST:  -- possibly to build a new CHARACTER type variable with a string-concatenation of your LIST1-LISTn variables, possibly, to use in your IF/THEN logic.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 06 Oct 2009 06:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Array-question/m-p/74428#M16034</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-10-06T06:13:37Z</dc:date>
    </item>
  </channel>
</rss>

