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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: