<?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: Creating a comma delimited text file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62415#M17753</link>
    <description>Use a filename where I used TEMP.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename FT56F001 temp;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   file FT56F001 dsd termstr=crlf;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   today = date();&lt;BR /&gt;
   format today yymmdd10.;&lt;BR /&gt;
   put (_all_)(~);&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
proc fslist file=ft56f001;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
    <pubDate>Thu, 05 May 2011 11:06:23 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2011-05-05T11:06:23Z</dc:date>
    <item>
      <title>Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62414#M17752</link>
      <description>I need some help converting a SAS dataset into a specific Text file format &lt;BR /&gt;
The ideal format for the text files would be:&lt;BR /&gt;
&lt;BR /&gt;
All files should be in text format with each line of data ended with a {CR}{LF} character pair.  &lt;BR /&gt;
All fields REGARDLESS OF TYPE should be encapsulated in double quotes and separated by a single comma.  &lt;BR /&gt;
Any date values should be in the form “YYYY-MM-DD”. &lt;BR /&gt;
Header and trailer records are not required. &lt;BR /&gt;
 &lt;BR /&gt;
Below is an example record of the output type I need:&lt;BR /&gt;
&lt;BR /&gt;
"56979","GCR011","3882","Actual","2010-10-31","179.09"&lt;BR /&gt;
"45153","GCR011","3000","Actual","2011-01-31","75.80"&lt;BR /&gt;
&lt;BR /&gt;
Within the dataset dates and numerics are formatted as date and numeric variables.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance</description>
      <pubDate>Thu, 05 May 2011 08:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62414#M17752</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-05-05T08:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62415#M17753</link>
      <description>Use a filename where I used TEMP.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename FT56F001 temp;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
   file FT56F001 dsd termstr=crlf;&lt;BR /&gt;
   set sashelp.class;&lt;BR /&gt;
   today = date();&lt;BR /&gt;
   format today yymmdd10.;&lt;BR /&gt;
   put (_all_)(~);&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
proc fslist file=ft56f001;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 05 May 2011 11:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62415#M17753</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-05-05T11:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62416#M17754</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
Very simple way to do is by ODS.&lt;BR /&gt;
&lt;BR /&gt;
Code goes here&lt;BR /&gt;
&lt;BR /&gt;
ODS CSV FILE="C:\TEXTDATA.CSV";&lt;BR /&gt;
PROC PRINT DATA=SASHELP.CLASS;&lt;BR /&gt;
RUN;&lt;BR /&gt;
ODS CSV CLOSE;</description>
      <pubDate>Thu, 05 May 2011 14:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62416#M17754</guid>
      <dc:creator>sss</dc:creator>
      <dc:date>2011-05-05T14:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62417#M17755</link>
      <description>Thanks data _null_.&lt;BR /&gt;
&lt;BR /&gt;
I got it working apart from one issue. The actual width of my report is much larger than the example and has 45 variables. Before it reached the end of the first observation though the text file creates at carriage return (without a comma separation) and creates a new line. &lt;BR /&gt;
&lt;BR /&gt;
EG: -&lt;BR /&gt;
"56979","GCR011","3882","Actual"&lt;BR /&gt;
"2010-10-31","179.09"&lt;BR /&gt;
"45153","GCR011","3000","Actual","2011-01-31"&lt;BR /&gt;
"75.80"&lt;BR /&gt;
&lt;BR /&gt;
Is there a way around this at all?&lt;BR /&gt;
&lt;BR /&gt;
Thanks...</description>
      <pubDate>Thu, 05 May 2011 14:38:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62417#M17755</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-05-05T14:38:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62418#M17756</link>
      <description>Sorry, I've ised the lrecl= to set width and it appears ok.&lt;BR /&gt;
However, I want to confirm that by setting the lrecl= does that affect the 'carriage return' ({CR}{LF} character pair) I need at the end of each line?&lt;BR /&gt;
&lt;BR /&gt;
Thanks......</description>
      <pubDate>Thu, 05 May 2011 14:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62418#M17756</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-05-05T14:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62419#M17757</link>
      <description>You are correct as long as LRECL is big enough for the longest record everthing else will be OK.</description>
      <pubDate>Thu, 05 May 2011 16:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62419#M17757</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2011-05-05T16:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a comma delimited text file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62420#M17758</link>
      <description>Thanks for all the help, it all works perfectly now. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 06 May 2011 08:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Creating-a-comma-delimited-text-file/m-p/62420#M17758</guid>
      <dc:creator>uksusu</dc:creator>
      <dc:date>2011-05-06T08:06:52Z</dc:date>
    </item>
  </channel>
</rss>

