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

I am running the following code:

proc export data=work.data

     outfile='C:\test.csv'

     dbms=csv replace;

     delimiter=';';

run;

The column names are pretty long and so it is wrapping the first row.  I do not want it to wrap.

Example of what is happening:

column1;column2;column3;column4;column5;

column6;column7

What I want:

column1;column2;column3;column4;column5;column6;column7

After the 99th character it begins to wrap.

Any help with this would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

How do you know it is wraping, have you opened it in a text editor perhaps?  Its most likely your text editor adding nice wrapping.  Open it with Excel and see if the columns are all correct.

Also, don't use proc export as it just guesses what you want, and so you can end up with problems.  Write a simple datastep with a file statement and put out your data, gives you more control.

View solution in original post

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

How do you know it is wraping, have you opened it in a text editor perhaps?  Its most likely your text editor adding nice wrapping.  Open it with Excel and see if the columns are all correct.

Also, don't use proc export as it just guesses what you want, and so you can end up with problems.  Write a simple datastep with a file statement and put out your data, gives you more control.

LAtwood
Calcite | Level 5

You are right.  When I open it with Notepad it displays the wrapping.  When I open it in excel it is on one row.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yep, under Format action menu item there is an option for Word Wrap.  If you do get this and its not just the text editor, you can always check with a hex editor (plenty of free ones out there), and what you would see is 2 codes, 0a and 0d which are tab and line feed.

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