<?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: coding help please!!! in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156940#M12230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Tom - it ran fine...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please give little more explanation on &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;last:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Nov 2013 23:16:14 GMT</pubDate>
    <dc:creator>sas_9</dc:creator>
    <dc:date>2013-11-26T23:16:14Z</dc:date>
    <item>
      <title>coding help please!!!</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156938#M12228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi guys, i am trying to get total amount for two patient but in below code i am getting only one obs. instead of two. can someone plz help...&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test (drop=type amount);&lt;/P&gt;&lt;P&gt;infiles cards end=last;&lt;/P&gt;&lt;P&gt;retain id name;&lt;/P&gt;&lt;P&gt;input type $1. @;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if type='p' then do;&lt;/P&gt;&lt;P&gt;if _n_ &amp;gt;1 then output;&lt;/P&gt;&lt;P&gt;totalcost=0;&lt;/P&gt;&lt;P&gt;input @3 id @8 name $15.;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if type='c' then do;&lt;/P&gt;&lt;P&gt;input @12 amount comma6.;&lt;/P&gt;&lt;P&gt;totalcost+amount;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;if last then output;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cards,&lt;/P&gt;&lt;P&gt;p 1095 smith, howard&lt;/P&gt;&lt;P&gt;c 01-08-98 $45.0&lt;/P&gt;&lt;P&gt;c 01-17-98 $37.0&lt;/P&gt;&lt;P&gt;p 1096 barclay, nick&lt;/P&gt;&lt;P&gt;c 01-09-98 $156.5&lt;/P&gt;&lt;P&gt;c 01-17-98 $20.0&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*i think it's OUTPUT statement issue, i tried to put 'output' statement different places but didn't get correct result*/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 22:22:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156938#M12228</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-11-26T22:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: coding help please!!!</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156939#M12229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot use the END= option when using in line data.&amp;nbsp; Try re-coding to use the EOF= option instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data test (drop=type amount);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; infile cards eof=last;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; retain id name;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; input type $1. @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if type='p' then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if _n_ &amp;gt;1 then output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; totalcost=0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @3 id @8 name $15.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if type='c' then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; input @12 amount comma6.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; totalcost+amount;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;return;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;last: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;cards;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;p 1095 smith, howard&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;c 01-08-98 $45.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;c 01-17-98 $37.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;p 1096 barclay, nick&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;c 01-09-98 $156.5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;c 01-17-98 $20.0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt; line-height: 1.5em;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 23:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156939#M12229</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-11-26T23:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: coding help please!!!</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156940#M12230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Tom - it ran fine...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please give little more explanation on &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;return;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;last:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 23:16:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156940#M12230</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-11-26T23:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: coding help please!!!</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156941#M12231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like Tom mentioned, you can't use eof in an infile statement when you are using cards or datalines.&amp;nbsp; Instead, you can use eof=label.&amp;nbsp; What Tom's code did was create a label called 'last'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As such, when the code hit the return statement, it skipped the label (and its code) and returned to the start of the code.&amp;nbsp; When it got to the last record, it jumped down to the last label, output the record, then exited.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 23:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156941#M12231</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-11-26T23:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: coding help please!!!</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156942#M12232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 00:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/coding-help-please/m-p/156942#M12232</guid>
      <dc:creator>sas_9</dc:creator>
      <dc:date>2013-11-27T00:00:53Z</dc:date>
    </item>
  </channel>
</rss>

