<?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 data set via data  step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895885#M353952</link>
    <description>&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/One_of_These_Things_(Is_Not_Like_the_Others)" target="_blank"&gt;https://en.wikipedia.org/wiki/One_of_These_Things_(Is_Not_Like_the_Others)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file &amp;amp;file_extract dsd dlm = ';';
file &amp;amp;file_extract dsd dbms=tab;
file &amp;amp;file_extract dsd dlm='09'x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
    <pubDate>Tue, 26 Sep 2023 12:27:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-09-26T12:27:32Z</dc:date>
    <item>
      <title>Export data set via data  step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895854#M353945</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to export sas data set into TXT file.&lt;/P&gt;
&lt;P&gt;I want to use DATA STEP way .&lt;/P&gt;
&lt;P&gt;In example 2 I get error&lt;/P&gt;
&lt;PRE&gt;30         file &amp;amp;file_extract dsd dbms=tab;
                                  ____
                                  23
ERROR 23-2: Invalid option name DBMS.&lt;/PRE&gt;
&lt;P&gt;What is the way to solve the error?&lt;/P&gt;
&lt;P&gt;I also want to add column headers&amp;nbsp; in example2? What is the way to do it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data junk;
Set sashelp.class;
if sex='F' then age=.;
label
Name='Client_Name'
Sex='Gender'
Age='Age'
Height='Height'
Weight='Weight'
;
run;

/***Example1---Working well****/
%let file_extract='/usr/local/SAS/SASUsers/LabRet/Adhoc/creditCards/Example1.txt';
%put &amp;amp;file_extract;
data _null_;
file &amp;amp;file_extract dsd dlm = ';';
set junk;
put (_all_) (~);
run;

/***Example2---Error****/
%let file_extract='/usr/local/SAS/SASUsers/LabRet/Adhoc/creditCards/Example2.txt';
%put &amp;amp;file_extract;
data _null_;
file &amp;amp;file_extract dsd dbms=tab;
set junk;
put (_all_) (~);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 09:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895854#M353945</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2023-09-26T09:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export data set via data  step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895861#M353946</link>
      <description>&lt;P&gt;Maybe you should start following &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068" target="_self"&gt;Maxim 1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This will save you time.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 10:34:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895861#M353946</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2023-09-26T10:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export data set via data  step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895885#M353952</link>
      <description>&lt;P&gt;&lt;A href="https://en.wikipedia.org/wiki/One_of_These_Things_(Is_Not_Like_the_Others)" target="_blank"&gt;https://en.wikipedia.org/wiki/One_of_These_Things_(Is_Not_Like_the_Others)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file &amp;amp;file_extract dsd dlm = ';';
file &amp;amp;file_extract dsd dbms=tab;
file &amp;amp;file_extract dsd dlm='09'x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;</description>
      <pubDate>Tue, 26 Sep 2023 12:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895885#M353952</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-09-26T12:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: Export data set via data  step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895888#M353954</link>
      <description>&lt;P&gt;Maxim 1.&lt;/P&gt;
&lt;P&gt;Maxim 1.&lt;/P&gt;
&lt;P&gt;Maxim 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DBMS= is not a valid option for the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n15o12lpyoe4gfn1y1vcp6xs6966.htm" target="_blank" rel="noopener"&gt;FILE Statement&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;It is an option available in the IMPORT and EXPORT procedures.&lt;/P&gt;
&lt;P&gt;To create a tab-delimited file, use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let file_extract=/usr/local/SAS/SASUsers/LabRet/Adhoc/creditCards/Example2.txt;
file "&amp;amp;file_extract." dsd dlm="09"x;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To add a header line, create a string with CATX and PUT it at the beginning:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if _n_ = 1
then do;
  length header $500; * make it big enough;
  header = catx("09"x,"name1","name2","name3"); * add variable names or labels as needed;
  put header;
end;
put
  name1
  name2
  name3
; * add variables as needed;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Sep 2023 12:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895888#M353954</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-26T12:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Export data set via data  step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895889#M353955</link>
      <description>&lt;P&gt;PS you can use PROC EXPORT with DBMS=TAB and then read the log to see how the procedure creates a tab-delimited file with the DATA step.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 12:46:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-data-set-via-data-step/m-p/895889#M353955</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-09-26T12:46:33Z</dc:date>
    </item>
  </channel>
</rss>

