<?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: Assign titles for the fields, while writing to output dataset. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/225930#M266904</link>
    <description>&lt;P&gt;Looks like you are just writng a CSV file. &amp;nbsp;You can try using PROC EXPORT. &amp;nbsp;Or you can just do it with a data step.&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Exporting-CSV-File-Using-dsd-option-and-Getting-rid-of-QUOTATION/m-p/144434/highlight/true#M13715" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Exporting-CSV-File-Using-dsd-option-and-Getting-rid-of-QUOTATION/m-p/144434/highlight/true#M13715&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Sep 2015 20:00:40 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2015-09-16T20:00:40Z</dc:date>
    <item>
      <title>Assign titles for the fields, while writing to output dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/202655#M266902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am reading few values from a input dataset, using SAS in mainframes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And while writing to the output dataset, I need to add titles/header/labels(not sure what we is the exact syntax in sas) for those fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;Input file layout:&lt;/P&gt;&lt;P&gt;LA&amp;nbsp; ,80002,1942,1040&lt;/P&gt;&lt;P&gt;LA&amp;nbsp; ,80002,1842,1940&lt;/P&gt;&lt;P&gt;LA&amp;nbsp; ,80004,1713,1510&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output file should be as follows: File should have first record as description/title/label for the upcoming records: Kinda of title for all those fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;AREA, LOC , CC ,DEPT&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LA&amp;nbsp; ,80002,1942,1040&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LA&amp;nbsp; ,80002,1842,1940&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;LA&amp;nbsp; ,80004,1713,1510&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I cant try proc print, because I am writing all records to a output dataset and not in sas log. &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Also if i use&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;proc print data=infile1 label;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;label area='AREA1'; &lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;run;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;I am getting spaces between all those Fields.&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333330154419px;"&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 17:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/202655#M266902</guid>
      <dc:creator>Santhoshcsc</dc:creator>
      <dc:date>2015-08-19T17:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Assign titles for the fields, while writing to output dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/225927#M266903</link>
      <description>&lt;P&gt;Hi, this only works if all the variables are defined as character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test1;&lt;BR /&gt; length AREA LOC CC DEPT $20;&lt;BR /&gt; input area loc cc dept;&lt;BR /&gt;datalines;&lt;BR /&gt;LA 80002 1942 1040&lt;BR /&gt;LA 80002 1842 1940&lt;BR /&gt;LA 80004 1713 1510&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents data = test1 out = cont (keep = name) ;&amp;nbsp;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;proc transpose data = cont out = vars (drop = _name_ _label_);&lt;BR /&gt; id name;&lt;BR /&gt; var name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data test2;&lt;BR /&gt; set vars test1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 19:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/225927#M266903</guid>
      <dc:creator>evp000</dc:creator>
      <dc:date>2015-09-16T19:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Assign titles for the fields, while writing to output dataset.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/225930#M266904</link>
      <description>&lt;P&gt;Looks like you are just writng a CSV file. &amp;nbsp;You can try using PROC EXPORT. &amp;nbsp;Or you can just do it with a data step.&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/Exporting-CSV-File-Using-dsd-option-and-Getting-rid-of-QUOTATION/m-p/144434/highlight/true#M13715" target="_blank"&gt;https://communities.sas.com/t5/General-SAS-Programming/Exporting-CSV-File-Using-dsd-option-and-Getting-rid-of-QUOTATION/m-p/144434/highlight/true#M13715&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 20:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Assign-titles-for-the-fields-while-writing-to-output-dataset/m-p/225930#M266904</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2015-09-16T20:00:40Z</dc:date>
    </item>
  </channel>
</rss>

