<?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: Header in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23610#M5240</link>
    <description>Hi Gary ,&lt;BR /&gt;
&lt;BR /&gt;
I tried as below.. its not working ..&lt;BR /&gt;
&lt;BR /&gt;
data _null_; &lt;BR /&gt;
set vishal; &lt;BR /&gt;
file 'C:\Documents and Settings\Desktop\vishal.txt' DLM=',';&lt;BR /&gt;
if _n_ = 1 then do;&lt;BR /&gt;
put 'v1' '~'   'v2' '~';&lt;BR /&gt;
put ( _all_ ) (~);&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 07 Mar 2011 19:12:13 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2011-03-07T19:12:13Z</dc:date>
    <item>
      <title>Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23608#M5238</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I need to export this dataset to a txt file. while running this code, the data got exported , but am not getting headers like v1,v2..please let me know hoew to include headers ..&lt;BR /&gt;
&lt;BR /&gt;
data vishal;&lt;BR /&gt;
input v1 $1. v2 v3 v4 test&amp;amp;$20.;&lt;BR /&gt;
cards;&lt;BR /&gt;
a 1 2 3 test^it&lt;BR /&gt;
b 4 5 6 test this&lt;BR /&gt;
c 7 8 9 none&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data _null_; &lt;BR /&gt;
    set vishal; &lt;BR /&gt;
     file 'C:\Documents and Settings\\Desktop\vishal.txt'   DLM=',';&lt;BR /&gt;
   put ( _all_ ) (~);&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance !!!</description>
      <pubDate>Mon, 07 Mar 2011 18:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23608#M5238</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-07T18:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23609#M5239</link>
      <description>before your put statement, try this&lt;BR /&gt;
&lt;BR /&gt;
if _n_ = 1 then do;&lt;BR /&gt;
put 'v1'  '~'&lt;BR /&gt;
     'v2'  '~'&lt;BR /&gt;
etc.&lt;BR /&gt;
end;</description>
      <pubDate>Mon, 07 Mar 2011 19:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23609#M5239</guid>
      <dc:creator>garybald</dc:creator>
      <dc:date>2011-03-07T19:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23610#M5240</link>
      <description>Hi Gary ,&lt;BR /&gt;
&lt;BR /&gt;
I tried as below.. its not working ..&lt;BR /&gt;
&lt;BR /&gt;
data _null_; &lt;BR /&gt;
set vishal; &lt;BR /&gt;
file 'C:\Documents and Settings\Desktop\vishal.txt' DLM=',';&lt;BR /&gt;
if _n_ = 1 then do;&lt;BR /&gt;
put 'v1' '~'   'v2' '~';&lt;BR /&gt;
put ( _all_ ) (~);&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 07 Mar 2011 19:12:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23610#M5240</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-07T19:12:13Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23611#M5241</link>
      <description>Yes Gary Its worked out  !!!&lt;BR /&gt;
I missed the end statement ..&lt;BR /&gt;
&lt;BR /&gt;
ThankYou !!</description>
      <pubDate>Mon, 07 Mar 2011 19:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23611#M5241</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-07T19:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23612#M5242</link>
      <description>Hello Raveenat,&lt;BR /&gt;
&lt;BR /&gt;
Try to use the proc EXPORT like this: &lt;BR /&gt;
[pre]&lt;BR /&gt;
proc export DATA=Vishal &lt;BR /&gt;
  OUTFILE='C:\Documents and Settings\\Desktop\vishal.xls'  &lt;BR /&gt;
  DBMS=CSV REPLACE;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 07 Mar 2011 19:26:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23612#M5242</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-07T19:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23613#M5243</link>
      <description>Yes SPR.. I tried proc export (need to export it as text file) too but am not getting variables on proper order.&lt;BR /&gt;
Please suggest me how to get an variables on proper order ?</description>
      <pubDate>Mon, 07 Mar 2011 19:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23613#M5243</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-07T19:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23614#M5244</link>
      <description>Hello Raveenat,&lt;BR /&gt;
&lt;BR /&gt;
It looks like we move in circles. To order variables use a datastep with retain before set, then export. For example;&lt;BR /&gt;
[pre]&lt;BR /&gt;
data r;&lt;BR /&gt;
  retain A,B,C;&lt;BR /&gt;
  set i;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
Dataset r has variables in the order A, B, C irrelevant to their order in i.&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 07 Mar 2011 20:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23614#M5244</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2011-03-07T20:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Header</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23615#M5245</link>
      <description>Thanks SPR !!  Its perfect now !!</description>
      <pubDate>Mon, 07 Mar 2011 20:42:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Header/m-p/23615#M5245</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2011-03-07T20:42:59Z</dc:date>
    </item>
  </channel>
</rss>

