Hi, I have used this code to write to a pipe delimited file so many times and for some reason today it will not work on a data set. I get the error 'Some output data may be lost because DROPOVER option was specified.' So out of 200,000 records it only outputs 2 records.
%let outfile=want;
data _null_;
%let _EFIERR_=0;
%let _EFIREC_=0;
file "&outfile." DSD delimiter='|' DSD DROPOVER lrecl=32767;
if _n_=1 then do;
put
"var1"
'|'
"var2"
'|'
"var3"
'|'
"varN"
; end;
set have end=EFIEOD;
format var1 $4.;
format var2 $6.;
format var3 best12.;
format varN best12;
do
EFIOUT +1;
put var1 $@;
put var2 $@;
put var3 @;
put varN @;
end;
if _ERROR_ then call symputx('_EFIERR_',1);
if EFIEOD then call symputx('_EFIREC_',EFIOUT) ;
run;
I cannot figure out what I am doing wrong. Any thoughts?? Anyone else seen this error? THANKS!
I figured it out! That last @ in the put statements causes the carriage return. Once I remove it works 🙂
@LOLO wrote:
Hi, I have used this code to write to a pipe delimited file so many times and for some reason today it will not work on a data set. I get the error 'Some output data may be lost because DROPOVER option was specified.' So out of 200,000 records it only outputs 2 records.
%let outfile=want;
data _null_;
%let _EFIERR_=0;
%let _EFIREC_=0;
file "&outfile." DSD delimiter='|' DSD DROPOVER lrecl=32767;
I cannot figure out what I am doing wrong. Any thoughts?? Anyone else seen this error? THANKS!
Are you attempting to have 4 variables on one line or keep stacking them across the output file until the lrecl is filled?
Perhaps missing a final put; to end the line?
I would like the variable names listed across the top - so for simplicity sake 4 rows. My actual data has 265 variables and 200,000 records. Am I missing a 'put?' When I look at the txt file it creates it looks like a 'flowover' so the second records starts on the same line as the first record.
I figured it out! That last @ in the put statements causes the carriage return. Once I remove it works 🙂
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.