IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

Error calling batch script

  • 1.  Error calling batch script

    Posted 07/01/14 08:02 AM

    Originally posted by: jvanboga


    Windows XP and WinSvr 2012...

    I am converting a map from 8.1 to 8.4 that executes batch files that calls an SQLLDR scripts.  In 8.1 it works without issue, 8.4 is failing.  Here is the simplified rule...

      VALID(GET("BAT","-CMD c:\path\header.bat  -trace -audit"), FAIL("HEADER: " + LASTERRORMSG()))

    This is the cmd line in the batch file.....

      sqlldr id/pw@sid  control=header.ctl log=c:\path\header_db_load.log bad=c:\path\header_db_load.bad

    The log file indicates one row was inserted to the table...

      Table FND_MAPTOOL_HEADER:
        1 Row successfully loaded.
        0 Rows not loaded due to data errors.
        0 Rows not loaded because all WHEN clauses were failed.
        0 Rows not loaded because all fields were null.
      Space allocated for bind array:                 255420 bytes(18 rows)
      Read   buffer bytes: 1048576
      Total logical records skipped:          0
      Total logical records read:             1
      Total logical records rejected:         0
      Total logical records discarded:        0

     

    I confirmed the row was inserted but the map fails with the following issue in the m4batch.mtr file...

      Executing Command: c:\path\HEADER.BAT
      Window Style is SW_HIDE (0).
      Getting standard input handle.
      Standard input handle is 00000000.
      Process 4384 Created.
      Reading from Standard Error...
      stdin reading is being processed by thread 5128.
      ...0 bytes read from Standard Error.
      PeekNamedPipe : When Reading From Stderr returned 6 - The handle is invalid.

      Peeking/Reading from Standard Error failed (err code = 6)...
      Error Executing Command - Return Code is 6.
      Run Terminated at time_stamp....

     Any idea why I'm getting the error?


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


  • 2.  Re: Error calling batch script

    Posted 07/02/14 03:30 AM

    Originally posted by: paul.brett


    There are a couple of things you could try here:

     

    1.  Add a couple of echo statements into your batch, so that something is returned to your map.  Something like 'echo Starting load...' before your current line, and 'Load complete...' after your current line.

    2.  Add a pause command at the very end of the script.  Usually, 'pause 1' is sufficient to work around these timing issues.

    Let us know if either one of these or a combination of both works for you.

    Thanks

    Paul

    Follow me on Twitter


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


  • 3.  Re: Error calling batch script

    Posted 07/02/14 09:09 AM

    Originally posted by: jvanboga


    'pause n' doesn't work....  changed the batch file script to:

    @echo off
    echo start loading
    sqlldr id/pw@sid  control=header.ctl log=c:\path\header_db_load.log bad=c:\path\header_db_load.bad
    pause 15
    echo load complete


    Didn't pause either.  Seems less specific to DOS and more specific to the 8.4

     

     


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


  • 4.  Re: Error calling batch script

    Posted 07/02/14 09:19 AM

    Originally posted by: jvanboga


    FYI:

    BEGIN BATCH AUDIT - VERSION 8.4.1(37) [1.1.5]
     


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


  • 5.  Re: Error calling batch script

    Posted 07/02/14 09:27 AM

    Originally posted by: paul.brett


    My mistake, it should be 'sleep 15' not 'pause 15'

    Thanks

    Paul

    Follow me on Twitter


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


  • 6.  Re: Error calling batch script

    Posted 07/02/14 09:53 AM

    Originally posted by: jvanboga


     PID    rc   Size   Time  Retry
    -----  ----  -----  ----  -----
    7688     6   000    001     1 

    Error Messages (96 bytes):
    'sleep' is not recognized as an internal or external command,
    operable program or batch file.


    END BATCH AUDIT
     


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


  • 7.  Re: Error calling batch script

    Posted 07/02/14 10:20 AM

    Originally posted by: Tim Rabbitt


    Hello:

    You can also try the TIMEOUT command.  This will work with Windows 2012 but it may not work with XP.

    http://serverfault.com/questions/432322/how-to-sleep-in-a-batch-file

    Sleep will work as Paul suggested if you've downloaded it

    Regards,

    Tim Rabbitt


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


  • 8.  Re: Error calling batch script

    Posted 07/02/14 02:06 PM

    Originally posted by: jvanboga


    Downloaded sleep.exe and the script did sleep for the set time.  The map still failed.  Same reason.


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


  • 9.  Re: Error calling batch script

    Posted 07/02/14 10:23 AM

    Originally posted by: jvanboga


    PS: I also tried running the example that installed with 8.4.1.  Created the table using the script and it failed for the same reason....  Our oracle client is 11.

    path\examples\adapters\oracle\bulkcopy\oracle9


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


  • 10.  Re: Error calling batch script

    Posted 07/02/14 11:26 AM

    Originally posted by: paul.brett


    Does the script run outside of WTX ?

    Thanks

    Paul

    Follow me on Twitter


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


  • 11.  Re: Error calling batch script

    Posted 07/02/14 02:10 PM

    Originally posted by: jvanboga


    Yes, If I run the script from my machine from a DOS prompt it works.  It also works when executing it with WTX8.1. 

    I also tried using the 8.1 m4batch.dll.  That didn't help.   Reverted to the 8.4 dll. 


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


  • 12.  Re: Error calling batch script

    Posted 07/03/14 11:30 AM

    Originally posted by: paul.brett


    Please change:

    sqlldr id/pw@sid  control=header.ctl log=c:\path\header_db_load.log bad=c:\path\header_db_load.bad

    to

    start sqlldr id/pw@sid  control=header.ctl log=c:\path\header_db_load.log bad=c:\path\header_db_load.bad

    ...and retry.  If that doesn't work, I think you'll have to open a Service Request (PMR) with IBM WTX Client Support.

    Thanks.

    Paul

    Follow me on Twitter


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


  • 13.  Re: Error calling batch script

    Posted 07/07/14 09:56 AM
      |   view attached

    Originally posted by: jvanboga


    Looks like its less about the sqlldr command and more about the batch file execution.  I created a quick, dumb, map that executes a batch file deleting a text file.  Produces same results.  Batch file executed successfully, bad return code.  Here's a copy of the mapset (as you'll see I tried several options)...
     


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

    Attachment(s)

    zip
    junk1.zip   6 KB 1 version


  • 14.  Re: Error calling batch script

    Posted 07/30/14 07:37 AM

    Originally posted by: paul.brett


    I successfully used this testcase, with a slight modification to the batch file:

    del delete_this_file_1.txt

    to

    @del delete_this_file_1.txt
    @echo Done!
     

    ....as the batch file *MUST* provide some output on stdout.

    Let me know if you get a different result.

    Thanks

    Paul

    Follow me on Twitter


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


  • 15.  Re: Error calling batch script

    Posted 08/14/14 04:22 PM

    Originally posted by: jvanboga


    FYI - Resolved.  We built another W2012 server and were able to successfully run the maps executing the batch files via our scheduler.  We'll be rebuilding our other, related, servers over the next few days.

     

    Thanks for the help.


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