× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



> "but the implementation could be dangerous..."  <

It's not like that at all.  When I posted this code, I knew what people
would think.   So...

Quickly here's the use.
MFG company,  Operators sign on and start production for a big machine.
Only one person can be "Producing" for that machine at one time.
We have a file that the app chains to (with machine number) gets the record
and locks it for update.   It stays locked till the operator backs out of
that machine.
Once in a while they lose connection, (AS/400 job stays active for some
reason).

No one can sign in to that machine till the record lock is released.
The Forman has authority to run the program below keying in the machine
number that is locked,  I confirms it's the right job to blow away,  and
puff its gone.   No more 2am phone calls saying "We can't produce for
machine xxx cause...."

Very restricted application,  Very restricted authorized users for
function.

John Carr
--------------------------------

Steve Landess
I like this idea, but the implementation could be dangerous...

Do you check to see if job holding the lock is an interactive job, and then
give the user that you're about to kill a message that his job will be
ended
unless he releases the lock that he has on the record (maybe SNDUSRMSG)?

----- Original Message -----
From: <jpcarr@tredegar.com>
To: <midrange-l@midrange.com>
Sent: Thursday, October 10, 2002 6:59 PM
Subject: Re: Locked record



Adding to what the distinguished programmer from Mass said(ie Ron H.
Sorry I'v been listening to NPR Radio's congress debate).

Get the Returned Exception data from the SDS (program status DS  here
defined as REXD)  as Ron said,
I have a utility program(UTCL9020)  that ends the job passed to it.  I get
job name like this.


>>   D   PIFA                 SDS
>> D  REXD                   91    170

>> On a record lock you will get something similar to this:

>> ....5...10...15...20...25...30...35...40...45...50...55...60
>>         1   'Record 67412 in use by job 611072/RHARVEY/ISDEPT5B.'



D SLASH           S              3  0 DIM(10)

D Tlen            S              3  0
D Ulen            S              3  0
D Per             S              3  0

D jobn            S              6A
D User            S             10A
D Jobnam          S             10A

C     KEY           CHAIN(E)  lockedfile
C                   IF        %ERROR

C     '/'           SCAN      REXD          Slash

C                   IF        Slash(1)   <> 0

C                   EVAL      JOBN =  %subst(Rexd:Slash(1) - 6: 6)

C                   EVAL      Ulen =  Slash(2) - Slash(1) - 1
C                   EVAL      user =  %subst(Rexd:Slash(1) + 1: Ulen)

C     '.'           SCAN      rexd          per

C                   EVAL      Tlen =  per -  Slash(2) - 1

C                   EVAL      jobnam =  %subst(Rexd:Slash(2) + 1: Tlen)

C                   CALL      'UTCL9020'
C                   PARM                    JOBN
C                   PARM                    USER
C                   PARM                    JOBNAM

C                   ENDIF



John Carr
extinguished programmer from VA. (as opposed to distinguished).




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.