Hi,
I need to serialize update access to a SAS dataset across a series of concurrent jobs. Each one only requires exclusive access for a few seconds but Murphy arranged for two to need it at the same time this morning. One failed.
I thought the lock statement might work but there isn't a wait option for it. So I hoped there was a lock function but couldn't find one. That would be handy in a data step.
So how has this been done in the past?
Thanks!
--Ben
You can code a loop for the LOCK statement that continues with WAITing steps in between until it gets a zero return code in macro variable SYSLCKRC.
You can code a loop for the LOCK statement that continues with WAITing steps in between until it gets a zero return code in macro variable SYSLCKRC.
Thanks, Kurt. That could work. Will work out the details. If push comes to shove I can always use a semaphore file. Was just trying to avoid that.
--Ben
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
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.
Ready to level-up your skills? Choose your own adventure.