Skip to main content

Posts

Showing posts from April, 2022

View Job Queue Info from SQL - IBM i

Job Queue Dealing with Job Queues (JOBQ) is part of day to day life when working with IBM i. There comes many situations where we need to check if a JOBQ is Held or Released, Which subsystem the JOBQ is attached to, No of active/held/released/scheduled jobs in JOBQ, Maximum number of active jobs etc.  Different commands (WRKJOBQ, WRKJOBQD, WRKSBSD) are available to view this information.  There is another easier way to access this information is by using SQL view JOB_QUEUE_INFO in QSYS2 (system name - JOBQ_INFO).  One thing to note is, User should either have read authority to the JOBQ or have one of the special authorities *JOBCTL, *SPLCTL. This view is helpful in many different ways like,  List of Job queues present in a library.  List of Job queues HELD/RELEASED in a library. Retrieve Subsystem a JOBQ is attached to.  List of Job queues in a Subsystem.  Retrieve maximum number of active jobs in a Job queue.  Retrieve number of Active/Held/Released/Scheduled jobs in a Job queue.  E.g

Record Lock Info from SQL - IBM i

Record Locks Record locks often causes the programs to crash if not handled properly. Identifying which job is locking the record is essential to resolve the issue (specially if the locking job is interactive idle for long time).  One way of identifying the Record locks is by using the command DSPRCDLCK (Display Record Locks).  This command accepts the below parameters and allows checking for the locks at the file, member and record level. Output of this command can only be either display or print.                         Display Record Locks (DSPRCDLCK)                                                                                     Type choices, press Enter.                                                                                                                  Physical file  . . . . . . . . . > TESTFILE      Name                   Library  . . . . . . . . . . . >    PREDDY1     Name, *LIBL, *CURLIB Member . . . . . . . . . . . . .    *FIRST        Name, *FIRST