BookmarkSubscribeRSS Feed
mgoddard
Calcite | Level 5

Hey, brand new user here! I switched from Mac to PC and am (shockingly!) having some new hiccups with SAS. Every time I do a data export the file is locked and I have to rename it. It's annoying but nothing difficult. The problem arises when I try to create an RTF with my result tables--since I have to re-run the codes to create the tables and the exported datafiles are all locked the code can't run and I can't figure out how to change the settings so the exported files are not locked on arrival. Help!

3 REPLIES 3
ballardw
Super User

Since you are new "export" is a specific procedure and the term refers basically to files intended for data transmission.

RTF would not qualify as "export" as such because of accompanying formatting and such of tables.

 

Since you are generating RTF (or any other ODS destination) you have to close the destination, otherwise SAS has the file still in use and would be considered locked.

Very brief example:

ods rtf file="somepath\somefile.rtf";

Proc print data=sashelp.class;
run;

ods rtf close;

You can have many different procedures that generate output inside one Ods destination "sandwich" but you need to close each destination. The "sandwich" is a very informal term relating to the pair of "Ods <destination> ; Ods <destination> close; The first is the top slice of the sandwich and the close is the bottom slice.

 

 

 

andreas_lds
Jade | Level 19

Please post the code you are using and the complete log, so that we see what happens actually.

Reeza
Super User
Are you writing to a location that has some weird permission settings that are being inherited?
A cloud storage location like OneDrive?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 927 views
  • 0 likes
  • 4 in conversation