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
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.