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

When trying to import an Excel sheet with a column containing wrapped text, only the first line of text gets imported. 

 

Can I import all the text in the column with wrapped text without "unwrapping" it manually?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
HFatTRI
Fluorite | Level 6

It turns out the problem was not the proc import but a subsequent combination of datasets in a data step.

 

So I learned from this that wrapped text does not appear to be a problem and that you may have to use a length statement when combining multiple datasets to avoid truncation, even though the variables in each dataset have the same lengths in bytes.

View solution in original post

3 REPLIES 3
ballardw
Super User

Pleas shoe the code for how you are "importing" the file.

Ideally provide an example of the file but I realize that may not be possible.

 

"Wrapping" should not be any issue. More like is the presence of line breaks cause by using Alt-Enter but without an example it may be difficult to provide an specific solutions.

HFatTRI
Fluorite | Level 6

Hi,  ballardw.

 

Yes I think you're right, it's probably the line breaks that are the problem.

Unfortunately I can't provide a file, the text in the column I'm trying to import looks like this: 

 

Option 1;

Option 2;

Option 3; 

 

I would like to import that as one long string but only the first line (Option 1; ) gets imported. 

Here is what the code looks like (preceded by a filename statement): 

 

proc import datafile=tmp dbms = xlsx replace out=study (keep=a--n drop=g h i j k );
sheet="eCRF" ;
datarow=28;
getnames=no;
run;

HFatTRI
Fluorite | Level 6

It turns out the problem was not the proc import but a subsequent combination of datasets in a data step.

 

So I learned from this that wrapped text does not appear to be a problem and that you may have to use a length statement when combining multiple datasets to avoid truncation, even though the variables in each dataset have the same lengths in bytes.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2498 views
  • 0 likes
  • 2 in conversation