<?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 Program in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576935#M13129</link>
    <description>&lt;P&gt;Important question:&lt;/P&gt;
&lt;P&gt;Do you need a data set result, further computer manipulation, or a report that people will read?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2019 15:19:52 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-07-26T15:19:52Z</dc:date>
    <item>
      <title>SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576836#M13109</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the input&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&amp;nbsp; qty&amp;nbsp; &amp;nbsp; Amount&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;241.98&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50&amp;nbsp; &amp;nbsp; &amp;nbsp;5.64000&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; 83&amp;nbsp; &amp;nbsp; &amp;nbsp;5.43000&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; 5.38000&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; 150&amp;nbsp; &amp;nbsp; 5.30000&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a output like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; count&amp;nbsp; qty&amp;nbsp; &amp;nbsp; Amount&amp;nbsp; &amp;nbsp; qty&amp;nbsp; &amp;nbsp; Amount&amp;nbsp; &amp;nbsp; &amp;nbsp; qty&amp;nbsp; Amount&amp;nbsp; &amp;nbsp; &amp;nbsp; qty&amp;nbsp; &amp;nbsp; Amount&amp;nbsp; &amp;nbsp; &amp;nbsp; qty&amp;nbsp; Amount&lt;BR /&gt;1P6743&amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;241.98&amp;nbsp; &amp;nbsp; 50&amp;nbsp; &amp;nbsp; &amp;nbsp;5.64000&amp;nbsp; &amp;nbsp; 83&amp;nbsp; &amp;nbsp; &amp;nbsp;5.43000&amp;nbsp;&amp;nbsp;100&amp;nbsp; &amp;nbsp; 5.38000&amp;nbsp;&amp;nbsp;150&amp;nbsp; &amp;nbsp; 5.30000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How we can get above result ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 08:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576836#M13109</guid>
      <dc:creator>jaiganesh</dc:creator>
      <dc:date>2019-07-26T08:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576842#M13112</link>
      <description>&lt;P&gt;Try next code, assuming data is sorted by id count:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let maxocc = 10; /* adapt to max number of occurrences */
data want;
 set have;
  by id count;
      retain qt1-qt&amp;amp;maxocc  amt1-amt&amp;amp;maxocc  i;  
      drop i;
      if first.count then do;  
         call missing(qt1-qt&amp;amp;maxocc,  amt1-amt&amp;amp;maxocc);
         i=0;
     end;
     array qx qt1-qt&amp;amp;maxocc;
     array ax amt1-amt&amp;amp;maxocc;
     
     i+1;
     qx(i) = qty;
     ax(i) = amount;
     
    if last.count then output;
run;     &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You my try also proc transpose; Check SAS Documentation on PROC TRANSPOSE.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 09:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576842#M13112</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-07-26T09:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576846#M13113</link>
      <description>&lt;P&gt;Getting Below Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;call missing(qt1-qt&amp;amp;maxocc, amt1-amt&amp;amp;maxocc);&lt;BR /&gt;_______&lt;BR /&gt;134&lt;BR /&gt;WARNING 134-185: Argument #1 is an expression, which cannot be updated by the MISSING subroutine call.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;call missing(qt1-qt&amp;amp;maxocc, amt1-amt&amp;amp;maxocc);&lt;BR /&gt;_______&lt;BR /&gt;134&lt;BR /&gt;WARNING 134-185: Argument #2 is an expression, which cannot be updated by the MISSING subroutine c&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 09:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576846#M13113</guid>
      <dc:creator>jaiganesh</dc:creator>
      <dc:date>2019-07-26T09:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576853#M13114</link>
      <description>&lt;P&gt;ALWAYS (and I do mean&amp;nbsp;&lt;STRONG&gt;ALWAYS&lt;/STRONG&gt;) use the {i} button for posting logs, as this will preserve the positions of ERROR pointers and other valuable log formatting.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 10:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576853#M13114</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-26T10:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576857#M13115</link>
      <description>&lt;P&gt;I have no that error on SAS 9.4 (SAS UE), anyhow here is a tested code that may run on your SAS version:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines;
   input id $ count qty Amount best.;
datalines;
1P6743   9   1    241.98
1P6743   9   50    5.64000
1P6743   9   83    5.43000
1P6743   9  100    5.38000
1P6743   9  150    5.30000
; run;

%let maxocc = 10; /* adapt to max number of occurrences */
data want;
 set have;
  by id count;
      retain qt1-qt&amp;amp;maxocc  amt1-amt&amp;amp;maxocc  i; 
      array qx qt1-qt&amp;amp;maxocc;
      array ax amt1-amt&amp;amp;maxocc;

      drop i;
      if first.count then do; 
         do i=1 to &amp;amp;maxocc; qx(i)=.; ax(i)=.; end; 
         *call missing(qt1-qt&amp;amp;maxocc,  amt1-amt&amp;amp;maxocc); /* alternate code work on SAS 9.4 */
         i=0;
     end;
     
     i+1;
     qx(i) = qty;
     ax(i) = amount;
     
    if last.count then output;
run;     &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 10:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576857#M13115</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2019-07-26T10:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576873#M13117</link>
      <description>&lt;P&gt;If you don't have a big table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   infile datalines;
   input id $ count qty Amount best.;
datalines;
1P6743   9   1    241.98
1P6743   9   50    5.64000
1P6743   9   83    5.43000
1P6743   9  100    5.38000
1P6743   9  150    5.30000
; run;
proc sql noprint;
select max(n) into : n
 from (select count(*) as n from have group by id,count);
quit;
proc summary data=have;
by id count;
output out=want idgroup(out[&amp;amp;n] (qty amount)=);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 11:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576873#M13117</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-07-26T11:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576902#M13122</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240933"&gt;@jaiganesh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Getting Below Error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;call missing(qt1-qt&amp;amp;maxocc, amt1-amt&amp;amp;maxocc);&lt;BR /&gt;_______&lt;BR /&gt;134&lt;BR /&gt;WARNING 134-185: Argument #1 is an expression, which cannot be updated by the MISSING subroutine call.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/240933"&gt;@jaiganesh&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a rule, you need to use the OF keyword when applying functions or CALL routines to variable lists:&lt;/P&gt;
&lt;PRE&gt;call missing(&lt;STRONG&gt;&lt;FONT size="4" color="#008000"&gt;of&lt;/FONT&gt;&lt;/STRONG&gt; qt1-qt&amp;amp;maxocc, &lt;STRONG&gt;&lt;FONT size="4" color="#008000"&gt;of&lt;/FONT&gt;&lt;/STRONG&gt; amt1-amt&amp;amp;maxocc);&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:50:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576902#M13122</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-07-26T13:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Program</title>
      <link>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576935#M13129</link>
      <description>&lt;P&gt;Important question:&lt;/P&gt;
&lt;P&gt;Do you need a data set result, further computer manipulation, or a report that people will read?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/SAS-Program/m-p/576935#M13129</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-07-26T15:19:52Z</dc:date>
    </item>
  </channel>
</rss>

