To the OP and to All, if you really want to learn how to use these, and
many other API's, Bruce Vining's book, APIs At Work, is an invaluable
resource.
It's an easy read and it's very handy just to keep close by your desk for
times just like this.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Bruce Vining
Sent: Wednesday, January 16, 2013 7:56 AM
To: Midrange Systems Technical Discussion
Subject: Re: Program using API QUSLJOB
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) +
Value('MYSPACE QTEMP')
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))
EndDo
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)
EndDo
Else Cmd( +
SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) +
MsgDta('Failure accessing list') +
ToPgmQ(*Prv) MsgType(*Escape))
EndPgm
Create with CRTBNDCL NBRJOBS and then
CALL NBRJOBS JobName
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
<vhamberg@xxxxxxxxxxxxxxx>wrote:
OOPS??? Answer without a question?
Couldn't resist, Pete!
Later
Vern
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
www.petesworkshop.com
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>
wrote:
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,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take
a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
Regards,
Bruce
www.brucevining.com
www.powercl.com
--
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,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.