Search code examples
etldatastage

Datastage PX Sequence : Routine Activity - Exec SH Output


I'm new to datastage PX and I don't understand how routine activity works in a sequence.

I'm calling "execSH" routine inside a routine activity, command result is correctly logged but I don't know how to use it as an input of the next step (a loop).

I tried "returnValue" output variable but it is related to unix return value whereas I'm interested in standard output data.

According to the developper documentation & help, both return value and standard output are returned from execSH routine.

I also tried :

  • calling execSH inside a custom transform routine, without success (I have poor Basic knowledge... )
  • using activity variable, but it seems we cannot get anything other than return value.

Thanks for reading & helping


Solution

  • Emilie,

    Apologies if I've gotten confused on your requirement

    In your routine activity you need to define another input and call it something like

    aoValue
    

    Then within the routine define it as

    aoValue=''
    

    Then take the output of the executed sh and set aoValue equal to that value.

    Subsequently add an if then else statement to validate the output from the sh is what you were expecting and if it is valid set

    Return=0
    

    This way you have 2 outputs, one for when the routine executes correctly (Return) and one for the output of the sh routine (aoValue)

    On the input to the routine activity on your job sequence again define aoValue as '' but on successful completion of the activity you will have the output from the sh.

    Hope this helps give you some ideas in resolving your issue