SAS Procedures

Help using Base SAS procedures
BookmarkSubscribeRSS Feed
deleted_user
Not applicable
A regularly used piece of code to export a table from SAS to an excel sheet (in a spreadsheet that already exists) has suddenly stopped working. The code below was used to create a new tab 'sas_update' in the spreadsheet 'policy rule tracking.xls' and previously worked fine.

Now, when the code below runs the first time the various error messages are displayed.

If it is run a second time (with nothing changed) it appears to work (again message displayed below).

However after either the 1st or 2nd attempts the excel file can't be opened - a message is displayed 'cannot access policy rule tracking.xls'.

I have then found that if I close the SAS session I can open the excel file but the new sheet does not appear!

Any ideas / suggestions would be greatly appreciated. This has me completely stumped.

Initial Run

1 libname jgsas 'c:\temp\jgsastemp';
NOTE: Libref JGSAS was successfully assigned as follows:
Engine: V9
Physical Name: c:\temp\jgsastemp

2 proc export data=jgsas.policy_rule_tracking_4
3 outfile='c:\temp\jgsastemp\acquisition tracking\policy rule tracking.xls'
4 dbms=excel2000 replace;
5 sheet=sas_update;
6 run;

ERROR: Read Access Violation In Task [ SQL )
Exception occurred at (5570C819)
Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
5570C819 06F4E1F4 sasjet:mcn_main+0xB819
55750030 06F4E2EC sasiojet:mcn_main+0xF030
6597F5AC 06F4E334 sasxdbi:mcn_main+0xE5AC
671A331A 06F4E484 sasyoio:mcn_main+0x231A
06F626CC 06F4E4F0 sassqx:mcn_main+0x116CC
06F620FD 06F4E5EC sassqx:mcn_main+0x110FD
06F618BB 06F4E628 sassqx:mcn_main+0x108BB
06F771C1 06F4E654 sassqx:mcn_main+0x261C1
06F739E2 06F4FF54 sassqx:mcn_main+0x229E2
600D118A 06F4FF88 sassql:mcn_main+0x18A
01262B02 06F4FFA0 sashost:Main+0xBE72
01266C20 06F4FFB4 sashost:Main+0xFF90
7C80B683 06F4FFEC kernel32:GetModuleFileNameA+0x1B4

WARNING: The data set _IMEX_.sas_update may be incomplete. When this step was stopped there
were 0 observations and 26 variables.
ERROR: Read Access Violation In Task [ SQL )
Exception occurred at (5570C819)
ERROR: Unable to clear or re-assign the library _IMEX_ because it is still in use.
ERROR: Error in the LIBNAME statement.
ERROR: Export unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.59 seconds
cpu time 0.15 seconds

2nd run from here

7 proc export data=jgsas.policy_rule_tracking_4
8 outfile='c:\temp\jgsastemp\acquisition tracking\policy rule tracking.xls'
9 dbms=excel2000 replace;
10 sheet=sas_update;
11 run;

NOTE: "sas_update" was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.50 seconds
cpu time 0.04 seconds Message was edited by: J Guthrie
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
Your Excel file is corrupt. See

http://support.sas.com/kb/15/543.html

searched on support.sas.com for
excel "Read Access Violation"
Cynthia_sas
SAS Super FREQ
Hi:
This Tech Support note seems relevant:
http://support.sas.com/kb/15/543.html

You may want to work with Tech Support on this issue. To send a question to Tech Support, go to http://support.sas.com/ and in the left-hand navigation pane, click on the link entitled "Submit a Problem". Alternately, you can go directly to the Tech Support Problem Form here:
http://support.sas.com/ctx/supportform/createForm

cynthia
deleted_user
Not applicable
Thanks for the replies, much appreciated. I've re-created the target excel file and tried again and it works.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 3069 views
  • 0 likes
  • 3 in conversation