Desktop productivity for business analysts and programmers

put text file without header

Accepted Solution Solved
Reply
Contributor
Posts: 55
Accepted Solution

put text file without header

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;


Accepted Solutions
Solution
‎07-11-2014 05:02 PM
Valued Guide
Posts: 2,177

Re: put text file without header

filename text1 "d:\text_file_name";

data _null_;

file text1 dlm="|" DSD;

set sashelp.class;

put (var1 var2 var3 var4)(:);

run;

View solution in original post


All Replies
Super Contributor
Posts: 358

Re: put text file without header

From the manual:

FILE PRINT <NOTITLES> <FOOTNOTES>;

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.

Contributor
Posts: 55

Re: put text file without header

how can we perform it from code perspective - because this piece of code should goes with automation...

Thank you...

Solution
‎07-11-2014 05:02 PM
Valued Guide
Posts: 2,177

Re: put text file without header

filename text1 "d:\text_file_name";

data _null_;

file text1 dlm="|" DSD;

set sashelp.class;

put (var1 var2 var3 var4)(:);

run;

Contributor
Posts: 55

Re: put text file without header

Thanks a lot Peter - it worked fine...

Super User
Posts: 9,865

Re: put text file without header

ods _all_ close;
ods csv file='c:\temp\x.txt' options(delimiter='|');
proc print data=sashelp.class noobs label;run;
ods csv ;

Xia Keshan

Valued Guide
Posts: 2,177

Re: put text file without header

Xia

have you tried ods csv on a large table?

Last time I tried it took much longer than the datastep solution.

peter

Super User
Posts: 9,865

Re: put text file without header

I know. it is more efficient for data step.

Contributor
Posts: 46

Re: put text file without header

/* 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;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 8 replies
  • 529 views
  • 0 likes
  • 5 in conversation