BookmarkSubscribeRSS Feed
Liane
Calcite | Level 5

Hi.

 

I'm using the SAS Version 9.4.

I use a macro to import and export data in SAS. First I had a problem when importing data to SAS because the variables were formatted with a maximum length of "$255.", what caused the truncation of some variables and then I changed it to "$1024.".

So now I have a dataset in SAS with that variables formatted as "$1024." but when I try to export them to excel it gives me this error in SAS :"ERROR: The character variable Q422 has too long a value for the MYXLSX library."

 

So looking for ideas to solve this problem and export correctly to excel from SAS.

 

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Hi:
  Without seeing the code you're using to export (LIBNAME engine, PROC EXPORT, ODS) or seeing the data, it's hard to make a constructive comment.

  If you can post the essential part of your code and some of your data, that would be most helpful. When I try using ODS EXCEL with a very large character variable (over 3500 characters), I get everything in Excel correctly.

Cynthia

use_ods_excel_bigvar.png

I put ### at the end of the variable value so I could make sure that the whole string was put into the cell.

 

Here's how I created the data -- using a screen shot so that all 3500+ characters do not wrap funny in the forum posting -- I assume that your character data is coming from an already existing data set or database file:

make_bigvar.png

AlanC
Barite | Level 11

One other point: SAS datasets are also ODBC compliant so you can import them using Excel.

https://github.com/savian-net

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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