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;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.