Used to identify job as batch or interactive.
This way you can use the same program with display to submit
itsself to batch with parms supplied by the screen.
This way you can use the same program with display to submit
itsself to batch with parms supplied by the screen.
PHP Code:
~
*
*--------------------------------------------------------
fSOMEDSP cf e workstn
*
* Variable Definition
*
d Format s 8
d RcvVarLen s 10i 0
d dsJobDta ds
d dsJobBytesRtn 10I 0
d dsJobBytesAvl 10I 0
d dsJobName 10A
d dsJobUser 10A
d dsJobNumber 6A
d dsJobIntern 16A
d dsJobStatus 10A
d dsJobType 1A
d dsJobSubtype 1A
d dsJobReserv1 2A
d dsJobRunPty 10I 0
d dsJobTimeSlc 10I 0
d dsJobDftWait 10I 0
d dsJobPurge 10A
//
// external calls
//
d $jobinfo pr extpgm('QUSRJOBI')
d DsJob like(DsJobDta)
d Length 10i 0 const
d APIFormat 8 const
d ApiJob 26 const
d InternJob 16 const
/Free
//--------------------------------------------------------
// MAIN PROGRAM
//--------------------------------------------------------
exsr Hskpg;
*inlr = *on;
//--------------------------------------------------------
// Hskpg - one time run subroutine
//--------------------------------------------------------
begsr Hskpg;
// determine if this job is interactive or batch
RcvVarLen = %Size(DsJobDta);
Format = 'JOBI0100';
$jobinfo(dsjobdta : rcvvarlen : Format : '*' : ' ');
if DSJOBTYPE = 'I';
if not%open(SOMEDSP);
open SOMEDSP;
endif;
else;
// do batch stuff
endif;
endsr;
/End-Free