BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASuserlot
Barite | Level 11

I encountered the following requests that I never think of it.

  1. I need to generate the RTF using as and make as Read only RTF. is there any option that SAS will do this? I searched some but there is no luck . I know the access option for datasets but not RTF. I read about filename permission and tried but not sure how to use it.
  2. It is also similar to the first one, but this one is xlsx file  which is already exist. can we change the permission of the file, using the SAS

If SAS will not work , is there alternatives that we can do using SAS like vbscript or cmd commands.. etc.  I am aware RTF is a text file giving this read-only doesn't guarantee any strong securities.

 

Any suggestion? Thanks.

1 ACCEPTED SOLUTION
4 REPLIES 4
Quentin
Super User

I would look into how to set those permissions from the OS.  

 

If your SAS session has XCMD option enabled, then if you how to set the permissions via OS command, you can use the X or SYSTASK  statement to execute the OS command. 

 

So you're using SAS to generate the file, and also using SAS to set the permissions after generating the file.  By having SAS send a command for the OS to execute.

 

So if you're on linux, look into the CHMOD command.  And I'm sure there's something similar for windows.

SASuserlot
Barite | Level 11

Thank you @Quentin  for quick options. I am kind of new to use the cmd in SAS ( windows). by any chance can you guide to the reference or a syntax will help. Really appreciate your time.

/* create  renaming and looking for set read-only access*/

ods rtf file="c:\documents\sample.rtf";* style=table_rtf;
proc print data= sashelp.class;
run;
ods _all_ close;


*trying x command;
options noxwait;
data _null_;
x 'attrib r+ "c:\documents\sample.rtf"';
run;
SASuserlot
Barite | Level 11

thank you the references got what I need. It worked. Thanks you again.


options noxwait noxsync;
data _null_;
x 'attrib +r "D:\sample.rtf"';
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1224 views
  • 2 likes
  • 2 in conversation