how call an .exe cobol from datastage? (or other e

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Yes it is.
But it is a little bit easiar to call a programm out of a routine.

Where are you on? NT or Unix.

Wolfgang
i want to call a cobol(or a c) function from datastage in order to
use the result of this function
is it possible?

thanks

vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You can call an external application from any part of DataStage that supports DataStage Basic using the DSExecute command. DSExecute has a "shelltype" parameter which is set to "Unix" for Unix commands residing on the DataStage server or "NT" for an NT server.

The command can be called from Job Control code in a Batch job or Sequence job however it can be easier to write your own execute Routine, as jmvtcf suggests, which contains the DSExecute command wrapped around validation and error handling. I have one which has the first argument containing the application name and the second argument containing any number of space seperated command line arguments that are passed to the application.

The DSExecute receives a return code that indicates whether it was able to execute the application and an output that can include values passed back to DataStage by the application.

You can also call up external components such as a cobol application from within a Job transform where the application is run for every row in a job and returns one or more destination fields. Usually these transforms will run slower as it is more efficient to use DS basic.
Post Reply