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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2438 views
  • 0 likes
  • 2 in conversation