<?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: questions about array coding in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416440#M102244</link>
    <description>&lt;P&gt;Thanks so much - if I used the following code you sent and there are up to 34 comorbidities, is there a quick way to code 1-34 without listing them all?&amp;nbsp; &amp;nbsp;Would I then have to use an array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Laura&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;YOUR ORIGINAL CODE:&lt;BR /&gt;&lt;BR /&gt;data want;
set have;
n_comorbs = (comorbid1  &amp;gt; ' ') + (cormorbid2 &amp;gt; ' ') + (cormorbid3 &amp;gt; ' ');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 15:44:32 GMT</pubDate>
    <dc:creator>lmyers2</dc:creator>
    <dc:date>2017-11-27T15:44:32Z</dc:date>
    <item>
      <title>questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416231#M102183</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the full version of SAS 9.4 via a virtual desktop. I had two questions about coding an array. My data is in character format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Each row is a different case and there are 3 columns of comorbidities. Patients can have 0-3 comorbidities but one person cannot have a repeated diagnosis.&amp;nbsp; I am interested to know the overall most frequent diagnosis regardless of&amp;nbsp;whether it is in position 1, 2 or 3. Is there a special name for an array like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Second, I would like to know the average number of comorbidities per person from the above data. How do I code this such that SAS counts and assigns a number of co-morbidities to each patient?&amp;nbsp; Then I can do proc means to get the mean number.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Laura&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 01:44:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416231#M102183</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2017-11-27T01:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416241#M102186</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165633"&gt;@lmyers2&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It's a bit difficult to give an answer without you providing sample data. From what you describe I'd assume that you best transpose your data to a long structure by creating a row per diagnosis. After this it's a simple count, freq, rank etc.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 03:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416241#M102186</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-11-27T03:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416244#M102188</link>
      <description>&lt;P&gt;The second question is actually relatively easy.&amp;nbsp; If your variables are character:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;n_comorbs = (comorbid1&amp;nbsp; &amp;gt; ' ') + (cormorbid2 &amp;gt; ' ') + (cormorbid3 &amp;gt; ' ');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the first question, it's probably faster to process each variable separately, then combine the results.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have noprint;&lt;/P&gt;
&lt;P&gt;tables comorbid1 / out=tot1 (rename=(comorbid1 = diagnosis));&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;tables comorbid2 / out=tot2 (rename=(comorbid1 = diagnosis));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;tables comorbid3 / out=tot3 (rename=(comorbid1 = diagnosis));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;data want;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;set comorbid1 comorbid2 comorbid3;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;where diagnosis &amp;gt; ' ';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc means data=want sum;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;var count;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;class diagnosis;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;It's possible to do this with 2 steps instead of 3, but the processing would take longer because both steps would work with a larger data set.&amp;nbsp; If your data set is small to begin with, and you want to see alternatives, they definitely exist.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 04:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416244#M102188</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-11-27T04:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416343#M102208</link>
      <description>&lt;P&gt;Here is some sample data:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Comorbidity1 &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Comorbidity2&amp;nbsp; Comorbidity 3&lt;/P&gt;&lt;P&gt;Patient 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diabetes&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Heart failure&amp;nbsp;&amp;nbsp; Chronic renal failure&lt;/P&gt;&lt;P&gt;Patient 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chronic renal failure&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; Diabetes&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;Patient 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diabetes&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;&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;&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;&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;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the first question, what I want is a table with descending frequencies of comorbidities:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diabetes &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 (most frequent)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Chronic renal failure&amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Heart failure&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the second question, what I want is a count number for each patient:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Patient 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 comorbidities&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Patient 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 comorbidities&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Patient 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 comorbidity&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 11:51:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416343#M102208</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2017-11-27T11:51:20Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416440#M102244</link>
      <description>&lt;P&gt;Thanks so much - if I used the following code you sent and there are up to 34 comorbidities, is there a quick way to code 1-34 without listing them all?&amp;nbsp; &amp;nbsp;Would I then have to use an array?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Laura&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;YOUR ORIGINAL CODE:&lt;BR /&gt;&lt;BR /&gt;data want;
set have;
n_comorbs = (comorbid1  &amp;gt; ' ') + (cormorbid2 &amp;gt; ' ') + (cormorbid3 &amp;gt; ' ');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:44:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416440#M102244</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2017-11-27T15:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416443#M102245</link>
      <description>&lt;P&gt;Yes, for 34 an array would be appropriate.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array comorbs {34} code1-code34;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;n_comorbs=0;&lt;/P&gt;
&lt;P&gt;do _n_=1 to 34;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if comorbs{_n_} &amp;gt; ' ' then n_comorbs + 1;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416443#M102245</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-11-27T15:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416466#M102251</link>
      <description>&lt;P&gt;Thank you - that coding worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now if I want to find the most frequent comorbidity among the 34 columns,&amp;nbsp;I should probably do an array as well but have to retain the characters instead of counting between apostrophes ' '.&amp;nbsp;&amp;nbsp; I think you had suggested doing each variable individually&amp;nbsp;via proc freq but that was when there were only 3 columns.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416466#M102251</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2017-11-27T16:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416468#M102252</link>
      <description>&lt;P&gt;Yes, with 34 potential fields to examine, that would look different.&amp;nbsp; The WANT data set here has to be separate from the WANT data set for the other question, because this one contains multiple observations for each original observation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data diagnoses;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;array comorbs {34} code1-code34;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do _n_=1 to 34;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; if comorbs{_n_} &amp;gt; ' ' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; diagnosis = comorbs{_n_};&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;keep diagnosis;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=diagnoses;&lt;/P&gt;
&lt;P&gt;tables diagnosis;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider adding the ORDER=FREQ option to print the table by descending frequency count instead of alphabetically.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416468#M102252</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-11-27T16:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416917#M102394</link>
      <description>&lt;P&gt;Thank you, this works perfectly!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In response to this "keep" statement, SAS literally only keeps the new variable, so I have to reload and remerge the datasets after I do this proc. Is there a way to tell SAS to keep all of the old variables in addition to the new variable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again - I really appreciate the help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Laura&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 00:13:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416917#M102394</guid>
      <dc:creator>lmyers2</dc:creator>
      <dc:date>2017-11-29T00:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416927#M102396</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/165633"&gt;@lmyers2&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thank you, this works perfectly!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In response to this "keep" statement, SAS literally only keeps the new variable, so I have to reload and remerge the datasets after I do this proc. Is there a way to tell SAS to keep all of the old variables in addition to the new variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again - I really appreciate the help!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;Laura&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The default is to keep every variable. If you don't want to keep everything then you can list those to KEEP or those to DROP.&lt;/P&gt;
&lt;P&gt;Just remove the KEEP statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 01:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416927#M102396</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-11-29T01:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: questions about array coding</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416935#M102397</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;said, you can get rid of the KEEP statement.&amp;nbsp; That keeps all variables.&amp;nbsp; However, note that you are now outputting a separate observation for each diagnosis.&amp;nbsp; With multiple observations, you may not want to keep all those other variables ... but you do have the choice.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 01:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-about-array-coding/m-p/416935#M102397</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-11-29T01:53:58Z</dc:date>
    </item>
  </channel>
</rss>

