hi all,
i have a web using cgidev2. i want to show wrkactjob to the web.
so my way is call a program then a program will save wrkactjob to a file
then the web read from that file to display wrkactjob
this is my code. this code i've copy from jamief code
and i've a problem.
this is my code :
this my job log :
until now i don't know why spool file is not found.
if run this program interactively ex. CALL ACTJOB0R PARM('DATAW_SBS' 'N') this program work perfectly
but if i call from the web cgidev2 this is always says "File ACTJOB not found in job 009794/QTMHHTTP/DATAWEB"
please help me
what wrong with my code ???
thx u all
i have a web using cgidev2. i want to show wrkactjob to the web.
so my way is call a program then a program will save wrkactjob to a file
then the web read from that file to display wrkactjob
this is my code. this code i've copy from jamief code
and i've a problem.
this is my code :
PHP Code:
* CLOSE the physical file
*
c if %open(TEMP)
c close TEMP
c endif
c eval jobnbrt = %char(@jobnumber)
c select
c when %len(%trim(jobnbrt)) = 1
c eval jobnbrt = '00000' + jobnbrt
c when %len(%trim(jobnbrt)) = 2
c eval jobnbrt = '0000' + jobnbrt
c when %len(%trim(jobnbrt)) = 3
c eval jobnbrt = '000' + jobnbrt
c when %len(%trim(jobnbrt)) = 4
c eval jobnbrt = '00' + jobnbrt
c when %len(%trim(jobnbrt)) = 5
c eval jobnbrt = '0' + jobnbrt
c endsl
* Hold the wrkactjob spooled file so we can read it.
* OVRPRTF FILE(QPDSPAJB) HOLD(*YES)
c eval cmdstring = 'OVRPRTF FILE(QPDSPAJB) ' +
c %trim('HOLD(*YES) SPLFNAME(ACTJOB) ') +
c ' SECURE(*YES) '
c eval cmdlength = %len(%trim(cmdstring))
c call(e) 'QCMDEXC'
c parm CmdString
c parm CmdLength
c if %error
c eval #FLg = 'Y'
c endif
* until this step Qcmdexec didnot return error (@msgid is blanks)
* Now print WRKACTJOB
* WRKACTJOB SBS(DATAW_SBS) OUTPUT(*PRINT) SEQ(*STS)
c eval cmdstring = 'WRKACTJOB SBS(DATAW_SBS) '+
c 'OUTPUT(*PRINT) ' +
c 'SEQ(*STS)'
c eval cmdlength = %len(%trim(cmdstring))
c call(e) 'QCMDEXC'
c parm CmdString
c parm CmdLength
c if %error
c eval #FLg = 'Y'
c endif
* until this step Qcmdexec didnot return error (@msgid is blanks)
* check file TEMP at library QTEMP
* CHKOBJ OBJ(QTEMP/TEMP) OBJTYPE(*FILE)
c eval cmdstring = 'CHKOBJ OBJ(QTEMP/TEMP' +
c %trim(') OBJTYPE(*FILE) ')
c eval cmdlength = %len(%trim(cmdstring))
c call(e) 'QCMDEXC'
c parm CmdString
c parm CmdLength
c if %error
c eval #FLg = 'Y'
c select
c when @MsgId = 'CPF9801'
*create file QTEMP/TEMP
c eval cmdstring = 'CRTPF FILE(QTEMP/TEMP' +
c %trim(') RCDLEN(198)')
c eval cmdlength = %len(%trim(cmdstring))
c call(e) 'QCMDEXC'
c parm CmdString
c parm CmdLength
c endsl
* until this step Qcmdexec return @msgid = 'CPF9801'
c Endif
* Copy the spooled file into out physical so we can read it
* CPYSPLF FILE(QPDSPAJB) TOFILE(QTEMP/TEMP) SPLNBR(*LAST)
c eval cmdstring = 'CPYSPLF FILE(ACTJOB) ' +
c %trim(' TOFILE(QTEMP/') +
c 'TEMP) JOB('+jobnbrt+
c '/'+%trim(@userid)+'/'+
c %trim(@JobName) +') '+
c %trim('SPLNBR(*LAST)')
* i added JOB(jobnbrt/@userid/@jobname) option at CPYSPLF but this is error too
c eval cmdlength = %len(%trim(cmdstring))
c call(e) 'QCMDEXC'
c parm CmdString
c parm CmdLength
c if %Error
c eval #FLg = 'Y'
c endif
* until this step Qcmdexec return @msgid = 'CPF3303' (spool file not found)
* OPEN the physical file
c if not%open(TEMP)
c open TEMP
c endif
Code:
Printer device PRT01 not found. Output queue changed to QPRINT in library QGPL. Object TEMP in library QTEMP not found. File TEMP created in library QTEMP. Member TEMP added to file TEMP in QTEMP. File ACTJOB not found in job 009794/QTMHHTTP/DATAWEB.
if run this program interactively ex. CALL ACTJOB0R PARM('DATAW_SBS' 'N') this program work perfectly
but if i call from the web cgidev2 this is always says "File ACTJOB not found in job 009794/QTMHHTTP/DATAWEB"
please help me
what wrong with my code ???
thx u all
Comment