<?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 Using arrays? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301397#M63774</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm attaching an example extract file. Basically all I have is procedure codes which have a certain section or not as shown by section number variables. If a section is present for that procedure code, there is a number similar to section number variable below the variable, otherwise its blank. For instance, for the first procedure code, A9279, I have section 18, 19, 20, 21 and 29 and other sections are blank. Similarly, for procedure code G0108, sections present are 3,31 and 103 and so on. &amp;nbsp;What i'm looking is following output-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;procedure_code &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section_numbers&lt;/P&gt;
&lt;P&gt;A9279 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;18&lt;/STRONG&gt;,19,&lt;STRONG&gt;20&lt;/STRONG&gt;,&lt;STRONG&gt;21,29&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;G0108 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;,&lt;STRONG&gt;31&lt;/STRONG&gt;,&lt;STRONG&gt;103&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;G0109 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;,&lt;STRONG&gt;31&lt;/STRONG&gt;,&lt;STRONG&gt;103&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;G0151 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 19, 40&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2016 20:17:52 GMT</pubDate>
    <dc:creator>devsas</dc:creator>
    <dc:date>2016-09-28T20:17:52Z</dc:date>
    <item>
      <title>Using arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301397#M63774</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I'm attaching an example extract file. Basically all I have is procedure codes which have a certain section or not as shown by section number variables. If a section is present for that procedure code, there is a number similar to section number variable below the variable, otherwise its blank. For instance, for the first procedure code, A9279, I have section 18, 19, 20, 21 and 29 and other sections are blank. Similarly, for procedure code G0108, sections present are 3,31 and 103 and so on. &amp;nbsp;What i'm looking is following output-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;procedure_code &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;section_numbers&lt;/P&gt;
&lt;P&gt;A9279 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;STRONG&gt;18&lt;/STRONG&gt;,19,&lt;STRONG&gt;20&lt;/STRONG&gt;,&lt;STRONG&gt;21,29&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;G0108 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;,&lt;STRONG&gt;31&lt;/STRONG&gt;,&lt;STRONG&gt;103&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;G0109 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;STRONG&gt;3&lt;/STRONG&gt;,&lt;STRONG&gt;31&lt;/STRONG&gt;,&lt;STRONG&gt;103&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;G0151 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 19, 40&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 20:17:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301397#M63774</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2016-09-28T20:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301398#M63775</link>
      <description>&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This link: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; has instructions on how turn a SAS data set into data step code that can be pasted into the forum or attach as a plain TXT file to allow us to test code and such.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 20:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301398#M63775</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-28T20:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301410#M63782</link>
      <description>&lt;P&gt;Ok, here is the data you can read in sas. I already mentioned the desired output as above. Thanks so much!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data WORK.have;&lt;BR /&gt; infile datalines dsd truncover;&lt;/P&gt;
&lt;P&gt;input Procedure_Code:$5. section_3:$1. section_5:$1. section_7:$1. section_12:$2. section_13:$1. section_15:$1. section_17:$2. section_18:$2. section_19:$2. section_20:$2. section_21:$2. section_22:$2. section_23:$1. section_25:$1. section_26:$2. section_2&lt;BR /&gt;8:$2. section_29:$2. section_30:$2. section_31:$2. section_32:$2. section_40:$2. section_65:$2. section_68:$1. section_85:$1. section_96:$2. section_97:$1. section_102:$1. section_103:$3.;&lt;BR /&gt;datalines4;&lt;BR /&gt;A9279,,,,,,,,18,19,20,21,,,,,,29,,,,,,,,,,,&lt;BR /&gt;G0108,3,,,,,,,,,,,,,,,,,,31,,,,,,,,,103&lt;BR /&gt;G0109,3,,,,,,,,,,,,,,,,,,31,,,,,,,,,103&lt;BR /&gt;G0151,,,,,,,,,19,,,,,,,,,,,,40,,,,,,,&lt;BR /&gt;G0152,,,,,,,,,19,,,,,,,,,,,,40,,,,,,,&lt;BR /&gt;;;;;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 21:51:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301410#M63782</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2016-09-28T21:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301413#M63785</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;want = catx(",", of section_3--section_103);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Sep 2016 21:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301413#M63785</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-28T21:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using arrays?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301424#M63792</link>
      <description>&lt;P&gt;Thanks so much! I knew of CATX function but was not sure how will it take care of blanks. But it seems your code took care of that.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 22:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-arrays/m-p/301424#M63792</guid>
      <dc:creator>devsas</dc:creator>
      <dc:date>2016-09-28T22:50:30Z</dc:date>
    </item>
  </channel>
</rss>

