QSPRJOBQ

15 pts.
Tags:
JOBQ
I would like to use the QSPRJOBQ api to see if jobq QNIGHT is empty and on hold. Can I please see a CL example?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Answer courtesy of ToddN2000:

I know the post is old but I have a CL that will send an email
if there are more than 2 jobs in the JOBQ meaning a possible problem and to
send an email

 

           
PGM                                                      

            DCL       
VAR(&JOBQ) TYPE(*CHAR) LEN(10) VALUE(‘QBATCH2’)

           
DCL        VAR(&JOBQLIB) TYPE(*CHAR)
LEN(10) VALUE(‘QGPL’)

           
DCL        VAR(&QJOBQ) TYPE(*CHAR)
LEN(20)               

                                                                      

            DCL       
VAR(&RCVVAR) TYPE(*CHAR)
LEN(144)             

                                                                      

            DCL       
VAR(&BJOBS) TYPE(*CHAR)
LEN(4)                

            DCL       
VAR(&DJOBS) TYPE(*DEC) LEN(5 0)
VALUE(0)      

                                                                      

            CHGVAR    
VAR(&QJOBQ) VALUE(&JOBQ *CAT
&JOBQLIB)        

                                                                      

* call API to get JOBQ information
*/                                

                                                                      

            CALL      
PGM(QSPRJOBQ) PARM(&RCVVAR X’00000090′
+      

                         ‘JOBQ0100′
&QJOBQ X’0000000000000000’)      

                                                                      

            CHGVAR    
VAR(&BJOBS) VALUE(%SST(&RCVVAR 49
4))         

            CHGVAR    
VAR(&DJOBS) VALUE(%BIN(&BJOBS))

/*     If jobs are stacking up in JOBQ, send
email of possible issue  */   

                                                                            

             IF        
COND(&DJOBS *GT 2)
THEN(DO)                        

                                                                            

             SNDSMTPEMM
RCP((JOHNSMITH@MYCO.COM *PRI)
+            
     

                          (JANEDOE@MYCO.COM *CC))
+                   

                          SUBJECT(‘POSSIBLE
EDI PROBLEMS, JOBS
+           

                          BACKING
UP’) NOTE(‘check jobq, check
+           

                          EDIRUNNING
flag, See if TrustedLink
+            

                          process
failed.’)                                

                                                                            

             ENDDO                              
                           

                                                                            

             ENDPGM”

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    I won't be surprised if no one has a CL example. But the API only has five well-documented parameters. A dozen or more RPG examples show up in web searches, and CL calls it the same way. Where is the problem? -- Tom
    125,585 pointsBadges:
    report
  • mjntwnas400
    I finally got an answer from the iprodeveloper forum.  Thanks Tom.
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: