DATA Step, Macro, Functions and more

parallel programming

Reply
Contributor
Posts: 25

parallel programming

Hello

I have the following question

Usually, when I want to do several threads at the same time and then after doing them, start a thread that uses the results of previous threads, I use the following solution

systask command "START ""Batch"" /wait /min
    ""C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe"" -batch -nosplash
    -sysin ""&CodePatch.__TrRt_&NrFL._&Period._1_1_.sas"" -log ""&CodePatch"""
    taskname=job2_for_data;

systask command "START ""Batch"" /wait /min
    ""C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe"" -batch -nosplash
    -sysin ""&CodePatch.__TrRt_&NrFL._&Period._1_2_.sas"" -log ""&CodePatch"""
    taskname=job3_for_data;

waitfor _all_   job2_for_data job3_for_data;



systask command "START /realtime ""Batch""
    ""C:\Program Files\SAS\SASFoundation\9.2(32-bit)\sas.exe"" -batch -nosplash 
    -sysin ""&CodePatch.__TrRt_&NrFL._&Period._1_0_DL.sas"" -log ""&CodePatch""";

Currently, threads run another application at different intervals and after completing them I would like to automatically analyze the results and make a report. Has the community developed any solutions for this occasion?

 

PROC Star
Posts: 2,360

Re: parallel programming

Maybe did you not get a response because other people, like me, do not quite understand what you are after?

In what way is what you are doing now not sufficient?

Contributor
Posts: 25

Re: parallel programming

The first situation well known even to beginners in parallel programming.

All tasks (task_1 to task_7) start at the same time and after the last one (task_8), eg reporting starts.

Here I know the solution to the problem.

 

parallel programming first situation.jpg

 

Second situation:

Tasks (task_1 to task_7) start at different times, independently and after the last one (task_8) the reporting begins

Here I do not know the solution to the problem

 

parallel programming Second situation.jpg

PROC Star
Posts: 2,360

Re: parallel programming

If the tasks are independent the common and reliable (if archaic) method is to use trigger files. When all trigger files are there the final process can start.
Contributor
Posts: 25

Re: parallel programming

maybe an example?!

So far I have used the %sysfunc(exist(&file)) function but sometimes I had a problem with
ERROR: A lock is not available for... Smiley Happy
I thought maybe there is a more elegant solution
PROC Star
Posts: 2,360

Re: parallel programming

Well you need to set a trigger somewhere.

You could check for the existence of a sas data set or an environment variable, but usually an empty text file is created in a trigger directory.

This allows cross-system checks, and is easy to monitor.

if fileexist()  is what your last process tests.

Ask a Question
Discussion stats
  • 5 replies
  • 133 views
  • 0 likes
  • 2 in conversation