SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
makset
Obsidian | Level 7

Hi everyone.

So far, I have used the following code to organize my access to files (one process blocked access to files, and another process where access was blocked tried to access the file in a loop).

%macro trylock(datasetIn =, timeout = 10, sleep = 1);
		%local starttime;       
		%let starttime = %sysfunc(datetime());       
		%do %until(&syslckrc <= 0           
			or %sysevalf(%sysfunc(datetime()) > (&starttime + &timeout)));          
		%put trying open ...;          
			data _null_;             
			dsid = 0;             
			do until (dsid > 0 or datetime() > (&starttime + &timeout));                
			dsid = open("&datasetIn");                
			if (dsid = 0) then rc = sleep(&sleep);             
			end;             
			if (dsid > 0) then rc = close(dsid);          
			run;          
		%put trying lock ...;          
	lock &datasetIn;          
		%put syslckrc = &syslckrc;       
		%end;    
%mend trylock; 

Due to the large amount of data I had to buy another hard drive (WD4003FFBX) and you know what it is like with ordinary hdd disks, if several processes try to download data from one disk at the same time, the performance drops drastically.

Is there any procedure that would block access to the entire disk for only one process ??

 

Thank you in advance for your help.

Best wishes.

2 REPLIES 2
makset
Obsidian | Level 7

@Kurt_Bremser wrote:
  • replace spinning metal with state of the art (SSD)

🙂


@Kurt_Bremser wrote:
  • organize your processes, so they run in sequence

It would cost me too much work and the effect would be unsatisfactory.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 690 views
  • 0 likes
  • 2 in conversation