How can i call two subroutine functions after job finishes.

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
venugopal81
Participant
Posts: 49
Joined: Sat Mar 26, 2005 12:19 am

How can i call two subroutine functions after job finishes.

Post by venugopal81 »

Hi All,

Here is my requirement.

I need to call shell script and email notification from after job subroutine.
i.e ExecSH and DSSendMail funtions. Please suggest.

Thanks&regards
venu
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Write one routine which calls the other 2.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or build a Sequencer job.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rsaliah
Participant
Posts: 65
Joined: Thu Feb 27, 2003 8:59 am

Post by rsaliah »

Here's a little routine that I use, routine name is RunMutlipleRoutines.

Code: Select all

      #Include DSINCLUDE JOBCONTROL.H

      ErrorCode = 0                      ; * set this to non-zero to stop the stage/job
      RDel = "+"
      ADel = " "

      ProgList = CONVERT(RDel,@FM,InputArg)

      ProgCount = DCOUNT(ProgList,@FM)
      FOR i = 1 To ProgCount UNTIL ErrorCode
         ProgData = ProgList<i>
         ProgName = 'DSU.':TRIM(FIELD(ProgData,ADel,1))
         ProgArg = TRIM(FIELD(ProgData,ADel,2,9999))
         CALL @ProgName(ProgArg,ErrorCode)
      NEXT i

      IF Not(ErrorCode) THEN RETURN

      CALL DSLogWarn('Error code ':ErrorCode:' returned from Routine call to ':ProgName,'RunBeforeJobRoutines')
Feel free to change if required, but basically the routines being run should be delimited by '+' and any input arguments should be delimited by ' ' (space).

e.g. RunMutlipleRoutines(myRoutine1 InputArg+myRoutine2 InputArg)
srinagesh
Participant
Posts: 125
Joined: Mon Jul 25, 2005 7:03 am

Post by srinagesh »

:-) Its very useful for me too...

Thanx
Nagesh
Post Reply