Here's how to have a second project kick off after the successful completion of the first project (2 separate SAS EG sessions).
1.At the end of project1, have it overwrite an existing dataset in a commonly accessible permanent folder.
data common.proj1ended; ended=datetime(); format endit b8601dt.; RUN;
2. At the beginning of project2, have it create a new temp dataset called 'start' to store the starting time of project2.
data work.start; start=datetime(); format start b8601dt.; RUN;
3. Then, in project2, read 'start' from work.start and check the modified date of 'proj1ended'
If the modified date of proj1ended is less than 'proj2start', wait 60 seconds and check again.
Have this program linked to the next program of your process flow so that once the modified date of proj1ended exceeds the starttime of project2, the rest of project2 will continue.
%macro loop; proc sql; select start format=b8601dt. into :proj2start trimmed from work.start; quit; %again: proc sql; select modate format=b8601dt. into :proj1ended trimmed from DICTIONARY.tables where libname='COMMON' and memname='PROJ1ENDED'; quit; %put &=proj2start &=proj1ended; %if &proj1ended > &proj2start %then %goto ready; /* CALL WAIT(60); sorry...didn't realize wait doesn't work! */
data _null_; rc=sleep(60,1); run;
%put &=proj2start &=proj1ended;
SAS is headed back to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team.
Interested in speaking? Content from our attendees is one of the reasons that makes SAS Innovate such a special event!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.