<?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: Export a 1 column SAS dataset to a TEXT file while respecting the special characters in the colu in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725306#M225256</link>
    <description>&lt;P&gt;Please show some data and what the expected file should look like.&lt;/P&gt;
&lt;P&gt;Proc export may not be the proper tool.&lt;/P&gt;
&lt;P&gt;If by column you mean a variable try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   set final;
   file file_out;
   put variablename;
run;&lt;/PRE&gt;
&lt;P&gt;You should have looked in the log and seen something similar to this there.&lt;/P&gt;
&lt;P&gt;If your variable is really long you might have to set the LRECL= on the FILE statement to a value long to hold a long string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the file is actual a SAS program file is there a reason you do not name it with the .SAS extension?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Mar 2021 00:14:17 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-03-11T00:14:17Z</dc:date>
    <item>
      <title>Export a 1 column SAS dataset to a TEXT file while respecting the special characters in the column?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725296#M225249</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My task is to modify an existing SAS program file by adding a line for version control each time our programs are validated. I have a program in place that currently is able to read in the original .SAS file as a SAS dataset with one column. I do some manipulation to achieve the required program text for the new program version but do not know how to export this dataset column to a .SAS file. I know that .SAS files are essentially just .TXT files, so I am trying to use proc export to output this column to a .TXT file and will then convert the .TXT file to a .SAS file using %sysexec commands.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code that I am currently using:&lt;/P&gt;&lt;P&gt;filename file_out "C:\test.txt";&lt;BR /&gt;proc export data=final&lt;BR /&gt;outfile= file_out&lt;BR /&gt;dbms=dlm replace;&lt;BR /&gt;delimiter='';&lt;BR /&gt;putnames=no;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, this code is outputting a .TXT file that has quotes wrapped around all records that are not "stripped". Is there a way to get around this and have the proc export respect records with leading tabs or spaces and not modify the string to contain extra quotations?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 22:55:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725296#M225249</guid>
      <dc:creator>TPlevney17</dc:creator>
      <dc:date>2021-03-10T22:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export a 1 column SAS dataset to a TEXT file while respecting the special characters in the colu</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725306#M225256</link>
      <description>&lt;P&gt;Please show some data and what the expected file should look like.&lt;/P&gt;
&lt;P&gt;Proc export may not be the proper tool.&lt;/P&gt;
&lt;P&gt;If by column you mean a variable try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data _null_;
   set final;
   file file_out;
   put variablename;
run;&lt;/PRE&gt;
&lt;P&gt;You should have looked in the log and seen something similar to this there.&lt;/P&gt;
&lt;P&gt;If your variable is really long you might have to set the LRECL= on the FILE statement to a value long to hold a long string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the file is actual a SAS program file is there a reason you do not name it with the .SAS extension?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 00:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725306#M225256</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-11T00:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export a 1 column SAS dataset to a TEXT file while respecting the special characters in the colu</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725515#M225373</link>
      <description>&lt;P&gt;Thank you for your reply. After playing around for a while I was able to get the file to output correctly while respecting the leading tabs and spaces with the following code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TPlevney17_1-1615481959209.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55824iF4734A08D26E8E8F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TPlevney17_1-1615481959209.png" alt="TPlevney17_1-1615481959209.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Mar 2021 16:59:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-a-1-column-SAS-dataset-to-a-TEXT-file-while-respecting/m-p/725515#M225373</guid>
      <dc:creator>TPlevney17</dc:creator>
      <dc:date>2021-03-11T16:59:58Z</dc:date>
    </item>
  </channel>
</rss>

