<?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: File Writer Transformation using labels as headers in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590574#M18065</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78676"&gt;@Alkibiades&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"&lt;EM&gt;I try to eport csv files in a DI Studio job using the file writer transformation.&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What you describe and show us doesn't add up.&amp;nbsp;&lt;/SPAN&gt;The screenshot you're showing us is from the File Reader. This transformation is used to read an external file (i.e. a .csv) into SAS. The File Writer is used to write a table to an external file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please clarify what exactly you're trying to achieve?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is about writing a SAS table to an external file (a .csv) and you want to use the SAS variable labels and not the SAS column names as column headers in the .csv then you will have to use custom code (user written node or reusable as a custom transformation) and using macro&amp;nbsp;%ds2csv sounds like a good option to do so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should this really be about reading an external file into a SAS table using the File Reader transformation:&lt;/P&gt;
&lt;P&gt;There is no LABEL option for the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;INFILE&lt;/A&gt;&amp;nbsp;statement. Using DIS the column names and attributes created are based on your table metadata definition. That's what DIS will be using to generate the SAS code. If you want different column names then just change them in the table metadata definition.&lt;/P&gt;</description>
    <pubDate>Sun, 22 Sep 2019 20:40:40 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2019-09-22T20:40:40Z</dc:date>
    <item>
      <title>File Writer Transformation using labels as headers</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590409#M18062</link>
      <description>&lt;P&gt;I try to eport csv files in a DI Studio job using the file writer transformation. So far, so good. But when I try to have labels as a header instead of the variable names via entering label as a infile statement of the meta data object of the file, he still uses variables instead of labels as headers.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="label.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/32640i64D6EA4994E276AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="label.jpg" alt="label.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Am I missing an option to get labels instead of variable names?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 14:00:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590409#M18062</guid>
      <dc:creator>Alkibiades</dc:creator>
      <dc:date>2019-09-20T14:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: File Writer Transformation using labels as headers</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590463#M18063</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt; wrote some years ago&lt;BR /&gt;Hi:&lt;BR /&gt;If the SAS Utility macros are available to your DI Studio servers, then this macro %DS2CSV allows you to place labels in row 1 of the output file. For example:&lt;BR /&gt;[pre]&lt;BR /&gt;%ds2csv (data=sashelp.retail, runmode=b, csvfile=c:\temp\retail.csv,&lt;BR /&gt;labels=y, formats=y);&lt;BR /&gt;[/pre]&lt;BR /&gt;&lt;BR /&gt;Documentation here:&lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a002683390.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a002683390.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Fri, 20 Sep 2019 16:32:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590463#M18063</guid>
      <dc:creator>JosvanderVelden</dc:creator>
      <dc:date>2019-09-20T16:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: File Writer Transformation using labels as headers</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590574#M18065</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78676"&gt;@Alkibiades&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"&lt;EM&gt;I try to eport csv files in a DI Studio job using the file writer transformation.&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;What you describe and show us doesn't add up.&amp;nbsp;&lt;/SPAN&gt;The screenshot you're showing us is from the File Reader. This transformation is used to read an external file (i.e. a .csv) into SAS. The File Writer is used to write a table to an external file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please clarify what exactly you're trying to achieve?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is about writing a SAS table to an external file (a .csv) and you want to use the SAS variable labels and not the SAS column names as column headers in the .csv then you will have to use custom code (user written node or reusable as a custom transformation) and using macro&amp;nbsp;%ds2csv sounds like a good option to do so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should this really be about reading an external file into a SAS table using the File Reader transformation:&lt;/P&gt;
&lt;P&gt;There is no LABEL option for the&amp;nbsp;&lt;A href="https://documentation.sas.com/?docsetId=lestmtsref&amp;amp;docsetTarget=n1rill4udj0tfun1fvce3j401plo.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;INFILE&lt;/A&gt;&amp;nbsp;statement. Using DIS the column names and attributes created are based on your table metadata definition. That's what DIS will be using to generate the SAS code. If you want different column names then just change them in the table metadata definition.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 20:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590574#M18065</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-22T20:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: File Writer Transformation using labels as headers</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590834#M18070</link>
      <description>&lt;P&gt;The screenshot is actually the metadata object of the csv file, not the File Reader. The File Writer does not offer any real Option I could identify using labels.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 04:44:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590834#M18070</guid>
      <dc:creator>Alkibiades</dc:creator>
      <dc:date>2019-09-23T04:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: File Writer Transformation using labels as headers</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590836#M18071</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/78676"&gt;@Alkibiades&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The screenshot is actually the metadata object of the csv file, not the File Reader.&lt;/P&gt;
&lt;P&gt;The File Writer does not offer any real Option I could identify using labels.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;True. And yes, the file writer doesn't provide such an option so you will have to do your own thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 05:38:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/File-Writer-Transformation-using-labels-as-headers/m-p/590836#M18071</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-23T05:38:04Z</dc:date>
    </item>
  </channel>
</rss>

