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

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!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LOLO
Obsidian | Level 7

I figured it out! That last @ in the put statements causes the carriage return. Once I remove it works 🙂

 

View solution in original post

3 REPLIES 3
ballardw
Super User

@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?

 

LOLO
Obsidian | Level 7

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.

LOLO
Obsidian | Level 7

I figured it out! That last @ in the put statements causes the carriage return. Once I remove it works 🙂

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 3 replies
  • 665 views
  • 0 likes
  • 2 in conversation