<?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: Displaying count in a proc export statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218465#M40231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you just want to put count of rows in the file name not split it on some variable then you may use this:&lt;/P&gt;&lt;P&gt;data source_table;&lt;/P&gt;&lt;P&gt;input Ln region :$5.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;11 west&lt;/P&gt;&lt;P&gt;12 east&lt;/P&gt;&lt;P&gt;13 north&lt;/P&gt;&lt;P&gt;15 south&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql;select count(ln) into :cnt from source_table;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;File "Serverpath\file__%TRIM(&amp;amp;cnt.).txt" lrecl=30000 dsd dlm='|' termstr=crlf ;&lt;/P&gt;&lt;P&gt;set source_table;&lt;/P&gt;&lt;P&gt;put LN region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Apr 2015 04:06:51 GMT</pubDate>
    <dc:creator>pradeepalankar</dc:creator>
    <dc:date>2015-04-10T04:06:51Z</dc:date>
    <item>
      <title>Displaying count in a proc export statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218463#M40229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;Create table test as&lt;/P&gt;&lt;P&gt;Select ln, region&lt;/P&gt;&lt;P&gt;Case when ln ne ‘’ then count(ln) else 0 end as cnt&lt;/P&gt;&lt;P&gt;Quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample output&lt;/P&gt;&lt;P&gt;Ln&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; region&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; cnt&lt;/P&gt;&lt;P&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; west&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; 4&lt;/P&gt;&lt;P&gt;12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; east&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; 4&lt;/P&gt;&lt;P&gt;13&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; north&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; 4&lt;/P&gt;&lt;P&gt;15&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; south&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; 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;File&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;"/server/file_&amp;amp;cnt..txt"&amp;nbsp;&amp;nbsp; (file__4..txt would be the exported output)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 14pt; background: white; font-family: 'Courier New';"&gt;30000&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;dsd&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;'|'&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 14pt;"&gt;termstr&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;=crlf&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 14pt;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;However I do not want to display the header cnt.&amp;nbsp; I want output like this&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;11|west| &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;12|east|&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;The reason I chose to address the cnt in the proc statement is because I am not sure if there is a way to do a macro to count the&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: purple; font-size: 14pt;"&gt;Number of recrods and then use it in the proc export statement&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 03:38:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218463#M40229</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2015-04-10T03:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying count in a proc export statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218464#M40230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have the CNT as a variable in your dataset you can use the FILEVAR option to name the file instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="10211" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 03:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218464#M40230</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-04-10T03:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying count in a proc export statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218465#M40231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if you just want to put count of rows in the file name not split it on some variable then you may use this:&lt;/P&gt;&lt;P&gt;data source_table;&lt;/P&gt;&lt;P&gt;input Ln region :$5.;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;11 west&lt;/P&gt;&lt;P&gt;12 east&lt;/P&gt;&lt;P&gt;13 north&lt;/P&gt;&lt;P&gt;15 south&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;proc sql;select count(ln) into :cnt from source_table;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;File "Serverpath\file__%TRIM(&amp;amp;cnt.).txt" lrecl=30000 dsd dlm='|' termstr=crlf ;&lt;/P&gt;&lt;P&gt;set source_table;&lt;/P&gt;&lt;P&gt;put LN region;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Apr 2015 04:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Displaying-count-in-a-proc-export-statement/m-p/218465#M40231</guid>
      <dc:creator>pradeepalankar</dc:creator>
      <dc:date>2015-04-10T04:06:51Z</dc:date>
    </item>
  </channel>
</rss>

