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

Using this code in SAS 9.4 TS1M0 to produce a large xl file ...  (56 columns, 48,000 rows)

 

proc export data=GQBPlus_BU (where=(put(OwnerOpCd,$BUCd.)="&BUCode"))

Outfile= "\GQBPlus\&BuCode.\GQBPlus_&BUCode" /*path abbreviated*/

DBMS=xlsx Replace;

Sheet="Local&BUCode";

 

Upon opening the excel file, this message comes up:

 

We found a problem with some content in ... Full message attached as a jpg file. The file opens upon a Yes answer and Excel produces an uninformative log.

 

What needs to be changed to avoid the excel message?

 

Thank you,
Bill

 

 

 

 


Capture.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

I suspect the only way to not get a message from  Excel is to ensure the resultant file doesn't violate any of Excel's expectations.

 

What is the value of &bucode? You may be trying to create a sheet name excel doesn't like.

Another option would be to export to CSV and open that with Excel. At least with CSV you can see what your exported data looks like with any file viewer that supports plain text.

 

There may also be a problem if none of your records match your where criteria.

You might try making an actual subset of the data and not using a where dataset option.

 

any diagnostics from the Proc Export like 0 records written?

View solution in original post

2 REPLIES 2
ballardw
Super User

I suspect the only way to not get a message from  Excel is to ensure the resultant file doesn't violate any of Excel's expectations.

 

What is the value of &bucode? You may be trying to create a sheet name excel doesn't like.

Another option would be to export to CSV and open that with Excel. At least with CSV you can see what your exported data looks like with any file viewer that supports plain text.

 

There may also be a problem if none of your records match your where criteria.

You might try making an actual subset of the data and not using a where dataset option.

 

any diagnostics from the Proc Export like 0 records written?

Bill
Quartz | Level 8

Thank you ballardw for your response.

 

An xl file is "successfully" produced with the code used. I don't see a problem with the file, but it is disconcerting for users to see the message. Hence I'd like to avoid the situation.

 

The value of &BUcode is PCR - xl should like that!

 

Tried the csv route and it works well. Users will be delighted!

 

Thanks,
Bill

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 6500 views
  • 0 likes
  • 2 in conversation