BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jimksas
Calcite | Level 5

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

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

8 REPLIES 8
OS2Rules
Obsidian | Level 7

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.

jimksas
Calcite | Level 5

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

Thank you...

Peter_C
Rhodochrosite | Level 12

filename text1 "d:\text_file_name";

data _null_;

file text1 dlm="|" DSD;

set sashelp.class;

put (var1 var2 var3 var4)(:);

run;

jimksas
Calcite | Level 5

Thanks a lot Peter - it worked fine...

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

Xia Keshan

Peter_C
Rhodochrosite | Level 12

Xia

have you tried ods csv on a large table?

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

peter

Ksharp
Super User

I know. it is more efficient for data step.

sas_lak
Quartz | Level 8

/* 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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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