BookmarkSubscribeRSS Feed
Q1983
Lapis Lazuli | Level 10

data mydata(keep=name address city state zip phone email);

set data1;

run;

I am using a proc export

proc export data=mydata;

set mydata1;

File "/servername/report..txt"

Linesize=8000 dsd dlm='|';

run;

In some cases there may be a blank in one or more fields

Osborne 1313 E Main St Washington DC myemail@me.com  (In this case we skipped the zip and phone number

In my proc export  I am getting double || and sometimes I get what appear to be small boxes.  The carraige returns are not working.  The display should begin a new line after email however in some cases a new record will begin on the same line

Osborne 1313 E Main St Washington DC myemail@me.com Bradeley 1312 E Main

Would a trim function fix this in some way?

2 REPLIES 2
ballardw
Super User

Likely not. The small boxes are usually unprintable characters. Proc export allows almost no control over the resulting output. You mention "carriage returns are not working". Did you try to embed them into the strings?

You get || because your delimiter is | and there is no data in that field. CSV and other delimited formats do the same thing, no data means sequential delimiters to ensure the number of columns are the same in each record.

You may want to post a few lines of input data and what you expect it to look like. Include some of the examples with blanks or other odd data.

A data _null_ step with put statements may be a solution.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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