Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Record Lock problem

278 views
Skip to first unread message

Thomas Morgenthaler

unread,
Jul 30, 1998, 3:00:00 AM7/30/98
to
Hi,


Im looking for a way to (unlock, release or kill the job) a record
for make a backup of the file

I can display the lock with DSPRCDLCK,
how can i use this information in a programm or script
to kill the job witch is locking the record


Any ideas ?

thomas


Anton Gombkötö

unread,
Jul 30, 1998, 3:00:00 AM7/30/98
to
In the worst case (and cancelling jobs for file backup is already quite
bad), you could use OUTPUT(*PRINT) with the DSPRCDLCK command and then
CPYSPLF FILE(QPDSPRLK) JOB(*) SPLNBR(*LAST) to a physical file and read it.
Then you could issue a ENDJOB-command.

This isn't a solution, anyway.

You should investigate why there are record locks that prevent backup. If
it's self-written software, you should correct it. Maybe you should check
out the SAVACT-parameter on the SAV-commands, too. Or, if the locks are
intentional, maybe you can change the backup time. If it's impossible to
save onto media at the other time, save it to a savefile and save this
during the day with SAVSAVFDTA.

Anton Gombkötö
AS Software
Vienna, Austria, Europe

Thomas Morgenthaler schrieb in Nachricht
<35C0412C...@sn.novartis.com>...

Batman683

unread,
Jul 30, 1998, 3:00:00 AM7/30/98
to
Perhaps you can do DSPRCDLCK to a spooled file (QPDSPRLK ?), then do CPYSPLF to
create a physical file from the spooled file. Then you can write a CL or RPG
program to read the file, using QCMDEXC (if RPG) to execute an ENDJOB command.

The only problem I see here is knowing how to properly select the spooled file
you want, if multiple QPDSPRLK spooled files already exist in an outq. My
guess is *LAST for the spooled file number will work just fine.

Clark

tho...@inorbit.com

unread,
Jul 31, 1998, 3:00:00 AM7/31/98
to
Thomas:

Rather than DSPRCDLCK, use the List Object Locks (QWCLOBJL) API (one of the
Work Management APIs). This returns info about what jobs have locks on your
file directly back into your program. You can then handle it however you
choose.

Tom Liotta

In article <35C0412C...@sn.novartis.com>,


Thomas Morgenthaler <Thomas.mo...@sn.novartis.com> wrote:
> Hi,
>
> Im looking for a way to (unlock, release or kill the job) a record
> for make a backup of the file
>
> I can display the lock with DSPRCDLCK,
> how can i use this information in a programm or script
> to kill the job witch is locking the record
>
> Any ideas ?
>
> thomas
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Sam Lennon

unread,
Aug 2, 1998, 3:00:00 AM8/2/98
to
Check out code in the August Midrange Computing magazine which addresses
this issue. The code calls the API and returns a file of jobs using the
object. This should give a good start.

Sam

tho...@inorbit.com wrote in message <6pr8pt$sj0$1...@nnrp1.dejanews.com>...

0 new messages