Work with Object Locks - IBM AS400

This is a discussion on Work with Object Locks - IBM AS400 ; I need your help and brainstorm if you can. Is there a way to produce a report that will search a single library for objects that has locks on them. I am aware of WRKOBJLCK, but I need a way ...

+ Reply to Thread
Results 1 to 14 of 14

Thread: Work with Object Locks

  1. Work with Object Locks

    I need your help and brainstorm if you can.

    Is there a way to produce a report that will search a single library for
    objects that has locks on them.

    I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    can provide a CL program source to do this task.

    Reason why I am asking is that this is the 4th time I had to 'search'
    for objects that are in lock states because USERS did not do 'signoff'
    or F3 to exit the system. They all have the habit of using the BIG X on
    the upper right corner of the windows. This is very frustrating for me
    when I need to do my back up the backup says 1000 files save 84 failed.

    I look at the job log and it list me the objects...and I go and delete
    jobs against it. then once I 'assume' all the task is done, I do the
    backup again and then it say 32 object failed save..again, repeat the
    the search & delete.

    Thank you in advance for helping me.

    Have a Merry Christmas and a Happy New Year!

    Gil

  2. Re: Work with Object Locks

    Gilbert Noetzel wrote:
    > I need your help and brainstorm if you can.
    >
    > Is there a way to produce a report that will search a single library for
    > objects that has locks on them.
    >
    > I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    > OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    > can provide a CL program source to do this task.
    >
    > Reason why I am asking is that this is the 4th time I had to 'search'
    > for objects that are in lock states because USERS did not do 'signoff'
    > or F3 to exit the system. They all have the habit of using the BIG X on
    > the upper right corner of the windows. This is very frustrating for me
    > when I need to do my back up the backup says 1000 files save 84 failed.
    >
    > I look at the job log and it list me the objects...and I go and delete
    > jobs against it. then once I 'assume' all the task is done, I do the
    > backup again and then it say 32 object failed save..again, repeat the
    > the search & delete.
    >


    You may still want a report or utility to determine specific object
    locks, but are you aware of the PRECHK(*YES) option on SAVxxx commands?
    It will check for locks first and fail the save if conflicts are found.

    --
    Karl Hanson


  3. Re: Work with Object Locks

    Karl -

    I am aware of that option, but I am looking for a quick reporting of a
    single library that I backup all the time. I need it to list the
    objects so that I can indivually delete the jobs against it.

    I know the job logs has that information, but I would prefer something
    like a command or call program to product the desire report to print out
    and go through it. Also, provide documentation to present to those
    'offending' individuals of their mistakes.

    Gil

    Karl Hanson wrote:
    > Gilbert Noetzel wrote:
    >
    >> I need your help and brainstorm if you can.
    >>
    >> Is there a way to produce a report that will search a single library
    >> for objects that has locks on them.
    >>
    >> I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    >> OBJTYPE(*FILE). Can anyone point me in the right direction or do
    >> anyone can provide a CL program source to do this task.
    >>
    >> Reason why I am asking is that this is the 4th time I had to 'search'
    >> for objects that are in lock states because USERS did not do 'signoff'
    >> or F3 to exit the system. They all have the habit of using the BIG X
    >> on the upper right corner of the windows. This is very frustrating
    >> for me when I need to do my back up the backup says 1000 files save 84
    >> failed.
    >>
    >> I look at the job log and it list me the objects...and I go and delete
    >> jobs against it. then once I 'assume' all the task is done, I do the
    >> backup again and then it say 32 object failed save..again, repeat the
    >> the search & delete.
    >>

    >
    > You may still want a report or utility to determine specific object
    > locks, but are you aware of the PRECHK(*YES) option on SAVxxx commands?
    > It will check for locks first and fail the save if conflicts are found.
    >
    > --
    > Karl Hanson
    >


  4. Re: Work with Object Locks


    Gilbert Noetzel wrote:
    > I need your help and brainstorm if you can.
    >
    > Is there a way to produce a report that will search a single library for
    > objects that has locks on them.
    >
    > I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    > OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    > can provide a CL program source to do this task.
    >
    > Reason why I am asking is that this is the 4th time I had to 'search'
    > for objects that are in lock states because USERS did not do 'signoff'
    > or F3 to exit the system. They all have the habit of using the BIG X on
    > the upper right corner of the windows. This is very frustrating for me
    > when I need to do my back up the backup says 1000 files save 84 failed.
    >
    > I look at the job log and it list me the objects...and I go and delete
    > jobs against it. then once I 'assume' all the task is done, I do the
    > backup again and then it say 32 object failed save..again, repeat the
    > the search & delete.
    >
    > Thank you in advance for helping me.
    >
    > Have a Merry Christmas and a Happy New Year!
    >
    > Gil



  5. Re: Work with Object Locks

    Probably the quick way is WRKACTJOB *print, copy to a file, read the
    job(s) information,
    then do a DSPJOB output(*print) option(*joblck), copy those into a
    file, and then read the information.

    Long way around. Maybe an API, but even then you would need the job
    information.



    Gilbert Noetzel wrote:
    > I need your help and brainstorm if you can.
    >
    > Is there a way to produce a report that will search a single library for
    > objects that has locks on them.
    >
    > I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    > OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    > can provide a CL program source to do this task.
    >
    > Reason why I am asking is that this is the 4th time I had to 'search'
    > for objects that are in lock states because USERS did not do 'signoff'
    > or F3 to exit the system. They all have the habit of using the BIG X on
    > the upper right corner of the windows. This is very frustrating for me
    > when I need to do my back up the backup says 1000 files save 84 failed.
    >
    > I look at the job log and it list me the objects...and I go and delete
    > jobs against it. then once I 'assume' all the task is done, I do the
    > backup again and then it say 32 object failed save..again, repeat the
    > the search & delete.
    >
    > Thank you in advance for helping me.
    >
    > Have a Merry Christmas and a Happy New Year!
    >
    > Gil



  6. Re: Work with Object Locks

    david.anderson@encompassgroup.net wrote:
    > Probably the quick way is WRKACTJOB *print, copy to a file, read the
    > job(s) information,
    > then do a DSPJOB output(*print) option(*joblck), copy those into a
    > file, and then read the information.
    >
    > Long way around. Maybe an API, but even then you would need the job
    > information.
    >
    >
    >
    > Gilbert Noetzel wrote:
    >> I need your help and brainstorm if you can.
    >>
    >> Is there a way to produce a report that will search a single library for
    >> objects that has locks on them.
    >>
    >> I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    >> OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    >> can provide a CL program source to do this task.
    >>
    >> Reason why I am asking is that this is the 4th time I had to 'search'
    >> for objects that are in lock states because USERS did not do 'signoff'
    >> or F3 to exit the system. They all have the habit of using the BIG X on
    >> the upper right corner of the windows. This is very frustrating for me
    >> when I need to do my back up the backup says 1000 files save 84 failed.
    >>
    >> I look at the job log and it list me the objects...and I go and delete
    >> jobs against it. then once I 'assume' all the task is done, I do the
    >> backup again and then it say 32 object failed save..again, repeat the
    >> the search & delete.
    >>


    An alternative (likely more efficient) would be to produce a list of
    objects in the library to be saved - eg using the Open List of Objects
    API, or List Objects API (links below), or DSPOBJD CL to an OUTFILE.
    For each object of interest in the list (may want to skip object types
    not likely to be locked?), attempt to lock the object, eg using ALCOBJ
    CL command. For each lock conflict, use the List Object Locks API to
    get job name info, etc. for a report.

    It involves some programming but should be fairly straightforward.
    There may be better methods, but thought I'd throw this out...
    Note that API and OUTFILE interfaces are much less likely to change than
    *PRINT spool file output.

    http://publib.boulder.ibm.com/infoce...s/qgyolobj.htm
    http://publib.boulder.ibm.com/infoce...is/quslobj.htm
    http://publib.boulder.ibm.com/infoce...s/qwclobjl.htm

    --
    Karl Hanson


  7. Re: Work with Object Locks

    Gilbert Noetzel racontait dans comp.sys.ibm.as400.misc:

    > Reason why I am asking is that this is the 4th time I had to
    > 'search' for objects that are in lock states because USERS did not
    > do 'signoff' or F3 to exit the system. They all have the habit of
    > using the BIG X on the upper right corner of the windows. This is
    > very frustrating for me when I need to do my back up the backup
    > says 1000 files save 84 failed.
    >



    What about the two following ways to proceed :

    * use the save-while-active options for your backups

    * if you know the subsystems where the locking job run, end the
    subsystem before the backup


    --
    Cordialement/Best regards
    Marc Rauzier

  8. Re: Work with Object Locks

    Gilbert,

    I have a fairly old utility (back from 2000) that can write all locks of all objects of a given
    library to an output file.

    The programs are compiled as ILE but actually it is old RPG-III code. Today I would choose a different
    design. However it works.

    The utility uses QUSLOBJ to produce a list of all objects of a given library. It the spins through
    that list. For each list entry it calls QWCLOBJL to get the locks. For each file it also calls QUSLMBR
    to get the list of file members. For each member it calls QWCLOBJL to get the locks on that member. At
    the end you should have a list of all locks.

    The utility is quite slow because it re-creates the user spaces needed for QWCLOBJL and QUSLMBR. It
    was better if it would create these user spaces once at the beginning and then re-use it until the
    end. It should not be difficult for you to change the utility that way.

    Let me know if you want a copy (source code or save file). We are on V5R3.

    Thomas Raddatz.



    Gilbert Noetzel schrieb:
    > I need your help and brainstorm if you can.
    >
    > Is there a way to produce a report that will search a single library for
    > objects that has locks on them.
    >
    > I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    > OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    > can provide a CL program source to do this task.
    >
    > Reason why I am asking is that this is the 4th time I had to 'search'
    > for objects that are in lock states because USERS did not do 'signoff'
    > or F3 to exit the system. They all have the habit of using the BIG X on
    > the upper right corner of the windows. This is very frustrating for me
    > when I need to do my back up the backup says 1000 files save 84 failed.
    >
    > I look at the job log and it list me the objects...and I go and delete
    > jobs against it. then once I 'assume' all the task is done, I do the
    > backup again and then it say 32 object failed save..again, repeat the
    > the search & delete.
    >
    > Thank you in advance for helping me.
    >
    > Have a Merry Christmas and a Happy New Year!
    >
    > Gil


  9. Re: Work with Object Locks

    Gilbert Noetzel wrote:

    > I am aware of that option, but I am looking for a quick reporting of a
    > single library that I backup all the time. I need it to list the
    > objects so that I can indivually delete the jobs against it.
    >
    > I know the job logs has that information, but I would prefer something
    > like a command or call program to product the desire report to print out
    > and go through it. Also, provide documentation to present to those
    > 'offending' individuals of their mistakes.


    Gilbert:

    I'm not sure that listing locks for all objects in a library makes a lot
    of sense. The SAVxxx commands have "save while active" options that help
    handle your situation, but the commands don't work in the exact way you
    apparently want them to. If you do ityourself, it'll take time to run
    through the list of objects and then it'll take time to materialize
    locks for object _and_ process the list of those locks.

    By the time you've gone through the list, a new job could start and grab
    an object you already looked at.

    Consider instead simply processing locks against the library itself. If
    you keep jobs from using the library, you won't have to worry about
    things that might be in it. Should be much faster.

    Tom

    http://zap.to/tl400


    > Karl Hanson wrote:
    >> Gilbert Noetzel wrote:
    >>
    >>> Is there a way to produce a report that will search a single library
    >>> for objects that has locks on them.
    >>>
    >>> I am aware of WRKOBJLCK, but I need a way to specify
    >>> OBJ(LIBRARY/*ALL) OBJTYPE(*FILE). Can anyone point me in the right
    >>> direction or do anyone can provide a CL program source to do this task.


  10. Re: Work with Object Locks

    or you could just end the QINTER subsystem. if you needed to
    you could even restart it after it ends. that would kill any
    interactive
    jobs.


    Gilbert Noetzel wrote:
    > I need your help and brainstorm if you can.
    >
    > Is there a way to produce a report that will search a single library for
    > objects that has locks on them.
    >
    > I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    > OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    > can provide a CL program source to do this task.
    >
    > Reason why I am asking is that this is the 4th time I had to 'search'
    > for objects that are in lock states because USERS did not do 'signoff'
    > or F3 to exit the system. They all have the habit of using the BIG X on
    > the upper right corner of the windows. This is very frustrating for me
    > when I need to do my back up the backup says 1000 files save 84 failed.
    >
    > I look at the job log and it list me the objects...and I go and delete
    > jobs against it. then once I 'assume' all the task is done, I do the
    > backup again and then it say 32 object failed save..again, repeat the
    > the search & delete.
    >
    > Thank you in advance for helping me.
    >
    > Have a Merry Christmas and a Happy New Year!
    >
    > Gil



  11. Re: Work with Object Locks

    Thank you all for your input and insight to my current issue.

    Maybe I did not explain clearly. Although I was tempted to end the SBS
    Qinter, but there are no 'jobs' running in the QINTER. It is one of
    those things that the user do is to terminate their 5250 session in the
    middle of File Maintenance. Doing so, the user job description is
    attached to the Database File and will not be removed until he is
    properly 'signed of'. But in this case he did not..did a window close,
    the Quinter does not show him on the system. When I do a back up..the
    backup says xx objects failed. I do a F10 to see the job log and see
    there are few xx objects that is unable to be allocated. I go to the
    Object Lock Inquiry and type in the file name and it shows me the User
    Job that is 'attachec' to the file. Since he is no longer on the
    system, I just do an option 4 to end the job (60 seconds). Once that is
    done, the back up can resume.

    I am not able to do Save while active, becuase the object needs to be
    free and clear to be saved onto the tape drive.

    All of your suggestions and tips I will look over and see which ones is
    simple enough for me to use.

    Again...thank you for your help and have a great week!...

    Gil

    david.anderson@encompassgroup.net wrote:
    > or you could just end the QINTER subsystem. if you needed to
    > you could even restart it after it ends. that would kill any
    > interactive
    > jobs.
    >
    >
    > Gilbert Noetzel wrote:
    >
    >>I need your help and brainstorm if you can.
    >>
    >>Is there a way to produce a report that will search a single library for
    >>objects that has locks on them.
    >>
    >>I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    >>OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    >>can provide a CL program source to do this task.
    >>
    >>Reason why I am asking is that this is the 4th time I had to 'search'
    >>for objects that are in lock states because USERS did not do 'signoff'
    >>or F3 to exit the system. They all have the habit of using the BIG X on
    >>the upper right corner of the windows. This is very frustrating for me
    >>when I need to do my back up the backup says 1000 files save 84 failed.
    >>
    >>I look at the job log and it list me the objects...and I go and delete
    >>jobs against it. then once I 'assume' all the task is done, I do the
    >>backup again and then it say 32 object failed save..again, repeat the
    >>the search & delete.
    >>
    >>Thank you in advance for helping me.
    >>
    >>Have a Merry Christmas and a Happy New Year!
    >>
    >>Gil

    >
    >


  12. Re: Work with Object Locks

    What about changing a system value to have the job automatically end
    after so much inactivity for the interactive job has gone by?

    QINACTITV is the system value I think might help (set to say 30
    minutes). With QINACTMSGQ set to a message queue, you could have a
    program monitor for a message as each job is inactive for the time
    specified. You could check some value somewhere (data area or use of a
    system scoped environment variable) to see if your doing a save, and if
    so, end those jobs. Otherwise, just remove the message and ignore.

    Gilbert Noetzel wrote:
    > Thank you all for your input and insight to my current issue.
    >
    > Maybe I did not explain clearly. Although I was tempted to end the SBS
    > Qinter, but there are no 'jobs' running in the QINTER. It is one of
    > those things that the user do is to terminate their 5250 session in the
    > middle of File Maintenance. Doing so, the user job description is
    > attached to the Database File and will not be removed until he is
    > properly 'signed of'. But in this case he did not..did a window close,
    > the Quinter does not show him on the system. When I do a back up..the
    > backup says xx objects failed. I do a F10 to see the job log and see
    > there are few xx objects that is unable to be allocated. I go to the
    > Object Lock Inquiry and type in the file name and it shows me the User
    > Job that is 'attachec' to the file. Since he is no longer on the
    > system, I just do an option 4 to end the job (60 seconds). Once that is
    > done, the back up can resume.
    >
    > I am not able to do Save while active, becuase the object needs to be
    > free and clear to be saved onto the tape drive.
    >
    > All of your suggestions and tips I will look over and see which ones is
    > simple enough for me to use.
    >
    > Again...thank you for your help and have a great week!...
    >
    > Gil
    >
    > david.anderson@encompassgroup.net wrote:
    >
    >> or you could just end the QINTER subsystem. if you needed to
    >> you could even restart it after it ends. that would kill any
    >> interactive
    >> jobs.
    >>
    >>
    >> Gilbert Noetzel wrote:
    >>
    >>> I need your help and brainstorm if you can.
    >>>
    >>> Is there a way to produce a report that will search a single library for
    >>> objects that has locks on them.
    >>>
    >>> I am aware of WRKOBJLCK, but I need a way to specify OBJ(LIBRARY/*ALL)
    >>> OBJTYPE(*FILE). Can anyone point me in the right direction or do anyone
    >>> can provide a CL program source to do this task.
    >>>
    >>> Reason why I am asking is that this is the 4th time I had to 'search'
    >>> for objects that are in lock states because USERS did not do 'signoff'
    >>> or F3 to exit the system. They all have the habit of using the BIG X on
    >>> the upper right corner of the windows. This is very frustrating for me
    >>> when I need to do my back up the backup says 1000 files save 84 failed.
    >>>
    >>> I look at the job log and it list me the objects...and I go and delete
    >>> jobs against it. then once I 'assume' all the task is done, I do the
    >>> backup again and then it say 32 object failed save..again, repeat the
    >>> the search & delete.
    >>>
    >>> Thank you in advance for helping me.
    >>>
    >>> Have a Merry Christmas and a Happy New Year!
    >>>
    >>> Gil

    >>
    >>
    >>



    --
    Rodney A Johnson
    Technical Team Lead for i5/OS (AS/400) Spool
    Dept GJC
    IBM Rochester, Minnesota

    The contents of this message express only the sender's opinion.
    This message does not necessarily reflect the policy or views of
    my employer, IBM. All responsibility for the statements
    made in this Usenet posting resides solely and completely with the
    sender.

  13. Re: Work with Object Locks

    Gilbert Noetzel wrote:

    > Maybe I did not explain clearly. Although I was tempted to end the SBS
    > Qinter, but there are no 'jobs' running in the QINTER. It is one of
    > those things that the user do is to terminate their 5250 session in the
    > middle of File Maintenance. Doing so, the user job description is
    > attached to the Database File and will not be removed until he is
    > properly 'signed of'. But in this case he did not..did a window close,
    > the Quinter does not show him on the system.


    If the job is still there, then QINTER will show it. However...

    If you used WRKACTJOB job to see what's in QINTER, it's possible that
    you'll need to press in order to include jobs in
    disconnected state.

    Probably better to use WRKSBS or WRKSBSJOB to see what's running in a
    subsystem.

    Tom Liotta

    http://zap.to/tl400


  14. Re: Work with Object Locks

    Tom -

    Thank you for the time. I will take a look at this on my next backup.

    Gil

    Tom Liotta wrote:
    > Gilbert Noetzel wrote:
    >
    >> Maybe I did not explain clearly. Although I was tempted to end the
    >> SBS Qinter, but there are no 'jobs' running in the QINTER. It is one
    >> of those things that the user do is to terminate their 5250 session in
    >> the middle of File Maintenance. Doing so, the user job description is
    >> attached to the Database File and will not be removed until he is
    >> properly 'signed of'. But in this case he did not..did a window
    >> close, the Quinter does not show him on the system.

    >
    >
    > If the job is still there, then QINTER will show it. However...
    >
    > If you used WRKACTJOB job to see what's in QINTER, it's possible that
    > you'll need to press in order to include jobs in
    > disconnected state.
    >
    > Probably better to use WRKSBS or WRKSBSJOB to see what's running in a
    > subsystem.
    >
    > Tom Liotta
    >
    > http://zap.to/tl400
    >


+ Reply to Thread