IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Convert RUN function to call Shell Script Adapter

    Posted 02/29/12 02:44 PM

    Originally posted by: rarw


    Hi,

    With WTx 8.3 on Linux, and without purchasing any new products, we must quickly convert from using the FTP adapter to instead call a script that will move a file via sftp.

    Currently we call the RUN function and the FTP adapter (OAFTP1PB). Is it possible to change our usage of the RUN function to call a script instead? Or, do we need to use some other method?

    The current code is shown below, along with my attempt which does not work. I have been researching to find the correct syntax but have not gotten anywhere.

    Current:
    =VALID(RUN("MLMF_4136_PROC_B.mmc",
    " -OAFTP1PB '-T %LOGGING%MAP_4136_OUT_3824.mtr %FTP_LOGIN_MLMF_OFM%%MLMF_OFFICEMAX%;type=ASCII'"),
    FAIL ("Failure on RUN (" + TEXT (LASTERRORCODE ( ) ) + "):" + LASTERRORMSG ( ) ) )
    New FAILS:
    =VALID(RUN("MLMF_4136_PROC_B.mmc"," -OASHL1 -cli /bin/ksh -cmd '/tmp/wtx_script_test.ksh'"),
    FAIL ("Failure on RUN (" + TEXT (LASTERRORCODE ( ) ) + "):" + LASTERRORMSG ( ) ) )


    <ExecutionSummary MapStatus="Error" mapreturn="30" ElapsedSec="0.349" BurstRestartCount="0">
    <Message>FAIL function aborted map:Failure on RUN (56):Invalid command line option - </Message>


    thanks
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Convert RUN function to call Shell Script Adapter

    Posted 03/01/12 08:38 AM

    Originally posted by: ChB


    Hello rarw,

    I guess the problem is the quotes. I don't have an example, but please try something like:

    RUN("MLMF_4136_PROC_B.mmc"," -OASHL1 '-cli /bin/ksh -cmd /tmp/wtx_script_test.ksh ' ")

    or other options with quotes, double quotes and so on.

    I hope it helps

    Chris
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 3.  Re: Convert RUN function to call Shell Script Adapter

    Posted 03/05/12 10:15 AM

    Originally posted by: rarw


    Thank Chris.

    I worked with IBM, this is an example of code that works (note: two single quotes are used around the mv command).

    =VALID(RUN("a.mmc"," -OASHL1 '-cli /bin/ksh -cmd ''mv a.txt c.txt'' -TV'"),
    FAIL ("Failure on RUN (" + TEXT (LASTERRORCODE ( ) ) + "):" +
    LASTERRORMSG ( ) ) )
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender