<?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: Outputing the Headings for each column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25466#M4453</link>
    <description>Hi:&lt;BR /&gt;
  Not sure what you mean. Are you using PROC PRINT, PROC REPORT, DATA _NULL_? Are you sending output to the LISTING destination (in a mainframe job, this would be the equivalent of the SYSOUT DD location)? How are you "writing out the data"?&lt;BR /&gt;
 &lt;BR /&gt;
  Can you post an example of your code?? Refer to this posting for more information about how to post code and maintain the indentation of the code.&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Thu, 03 Dec 2009 23:15:13 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2009-12-03T23:15:13Z</dc:date>
    <item>
      <title>Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25465#M4452</link>
      <description>Hi All&lt;BR /&gt;
&lt;BR /&gt;
How do we output a heading for each column in the data - I am using MVS on the mainframe with SAS - I can write out the data, but need to be heading labels for each of the columns.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
Shelton.</description>
      <pubDate>Thu, 03 Dec 2009 22:59:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25465#M4452</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-03T22:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25466#M4453</link>
      <description>Hi:&lt;BR /&gt;
  Not sure what you mean. Are you using PROC PRINT, PROC REPORT, DATA _NULL_? Are you sending output to the LISTING destination (in a mainframe job, this would be the equivalent of the SYSOUT DD location)? How are you "writing out the data"?&lt;BR /&gt;
 &lt;BR /&gt;
  Can you post an example of your code?? Refer to this posting for more information about how to post code and maintain the indentation of the code.&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 03 Dec 2009 23:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25466#M4453</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2009-12-03T23:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25467#M4454</link>
      <description>Basically what I want to do is output the data to a dataset but also have the field labels appear at the top of the output - like&lt;BR /&gt;
&lt;BR /&gt;
PartNo       Description       Price&lt;BR /&gt;
XXXX         somepartx       $110.00&lt;BR /&gt;
YYY         someparty       $55.00&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
etc etc &lt;BR /&gt;
This is what my code looks like now:&lt;BR /&gt;
&lt;BR /&gt;
[pre]DATA PUTOUT;                                             &lt;BR /&gt;
SET STOCK;                                               &lt;BR /&gt;
FILE OUTF1; &lt;BR /&gt;
   PUT @1    PART     $12.                               &lt;BR /&gt;
       @13   DESC        $10.                                &lt;BR /&gt;
       @40   PRICE       8.2;                              &lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 04 Dec 2009 03:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25467#M4454</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-04T03:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25468#M4455</link>
      <description>Given your coded approach, you will need to add a single-line PUT statement to generate a HEADER row.  Your DATA step code needs to test for IF _N_=1 and issue a PUT with a text-character row surrounded with double-quotes and commas, most likely.  Here's an example:&lt;BR /&gt;
&lt;BR /&gt;
IF _N_=1 THEN PUT '"VAR1","VAR2","VAR3"';&lt;BR /&gt;
&lt;BR /&gt;
Of course you may also want to consider the "ODS CSV" approach and use PROC PRINT.&lt;BR /&gt;
&lt;BR /&gt;
Suggest you search the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for ODS CSV examples if that's your alternate approach.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 04 Dec 2009 03:55:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25468#M4455</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-12-04T03:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25469#M4456</link>
      <description>Hi Scott&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the reply -  it worked!  I didnt want to use ODS as I have used that previously to create a HTML output file.  I thought there was an easier way to do this.&lt;BR /&gt;
&lt;BR /&gt;
This is my code:&lt;BR /&gt;
&lt;BR /&gt;
DATA PUTOUT;                    &lt;BR /&gt;
SET STOCK;                      &lt;BR /&gt;
FILE OUTF1;                     &lt;BR /&gt;
IF _N_=1 THEN PUT               &lt;BR /&gt;
       @01   "PARTNO"           &lt;BR /&gt;
       @13   "MONTHIND"         &lt;BR /&gt;
       @40   "YEARIND"          &lt;BR /&gt;
       ;                        &lt;BR /&gt;
   PUT @1    PART     $12.      &lt;BR /&gt;
       @13   MONTHIND $1.       &lt;BR /&gt;
       @40   YEARIND  $1.;      &lt;BR /&gt;
&lt;BR /&gt;
Thanks again.&lt;BR /&gt;
Shelton.</description>
      <pubDate>Mon, 07 Dec 2009 05:49:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25469#M4456</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-12-07T05:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Outputing the Headings for each column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25470#M4457</link>
      <description>There are ways to print the names without knowing the names.  Another method might use CALL VNEXT.  &lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
396  data _null_;&lt;BR /&gt;
397     file log dsd;&lt;BR /&gt;
398     if _n_ eq 1 then do;&lt;BR /&gt;
399        if 0 then set sashelp.shoes;&lt;BR /&gt;
400        put (_all_) (=) @;&lt;BR /&gt;
401        _file_ = compress(tranwrd(_file_,'=',','),' .');&lt;BR /&gt;
402        _file_ = substr(_file_,1,length(_file_)-1);&lt;BR /&gt;
403        put;&lt;BR /&gt;
404        end;&lt;BR /&gt;
405     set sashelp.shoes(obs=30);&lt;BR /&gt;
406     put (_all_)(:);&lt;BR /&gt;
407     run;&lt;BR /&gt;
&lt;BR /&gt;
Region,Product,Subsidiary,Stores,Sales,Inventory,Returns&lt;BR /&gt;
Africa,Boot,Addis Ababa,12,"$29,761","$191,821",$769&lt;BR /&gt;
Africa,Men's Casual,Addis Ababa,4,"$67,242","$118,036","$2,284"&lt;BR /&gt;
Africa,Men's Dress,Addis Ababa,7,"$76,793","$136,273","$2,433"&lt;BR /&gt;
Africa,Sandal,Addis Ababa,10,"$62,819","$204,284","$1,861"&lt;BR /&gt;
Africa,Slipper,Addis Ababa,14,"$68,641","$279,795","$1,771"&lt;BR /&gt;
Africa,Sport Shoe,Addis Ababa,4,"$1,690","$16,634",$79&lt;BR /&gt;
Africa,Women's Casual,Addis Ababa,2,"$51,541","$98,641",$940&lt;BR /&gt;
Africa,Women's Dress,Addis Ababa,12,"$108,942","$311,017","$3,233"&lt;BR /&gt;
Africa,Boot,Algiers,21,"$21,297","$73,737",$710&lt;BR /&gt;
Africa,Men's Casual,Algiers,4,"$63,206","$100,982","$2,221"&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 07 Dec 2009 12:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Outputing-the-Headings-for-each-column/m-p/25470#M4457</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-12-07T12:07:27Z</dc:date>
    </item>
  </channel>
</rss>

