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

Accepted Solutions
Quentin
Super User

This paper has some examples:

https://www.lexjansen.com/pharmasug/2011/AD/PharmaSUG-2011-AD06.pdf

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.

View solution in original post

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.

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
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;
Quentin
Super User

This paper has some examples:

https://www.lexjansen.com/pharmasug/2011/AD/PharmaSUG-2011-AD06.pdf

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
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;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 4 replies
  • 521 views
  • 2 likes
  • 2 in conversation