BookmarkSubscribeRSS Feed
Akash93
Fluorite | Level 6

Hi Team,

 

We have developed stored procedure to download data dump in text file with below code.

 

proc export data=data_download outfile="path" file =_webout

dbms=tab replace;

run;

 

In output last 11 column names are getting excluded. Means row 1st is blank for these 11 columns and data is flowing for these columns.

 

I am attaching sample for reference. Please help if there is any solution.

 

Regards,
Akash

1 REPLY 1
Tom
Super User Tom
Super User

Why did you attach an XLSX file to your question when the SAS code in the question was generating a TEXT file?

 

PROC EXPORT might have trouble with header lines that are too long.  I know PROC IMPORT does.

 

Fortunately writing a simple text file does not need a PROC.  The DATA step can do it by itself.  But adding the header line is adds a little complication. 

 

* Write header row ;
proc transpose data=data_download(obs=0) out=names;
  var _all_;
run;
data _null_;
  file _webout dsd dlm='09'x lrecl=1000000;
  set names;
  put _name_ @;
run;

* Append data rows;
data _null_;
  file _webout dsd dlm='09'x lrecl=1000000 mod;
  set data_download;
  put (_all_) (+0);
run;

 

If you have trouble writing it directly to the _WEBOUT fileref then create a physical file first and copy it.

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1 reply
  • 1057 views
  • 0 likes
  • 2 in conversation