I'm trying to test RTM and I need to be able to submit a job that will run for say 5 or 10 minutes so I can see how RTM is functioning while a job is running. Does anyone know of some generic SAS code/program that can be adjusted to run for a specific number of minutes? The option to stress the CPU and memory of the servers would be a huge plus.
Thanks,
Dan
Well, there is the sleep() function:
https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm
Alternatively you could set a series of datasteps upd with do loops for specified number of loops. However most of base SAS is based on CPU/memory, so changing that will change the run time. But timing is provided, so you can see that datastep x takes y seconds in this run, and z in that run and see the difference between.
Well, there is the sleep() function:
https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001418809.htm
Alternatively you could set a series of datasteps upd with do loops for specified number of loops. However most of base SAS is based on CPU/memory, so changing that will change the run time. But timing is provided, so you can see that datastep x takes y seconds in this run, and z in that run and see the difference between.
Submit this code. It will run for a while and rev up the CPU! Adjust the loop iteration counts to adjust the run time.
data _null_;
do i=1 to 1000000000;
do j=1 to 1000000000;
k=i*j;
l=mod(k,2499900001);
end;
end;
run;
Despite reducing the numbers by several digits, this loop ran for 6+ hours and the CPU never spiked.
While the looping code might accomplish the execution time, it might be worthwhile to note that @RW9's sleep() function might be more code efficient and CPU efficient.
Data _null_;
Endtime=time()+10*60 /* 10 MIN - change for needed duration */ ;
Do while(time() le Endtime);
/* BESPOKE CODE TO CREATE STRESS */
End;
Run;
There will be some cpu overhead in this job due to calling the time function several times.
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.