Help using Base SAS procedures

Proc Export Problem

Not applicable
Posts: 0

Proc Export Problem

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
Trusted Advisor
Posts: 2,125

Re: Proc Export Problem

Posted in reply to deleted_user
Your Excel file is corrupt. See

searched on for
excel "Read Access Violation"
Posts: 9,368

Re: Proc Export Problem

Posted in reply to deleted_user
This Tech Support note seems relevant:

You may want to work with Tech Support on this issue. To send a question to Tech Support, go to 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:

Not applicable
Posts: 0

Re: Proc Export Problem

Posted in reply to deleted_user
Thanks for the replies, much appreciated. I've re-created the target excel file and tried again and it works.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation