BookmarkSubscribeRSS Feed
roth1
Calcite | Level 5

Hi, my system currently uses scripts to run our batch jobs for EG. However we occasionally encounter table locks due to users accessing the tables therefore resulting in batch job failure. During the re-run of batch job from previous point of failure, we will then use SAS Management console to personally deny user access to the respective tables. We are currently working on the codes to be keyed in SAS EG to grant and deny access for our users through the sas scripts but we are encountering error. Can someone please assist me on how to get it started?

 

Keyed in this line of code in SAS EG

 

sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;

 

Error I got from this line of code is

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

When I keyed in proc sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;


Error I got from this line of code is

ERROR 22-322: Syntax error, expecting one of the following: ;. AUDIT, CC, CLEANUP.

ERROR 76 -322: Syntax error, statement will be ignored.

 

Thank You.

8 REPLIES 8
andreas_lds
Jade | Level 19

Please post code and log your are executing.

 

Afaik there is no "proc sas-show-metadata-access" - the name violates sas naming rules.

SASKiwi
PROC Star

You are trying to run a SAS batch tool as SAS code - it isn't going to work as it designed to be run from an operating system command line:

http://documentation.sas.com/?docsetId=bisecag&docsetTarget=n0bx2mb5l3iosan15odm1wfpo8bn.htm&docsetV...

 

The best way to avoid table locks is to run all of your batch jobs in a production environment where users have read-only access (set up using OS permissions) and this is best done using server-based scheduling.

SASKiwi
PROC Star

@Kurt_Bremser - agreed VIEWTABLE locks datasets regardless of OS permissions.

Kurt_Bremser
Super User

You're thinking much too complicated here. If you have a UNIX server, it is extremely easy to get around locked SAS datasets by removing them first from the filesystem before you write them.

 

Alternatively, set up a time window where all services that could lock datasets (mainly the workspace servers) are stopped, and run your batch processing in that time window.

 

Denying access to a user will not have ANY effect on a SAS session that was started before that. Open files will stay open until they are closed from within the session or the session is terminated.

roth1
Calcite | Level 5

Hi, my system currently uses scripts to run our batch jobs for EG. However we occasionally encounter table locks due to users accessing the tables therefore resulting in batch job failure. During the re-run of batch job from previous point of failure, we will then use SAS Management console to personally deny user access to the respective tables. We are currently working on the codes to be keyed in SAS EG to grant and deny access for our users through the sas scripts but we are encountering error. Can someone please assist me on how to get it started? 

 

Keyed in this line of code in SAS EG

 

sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;

 

Error I got from this line of code is

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

When I keyed in proc sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;

 

Error I got from this line of code is

ERROR 22-322: Syntax error, expecting one of the following: ;. AUDIT, CC, CLEANUP.

ERROR 76 -322: Syntax error, statement will be ignored.

 

Thank You.

andreas_lds
Jade | Level 19

Why do you repeat your post?

  1. There is no "proc sas-show-metadata-access" - getting an error when trying to execute a non-existing procedure is somehow expectable.
  2. "sas-show-metadata-access" is an executable and part of the SASPlattformObjectFramework, located on the server, depending on you setup, you don't even have it installed on the server hosting the Workspace Server. So maybe you won't be able to execute that executable even if xcmd is turned on.
  3.  @Kurt_Bremser already said: you won't be able to avoid locking of dataset by temporary revoking read-permission.

 


@roth1 wrote:

Hi, my system currently uses scripts to run our batch jobs for EG. However we occasionally encounter table locks due to users accessing the tables therefore resulting in batch job failure. During the re-run of batch job from previous point of failure, we will then use SAS Management console to personally deny user access to the respective tables. We are currently working on the codes to be keyed in SAS EG to grant and deny access for our users through the sas scripts but we are encountering error. Can someone please assist me on how to get it started? 

 

Keyed in this line of code in SAS EG

 

sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;

 

Error I got from this line of code is

ERROR 180-322: Statement is not valid or it is used out of proper order.

 

When I keyed in proc sas-show-metadata-access -profile Admin /DemoBranch/DemoFolder;

 

Error I got from this line of code is

ERROR 22-322: Syntax error, expecting one of the following: ;. AUDIT, CC, CLEANUP.

ERROR 76 -322: Syntax error, statement will be ignored.

 

Thank You.


 

Kurt_Bremser
Super User

These were originally two separate threads before I merged them. Seems to be an erroneous double-post.

 

PS just happened to me. I hit the "post" button a second time before the "posting success" page started to load.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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