BookmarkSubscribeRSS Feed
ucvikas
Obsidian | Level 7

Hi SAS Coder,

Scenario of problem - I have one macro say %callme . this macro is called in one sas code say useme.sas . Now I have many SAS jobs which executes useme.sas code based on some parameters. so at a given time many SAS jobs execute useme.sas which inturn has many calls for macro %callme;

macro callme logs some details to one SAS dataset (logging.sas7bdat)like username, time of call etc...  now when many sas jobs execute and call macro CALLME ; then sometimes I get this error "ERROR: The open failed because library member Library.LOGGING.DATA is damaged." . Although I have filelocks option in my SAS code I still get this error.

Strange thing is that dataset LOGGINGis not damaged and I can open it easily; there is no space issues. and once I rerun my code one by one problem does  not appear.

only when there is simultaneous update to dataset LOGGING I get this problem (this is my observation , there could be any other thing which caused this.)

Can any one help me in solving this or point to the cause??

3 REPLIES 3
LinusH
Tourmaline | Level 20

I assume from your description that the macro writes this information to common table (Logging.Data is the same for all calling SAS programs).

I'm not sure about this specific error, but the single user Base SAS engine does not  handle concurrent read/write requests on a record level. To make your writes/updates consistent you need any the following:

  • SAS/SHARE
  • SAS SPD Server
  • External RDBMS
Data never sleeps
ucvikas
Obsidian | Level 7

Hi LinusH

LinusH
Tourmaline | Level 20

Base is per default a single user engine, but it allows for simultaneous read operations. But as soon there is any kind of write/delete/update operation, the whole table is locked for other users, or if there is already a read lock, the update operation will fail.

If %callme is the only client you may add some lock checking within that macro, if not the requires lock is available then insert a wait, and try again. Quite manual, but can work for some applications.

Data never sleeps

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!

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
  • 3 replies
  • 8241 views
  • 0 likes
  • 2 in conversation