write a shell script to call a job in SAS DI

Reply
Occasional Contributor
Posts: 10

write a shell script to call a job in SAS DI

HI,

I am totally unaware of using shell scripting in user written code in SAS DI.

Can anyone tell me how to write shell script in 1st job in order to call 2nd  job in SAS data integration instead of using conditional transformations.

I need to call the 2nd job depending on a condition: Example: If variable1 > 100 then "Call The 2nd job" else "End the current job execution."

I guess I would need to use SYSTASK for this purpose like: If variable1 > 100 then SYSTASK COMMAND "<PUT HERE THE SHELL COMMAND TO EXECUTE THE SECOND JOB>" NOWAIT;

I have never used SYSTASK. Can anyone please help me with this..

Thanks!

Dipti

Super User
Posts: 5,382

Re: write a shell script to call a job in SAS DI

Why do wish to this in a shell script?

And what do you mean by variable1? Is it an environment variable?

It seems tat this is a strictly OS related question, not a SAS specific one - please use an appropriate forum.

Data never sleeps
Occasional Contributor
Posts: 10

Re: write a shell script to call a job in SAS DI

I want to call another job from the current job using SYSTASK function in SAS DI.

Respected Advisor
Posts: 4,131

Re: write a shell script to call a job in SAS DI

Before using some user written code you should try and do it with standard functionality. As mentions one way would be on the level of scheduling.

Implemented as a DI job it's about conditional processing. With newer DI version you would get special transformations for this.

Capture.PNG

If you're not on a sufficiently new DI version then you could easily do it with a loop job. The Loop transformation will call the inner job "some job" as many times as there are records in the loop control table.

Capture.PNG

"If variable1 > 100" then populate the control table with a single row, else pass in an empty table into the Loop transformation (and the inner job won't get executed).

The inner job "some job" doesn't need any parameters and you also don't need to defined such parameters in the Loop node.

Valued Guide
Posts: 3,208

Re: write a shell script to call a job in SAS DI

Why using systask in DI? DI is designed to process flows with jobs using some scheduling mechanism.
Why going to break that idea and doing something on your own.
Explain your question on the logical parts not your technical implementation but the idea why you want to do this. 

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 4 replies
  • 317 views
  • 2 likes
  • 4 in conversation