<?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: put all records in one line in a flat file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242866#M45121</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x '/folders/myfolders/x.txt' recfm=n;
proc export data=sashelp.class outfile=x dbms=dlm replace;
delimiter='|';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 12 Jan 2016 05:19:31 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-01-12T05:19:31Z</dc:date>
    <item>
      <title>put all records in one line in a flat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242858#M45116</link>
      <description>&lt;P&gt;Hi, I have a dataset that contains multiple records. I need to write it out to a flat file in such a way that all records are written in first record. (same row as header). Below is the code I wrote. But, my job is truncating the file and not outputting all records as I need.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;filename credit "/user/ccc/xx/LTR.txt";&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt; data _null_;&lt;BR /&gt; set test;&lt;/P&gt;
&lt;P&gt;file credit dlm="|" dsd lrecl=60000;&lt;/P&gt;
&lt;P&gt;if _n_=1 then do;&lt;BR /&gt; put @1'var1|var2|var3|var4|var5|var6|var7' &lt;BR /&gt;var1&amp;nbsp;var2 var3 var4 var5 var6 var7; &lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: 1 record was written to the file CREDIT.&lt;BR /&gt; The minimum record length was 90.&lt;BR /&gt; The maximum record length was 90.&lt;BR /&gt;NOTE: There were 7 observations read from the data set WORK.TEST.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.01 seconds&lt;BR /&gt; user cpu time 0.00 seconds&lt;BR /&gt; system cpu time 0.01 seconds&lt;BR /&gt; Memory 1075k&lt;BR /&gt; OS Memory 13352k&lt;BR /&gt; Timestamp 1/11/2016 10:41:44 PM&lt;BR /&gt; Page Faults 0&lt;BR /&gt; Page Reclaims 548&lt;BR /&gt; Page Swaps 0&lt;BR /&gt; Voluntary Context Switches 19&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jan 2016 03:45:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242858#M45116</guid>
      <dc:creator>helloSAS</dc:creator>
      <dc:date>2016-01-12T03:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: put all records in one line in a flat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242861#M45118</link>
      <description>&lt;P&gt;Try something like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename credit "&amp;amp;sasforum.\datasets\credit.txt";

data _null_;
file credit lrecl=60000;
put 'name|sex|age|height|weight|' @;
do while(not done);
    set sashelp.class end=done;
    put (name sex age height weight) (+(-1)"|") @; 
    end;
stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 04:33:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242861#M45118</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-01-12T04:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: put all records in one line in a flat file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242866#M45121</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename x '/folders/myfolders/x.txt' recfm=n;
proc export data=sashelp.class outfile=x dbms=dlm replace;
delimiter='|';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Jan 2016 05:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-all-records-in-one-line-in-a-flat-file/m-p/242866#M45121</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-12T05:19:31Z</dc:date>
    </item>
  </channel>
</rss>

