One way (with just minimal -- and I mean minimal -- testing):

Pgm Parm(&JobName)
Dcl Var(&JobName) Type(*Char) Len(10)

Dcl Var(&SpcPtr) Type(*Ptr)
Dcl Var(&SpcName) Type(*Char) Len(20) +
Dcl Var(&SpcSize) Type(*Int) Value(4096)

Dcl Var(&Jobs) Type(*Char) Len(26) +
Value(' *ALL *ALL ')
Dcl Var(&NbrJobs) Type(*Char) Len(10)

Dcl Var(&SpcHdr) Type(*Char) Len(192) +
Stg(*Based) BasPtr(&SpcPtr)
Dcl Var(&SpcSts) Type(*Char) Len(1) +
Stg(*Defined) DefVar(&SpcHdr 104)
Dcl Var(&NbrEnt) Type(*Int) +
Stg(*Defined) DefVar(&SpcHdr 133)

Dcl Var(&ErrCde) Type(*Char) Len(256)
Dcl Var(&BytPrv) Type(*Int) +
Stg(*Defined) DefVar(&ErrCde)
Dcl Var(&BytAvl) Type(*Int) +
Stg(*Defined) DefVar(&ErrCde 5)
Dcl Var(&MsgID) Type(*Char) Len(7) +
Stg(*Defined) DefVar(&ErrCde 9)

ChgVar Var(&BytPrv) Value(256)
Call Pgm(QUSPTRUS) Parm(&SpcName &SpcPtr &ErrCde)
If Cond(&BytAvl *NE 0) Then(Do)
Call Pgm(QUSCRTUS) Parm(&SpcName ' ' &SpcSize +
' ' '*ALL' ' ' '*NO' &ErrCde)
If Cond(&BytAvl *NE 0) Then( +
SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) +
MsgDta('Failure creating space') +
ToPgmQ(*Prv) MsgType(*Escape))
Else Cmd( +
Call Pgm(QUSPTRUS) Parm(&SpcName &SpcPtr &ErrCde))

ChgVar Var(%sst(&Jobs 1 10)) Value(&JobName)
Call Pgm(QUSLJOB) Parm(&SpcName 'JOBL0100' +
&Jobs '*ACTIVE' &ErrCde)

If Cond(&BytAvl *NE 0) Then( +
SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) +
MsgDta('Failure creating list') +
ToPgmQ(*Prv) MsgType(*Escape))

If Cond((&SpcSts *EQ 'C') *or (&SpcSts = 'P')) Then(Do)
ChgVar Var(&NbrJobs) Value(&NbrEnt)
SndPgmMsg Msg(&NbrJobs *BCat 'are active') ToPgmQ(*Ext)
Else Cmd( +
SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) +
MsgDta('Failure accessing list') +
ToPgmQ(*Prv) MsgType(*Escape))


Create with CRTBNDCL NBRJOBS and then

For instance CALL NBRJOBS ABC msy show

0000000000 are active or 0000000003 are active based on how many jobs
are active with a job name of ABC.

Hope this helps,
Bruce Vining

On Tue, Jan 15, 2013 at 10:30 PM, Vernon Hamberg

OOPS??? Answer without a question?

Couldn't resist, Pete!


On 1/15/2013 8:57 PM, Pete Helgren wrote:
The clue was that no dates were displaying in the call window. Usually,
you can see a date range and a range of calling times displayed. It
took me a while to realize that that was what was missing....I should
really just state in that calling window that there is no calling
schedule found...

No worries. Happy to help out!

Pete Helgren
GIAC Secure Software Programmer-Java

On 1/15/2013 8:38 PM, Vinay Gavankar wrote:
Thanks Alan. That would be helpful.

On Tue, Jan 15, 2013 at 9:31 PM, Alan Campin <alan0307d@xxxxxxxxx>

I have a service program that I have sent out to other people which
wrappers the QUSLJOB api. I can send it to you if you want.

This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page