<?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: Array help service_dates many including duplicates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30168#M7121</link>
    <description>Hi:&lt;BR /&gt;
  Have you looked into the PROC SORT with the NODUPS or NODUPKEY option??? This might be useful before you run your PROC TRANSPOSE to get rid of all the possible dates. &lt;BR /&gt;
 &lt;BR /&gt;
  This is also an instance where seeing some fake data would help. For example, is your data in this structure to start:&lt;BR /&gt;
[pre]&lt;BR /&gt;
OPTION A&lt;BR /&gt;
PT_ID        DATE&lt;BR /&gt;
 10    04/03/2009&lt;BR /&gt;
 10    04/03/2009&lt;BR /&gt;
 10    05/06/2009&lt;BR /&gt;
 10    08/18/2009&lt;BR /&gt;
 10    08/18/2009&lt;BR /&gt;
 11    01/01/2009&lt;BR /&gt;
 11    03/02/2009&lt;BR /&gt;
 11    03/02/2009&lt;BR /&gt;
 12    02/12/2009&lt;BR /&gt;
 12    02/12/2009&lt;BR /&gt;
 12    05/15/2009&lt;BR /&gt;
 12    05/15/2009&lt;BR /&gt;
[/pre]&lt;BR /&gt;
OR &lt;BR /&gt;
this structure to start:&lt;BR /&gt;
[pre]&lt;BR /&gt;
OPTION B&lt;BR /&gt;
   PT_ID          DATE1         DATE2         DATE3         DATE4         DATE5&lt;BR /&gt;
     10      04/03/2009    04/03/2009    05/06/2009    08/18/2009    08/18/2009&lt;BR /&gt;
     11      01/01/2009    03/02/2009    03/02/2009             .             .&lt;BR /&gt;
     12      02/12/2009    02/12/2009    05/15/2009    05/15/2009             .&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
               &lt;BR /&gt;
And what is your desired result given the above "fake" data???   &lt;BR /&gt;
           &lt;BR /&gt;
Also, an ARRAY in SAS is not a physical data construct (as it is in some languages). A SAS Array is just a convenient way to reference a group of variables for the purpose of treating them as a group and possibly processing the individual variables as though they were members of an array. Variables that you use when you declare an ARRAY in a SAS program can be numbered variables or they can just be differently named variables. For example, these are both valid ARRAY statements:&lt;BR /&gt;
[pre]&lt;BR /&gt;
array lovelucy fred ethel lucy ricky;&lt;BR /&gt;
array regsl regsale1 regsale2 regsale3 regsale4 regsale5 regsale6;&lt;BR /&gt;
   &lt;BR /&gt;
[/pre]&lt;BR /&gt;
     &lt;BR /&gt;
The first array, LOVELUCY, treats 4 differently named variables as though they were members of an array. The second array, REGSL treats the numbered variables, REGSALE1-REGSALE6 as though they were members of an array -- which means that the arrays could be used within a DO loop for loop processing.&lt;BR /&gt;
   &lt;BR /&gt;
cynthia</description>
    <pubDate>Wed, 02 Jun 2010 03:16:03 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-06-02T03:16:03Z</dc:date>
    <item>
      <title>Array help service_dates many including duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30167#M7120</link>
      <description>I am asking for help developing an ARRAY. This is my 1st post, I am a new SAS user. &lt;BR /&gt;
&lt;BR /&gt;
Working with a large health dataset. Used PROC TRANSPOSE to create the new dataset for ID and date from a much larger health dataset.&lt;BR /&gt;
&lt;BR /&gt;
Have one line per ID (more than 100 ID's), each ID has many dates (variables) from 1 to 1,100. Many of the dates are duplicates, meaning they received different health services on the same date. Looking to reduce the dataset to a more manageable level by consolidating the duplicate dates for each ID, resulting in fewer columns.&lt;BR /&gt;
&lt;BR /&gt;
So the var should look like date1, date2, date3...How do I create an ARRAY which eliminates the duplicate dates? Thank you</description>
      <pubDate>Wed, 02 Jun 2010 00:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30167#M7120</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-02T00:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Array help service_dates many including duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30168#M7121</link>
      <description>Hi:&lt;BR /&gt;
  Have you looked into the PROC SORT with the NODUPS or NODUPKEY option??? This might be useful before you run your PROC TRANSPOSE to get rid of all the possible dates. &lt;BR /&gt;
 &lt;BR /&gt;
  This is also an instance where seeing some fake data would help. For example, is your data in this structure to start:&lt;BR /&gt;
[pre]&lt;BR /&gt;
OPTION A&lt;BR /&gt;
PT_ID        DATE&lt;BR /&gt;
 10    04/03/2009&lt;BR /&gt;
 10    04/03/2009&lt;BR /&gt;
 10    05/06/2009&lt;BR /&gt;
 10    08/18/2009&lt;BR /&gt;
 10    08/18/2009&lt;BR /&gt;
 11    01/01/2009&lt;BR /&gt;
 11    03/02/2009&lt;BR /&gt;
 11    03/02/2009&lt;BR /&gt;
 12    02/12/2009&lt;BR /&gt;
 12    02/12/2009&lt;BR /&gt;
 12    05/15/2009&lt;BR /&gt;
 12    05/15/2009&lt;BR /&gt;
[/pre]&lt;BR /&gt;
OR &lt;BR /&gt;
this structure to start:&lt;BR /&gt;
[pre]&lt;BR /&gt;
OPTION B&lt;BR /&gt;
   PT_ID          DATE1         DATE2         DATE3         DATE4         DATE5&lt;BR /&gt;
     10      04/03/2009    04/03/2009    05/06/2009    08/18/2009    08/18/2009&lt;BR /&gt;
     11      01/01/2009    03/02/2009    03/02/2009             .             .&lt;BR /&gt;
     12      02/12/2009    02/12/2009    05/15/2009    05/15/2009             .&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
               &lt;BR /&gt;
And what is your desired result given the above "fake" data???   &lt;BR /&gt;
           &lt;BR /&gt;
Also, an ARRAY in SAS is not a physical data construct (as it is in some languages). A SAS Array is just a convenient way to reference a group of variables for the purpose of treating them as a group and possibly processing the individual variables as though they were members of an array. Variables that you use when you declare an ARRAY in a SAS program can be numbered variables or they can just be differently named variables. For example, these are both valid ARRAY statements:&lt;BR /&gt;
[pre]&lt;BR /&gt;
array lovelucy fred ethel lucy ricky;&lt;BR /&gt;
array regsl regsale1 regsale2 regsale3 regsale4 regsale5 regsale6;&lt;BR /&gt;
   &lt;BR /&gt;
[/pre]&lt;BR /&gt;
     &lt;BR /&gt;
The first array, LOVELUCY, treats 4 differently named variables as though they were members of an array. The second array, REGSL treats the numbered variables, REGSALE1-REGSALE6 as though they were members of an array -- which means that the arrays could be used within a DO loop for loop processing.&lt;BR /&gt;
   &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 02 Jun 2010 03:16:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30168#M7121</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-06-02T03:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Array help service_dates many including duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30169#M7122</link>
      <description>Hello Cynthia&lt;BR /&gt;
&lt;BR /&gt;
My dataset looks like Option B, with the number of columns for each ID's dates goes as high as Date1800, most go no higher than Date300&lt;BR /&gt;
&lt;BR /&gt;
Looking to keep each unique date per ID.</description>
      <pubDate>Wed, 02 Jun 2010 09:07:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-help-service-dates-many-including-duplicates/m-p/30169#M7122</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-02T09:07:18Z</dc:date>
    </item>
  </channel>
</rss>

