<?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 Proc export in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14206#M2215</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I need to export a dataset to the flat file , each field in each record is separated by a tilde and each record in each file is delimited by a right bracket.Below is my code,&lt;BR /&gt;
&lt;BR /&gt;
PROC EXPORT DATA=Enrollment&lt;BR /&gt;
OUTFILE= "C:\Documents and Settings\Desktop\Enroll.txt"&lt;BR /&gt;
DBMS=DLM;&lt;BR /&gt;
DELIMITER= '~';&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
My question is whats the option need to use to get the special character "&lt;B&gt;}&lt;/B&gt;" at the end of  the each record.&lt;BR /&gt;
&lt;BR /&gt;
Report needs to look like,&lt;BR /&gt;
&lt;BR /&gt;
123~345~0~3.00~A12345&lt;B&gt;}&lt;/B&gt;&lt;BR /&gt;
234~567~1~4.89~C23456&lt;B&gt;}&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance.</description>
    <pubDate>Wed, 15 Jun 2011 13:36:12 GMT</pubDate>
    <dc:creator>raveena</dc:creator>
    <dc:date>2011-06-15T13:36:12Z</dc:date>
    <item>
      <title>Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14206#M2215</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I need to export a dataset to the flat file , each field in each record is separated by a tilde and each record in each file is delimited by a right bracket.Below is my code,&lt;BR /&gt;
&lt;BR /&gt;
PROC EXPORT DATA=Enrollment&lt;BR /&gt;
OUTFILE= "C:\Documents and Settings\Desktop\Enroll.txt"&lt;BR /&gt;
DBMS=DLM;&lt;BR /&gt;
DELIMITER= '~';&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
My question is whats the option need to use to get the special character "&lt;B&gt;}&lt;/B&gt;" at the end of  the each record.&lt;BR /&gt;
&lt;BR /&gt;
Report needs to look like,&lt;BR /&gt;
&lt;BR /&gt;
123~345~0~3.00~A12345&lt;B&gt;}&lt;/B&gt;&lt;BR /&gt;
234~567~1~4.89~C23456&lt;B&gt;}&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance.</description>
      <pubDate>Wed, 15 Jun 2011 13:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14206#M2215</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-06-15T13:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14207#M2216</link>
      <description>I'm not aware of an option to do this directly, but you could take the code produced by Proc Export (it'll be in your log file), and use that directly.&lt;BR /&gt;
&lt;BR /&gt;
You'll see where the delimiter is specified, and you can just add an extra put ( '(' ); after it outputs the other lines.</description>
      <pubDate>Wed, 15 Jun 2011 14:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14207#M2216</guid>
      <dc:creator>DF</dc:creator>
      <dc:date>2011-06-15T14:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14208#M2217</link>
      <description>Hi DF,&lt;BR /&gt;
&lt;BR /&gt;
I tried like this. If you want to use PROC EXPORT, the easiest way to get a } at the end of each record is to create a variable with ' }' as the value for each record.   Then when you do the EXPORT, that variable will get written out at the end.  &lt;BR /&gt;
&lt;BR /&gt;
data Enrollment;&lt;BR /&gt;
set Enrollment;&lt;BR /&gt;
last = '}';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
PROC EXPORT DATA=Enrollment&lt;BR /&gt;
OUTFILE= "C:\Documents and Settings\Desktop\Enroll.txt"&lt;BR /&gt;
DBMS=DLM;&lt;BR /&gt;
DELIMITER= '~';&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
It works well. Is there any way to hide that 'column &lt;B&gt;last'&lt;/B&gt; in the flat file ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Wed, 15 Jun 2011 15:57:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14208#M2217</guid>
      <dc:creator>raveena</dc:creator>
      <dc:date>2011-06-15T15:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14209#M2218</link>
      <description>Indirectly.  After running your code, do a recall last submit (i.e., function key f4).&lt;BR /&gt;
&lt;BR /&gt;
That will recall the datastep that was actually submitted.  In it, early in the code, you'll see the statement that outputs the variable names (i.e., if _n_ eq 1, put, etc, etc.), with the last couple of lines in that section putting your tilde and bracket.&lt;BR /&gt;
&lt;BR /&gt;
Simply delete the unwanted characters and run the datastep directly.&lt;BR /&gt;
&lt;BR /&gt;
HTH,&lt;BR /&gt;
Art&lt;BR /&gt;
----------&lt;BR /&gt;
&amp;gt; Hi DF,&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; I tried like this. If you want to use PROC EXPORT,&lt;BR /&gt;
&amp;gt; the easiest way to get a } at the end of each record&lt;BR /&gt;
&amp;gt; is to create a variable with ' }' as the value for&lt;BR /&gt;
&amp;gt; each record.   Then when you do the EXPORT, that&lt;BR /&gt;
&amp;gt; variable will get written out at the end.  &lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; data Enrollment;&lt;BR /&gt;
&amp;gt; set Enrollment;&lt;BR /&gt;
&amp;gt; last = '}';&lt;BR /&gt;
&amp;gt; run;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; PROC EXPORT DATA=Enrollment&lt;BR /&gt;
&amp;gt; OUTFILE= "C:\Documents and&lt;BR /&gt;
&amp;gt; Settings\Desktop\Enroll.txt"&lt;BR /&gt;
&amp;gt; DBMS=DLM;&lt;BR /&gt;
&amp;gt; DELIMITER= '~';&lt;BR /&gt;
&amp;gt; RUN;&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; It works well. Is there any way to hide that 'column&lt;BR /&gt;
&amp;gt; &lt;B&gt;last'&lt;/B&gt; in the flat file ?&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Thanks.</description>
      <pubDate>Wed, 15 Jun 2011 18:57:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14209#M2218</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-06-15T18:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proc export</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14210#M2219</link>
      <description>[pre]&lt;BR /&gt;
data _null_;&lt;BR /&gt;
 set sashelp.class;&lt;BR /&gt;
 file 'c:\temp\class.txt' delimiter='~';&lt;BR /&gt;
 put (_all_ ) (:) +(-1) '}';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Thu, 16 Jun 2011 06:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-export/m-p/14210#M2219</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-06-16T06:31:54Z</dc:date>
    </item>
  </channel>
</rss>

