IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
 View Only
  • 1.  Pass arguments to batch file

    Posted Wed October 29, 2014 12:01 PM

    Originally posted by: Bragger


    Hi,

    I am calling a batch file from WTX 8.4 map and need to pass a command line argument to this .bat file. I am trying below code but its not working:

    =PUT("BAT","-CMD demo.bat -I -T", InputFile)

    This demo.bat consist of below command:

    copy %1 output.txt


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


  • 2.  Re: Pass arguments to batch file

    Posted Wed October 29, 2014 01:09 PM

    Originally posted by: Tim Rabbitt


    Hello:

    Can you try:  =GET("BAT","demo.bat  output1.txt -T")

    Using your demo.bat content, this will copy output1.txt to output.txt

    or if you want to make the input more dynamic with regards to the file being copied try:

    =GET("BAT","demo.bat " + InputFile + " -T")

    Where InputFile is obtained from an input card.

    Regards,

    Tim Rabbitt


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


  • 3.  Re: Pass arguments to batch file

    Posted Wed October 29, 2014 01:33 PM

    Originally posted by: Bragger


    Thanks Tim! Unfortunately both the options are not working :(. I even changed the .bat file to check if it is receiving the argument passed in wtx map as below:

    set a=%1
    echo %a%

    But in log file this is displayed:

    set a=

    echo

    ECHO is on.


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


  • 4.  Re: Pass arguments to batch file

    Posted Wed October 29, 2014 01:47 PM

    Originally posted by: Tim Rabbitt


    Hello:

    When you ran your map, what did the trace file content say for the Executing Command entry?  When I run my map, it says:

    Executing Command: "C:\testmaps\batchadapter\EvalMathematicalExpression\demo.bat" output1.txt

    This was from a map rule of: =GET("BAT","demo.bat " + InputFile + " -T")

    The InputFile content that I have contains output1.txt and you can see it was correctly substituted. 

    Regards,

    Tim Rabbitt


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


  • 5.  Re: Pass arguments to batch file

    Posted Thu October 30, 2014 08:30 AM

    Originally posted by: Bragger


    Thank you so much Tim! I messed the Input file content and that's why it was not working. Your solution is working perfectly fine! Thanks once again...


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