i am trying to put text file out without header - how can i do that - please help
filename text1 "d:\text_file_name";
data _null_;
file text1 dlm="|";'
set sashelp.class;
put var1 var2 var3 var4;
run;
filename text1 "d:\text_file_name";
data _null_;
file text1 dlm="|" DSD;
set sashelp.class;
put (var1 var2 var3 var4)(:);
run;
From the manual:
directs output to the SAS procedure output file. Place the FILE statement before the PUT statements that write to that file. The NOTITLES option suppresses titles that are currently in effect, and makes the lines unavailable for writing other text. The FOOTNOTES option, along with the FOOTNOTE statement, writes a footnote to the file.
how can we perform it from code perspective - because this piece of code should goes with automation...
Thank you...
filename text1 "d:\text_file_name";
data _null_;
file text1 dlm="|" DSD;
set sashelp.class;
put (var1 var2 var3 var4)(:);
run;
Thanks a lot Peter - it worked fine...
ods _all_ close; ods csv file='c:\temp\x.txt' options(delimiter='|'); proc print data=sashelp.class noobs label;run; ods csv ;
Xia Keshan
Xia
have you tried ods csv on a large table?
Last time I tried it took much longer than the datastep solution.
peter
I know. it is more efficient for data step.
/* Using the PutName=No output file doesnot have any kind of headers */
proc export data=Out outfile="C:\Users\lakshman\Desktop\New Folder\Out.txt"
dbms=dlm replace;
delimiter="|" ;
putname=no;
run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.