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-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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