Invoke a Script from an IBM i Batch Job

Invoke a Script from an IBM i Batch Job

To invoke a script included as an inline file in a database job, the call must specify *FIRST as the database member name.

The following example illustrates both:

  • Invocation of an inline script, CALLME, using the STRUDM command from a database job.
  • Invocation of an inline script, CALL1, using the CALL command from a database job.

LIB file system

//BCHJOB JOB(testcall) ENDSEV(10) OUTQ(mytest/UDMOUTQ) LOGCLPGM(*YES) LOG(2 20 \*SECLVL) MSGQ(*USRPRF)
//DATA FILE(CALL1) ENDCHAR(ENDDATAFILE)
print msg="I made it to call1 - an inline file"
ENDDATAFILE
//DATA FILE(CALLME) ENDCHAR(ENDDATAFILE)
OPEN S=AS400V5 USER=qatest PWD=****\* PORT=4311
CALL CALL1(*FIRST)
CLOSE
ENDDATAFILE
STRUDM SCRFILE(CALLME)
//ENDBCHJOB

Components

Universal Data Mover Manager for IBM i