Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Mecki Foerthmann
The READU statement has a LOCKED clause that is true if a record is locked. You can put all your locking ha logic in there. READU record FROM filevariable,itemID THEN code if record exists and isn't locked (optional) LOCKED code to handle locked record condition (optional) END ELSE code

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Charlie Noah
Perhaps we should apply a little Systems Analysis 101 here - ask some questions. I'm not convinced that the original request completely described the need. What is the logical scenario (batch update, transaction entry, file maintenance, etc.)? Once a lock is removed, do you want your copy of

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Woodward, Bob
Sorry Mecki but I think you have the LOCKED in the wrong place. At least in my version of Unidata. It comes before the THEN segment so the full, proper syntax would be: READU xxx FROM xxx, xxx ON ERROR Xxx what to do if a hard error like file not open END LOCKED Xxx what to do if locked END

[U2] Turn pagination back on

2013-02-07 Thread Wjhonson
Someone remind me, how to do this. If pagination has been turned off, and for my embedded routine, I want to turn it back on again. How do I do this? I've tried HEADING, and PAGE, and CRT @(0,0) I know there's a trick but I can't quite recall what it is

Re: [U2] Turn pagination back on

2013-02-07 Thread David A. Green
BPIOCP David A. Green (480) 813-1725 DAG Consulting -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wjhonson Sent: Thursday, February 07, 2013 1:21 PM To: u2-users@listserver.u2ug.org Subject: [U2] Turn pagination

Re: [U2] Turn pagination back on

2013-02-07 Thread larryh
BPIOCP (UD) CALL !BPIOCP (UV) Larry Hiscock Western Computer Services Someone remind me, how to do this. If pagination has been turned off, and for my embedded routine, I want to turn it back on again. How do I do this? I've tried HEADING, and PAGE, and CRT @(0,0) I know there's a trick

Re: [U2] Turn pagination back on

2013-02-07 Thread Chris Austin
For pagination we setup an I-Descriptor for a CLIENT table as follows: ROW_NUMBER I @1+1 ; INT(@1)MD0 Row Number 5R S The trick is the @1+1 ; INT(@1) bit. Chris From: dgr...@dagconsulting.com To:

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Jon Wells
What I'm wondering is; what can I put into the 'Xxx what to do if locked' section whereby it waits until the record lock clears, once it clears, set my own lock, read the record, alter the record, and then write the record (which would release my lock)? Thank you, Jon Wells

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread John Jenkins
A WRITE automatically clears the lock, a WRITEU will keep it. If you are inside a transaction boundary however, then the lock is kept until the transaction is committed or abandoned. Regards JayJay On 7 Feb 2013, at 20:46, Jon Wells jwaytwe...@yahoo.com wrote: What I'm wondering is; what

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Woodward, Bob
With the LOCKED clause included, the READU does not pause. You can put anything you want in that section but just realize that the statement fully executes and proceeds to the next command. If you want to simulate wait until I obtain the lock then you just have to create this into a small

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Peter Cheney
I think it would also be useful to add some form of exit routine inside the LOCKWAIT loop. Something like a counter to only allow say 10 attempts at trying to obtain the lock. That way you don't keep looping for ever if some other process which has the lock does not release it for whatever

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Anthonys Lists
On 07/02/2013 20:46, Jon Wells wrote: What I'm wondering is; what can I put into the 'Xxx what to do if locked' section whereby it waits until the record lock clears, once it clears, set my own lock, read the record, alter the record, and then write the record (which would release my lock)?

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Woodward, Bob
You're exactly right. The only time you REALLY need the LOCKED clause if there is some need to change that approach. That was what I attempted to show in my first response. I guess I was a bit terse in that one, though. BobW -Original Message- From:

Re: [U2] Turn pagination back on

2013-02-07 Thread Gregor Scott
For a modern though totally undocumented alternative to !BPIOCP thy this... The code ASSIGN 1 TO SYSTEM(1005) will enable pagination. The code ASSIGN 0 TO SYSTEM(1005) will disable it. I think this is documented on the U2UG.org wiki. This email and any attachments to it are confidential. You

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Wjhonson
I wouldn't however *recommend* this approach to locking as the user can never tell if their terminal is waiting on a lock, or just hung in some other odd manner, or perhaps processing a batch of something. So it's rather a nasty trick to play on the user, to just use READU without a LOCKED

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Woodward, Bob
In an active user session where users are obtaining a lock for a length of time, you're right. There are lots of times, though, that lock intervention is not a benefit. It all depends on the need of the application and many situations where I would highly recommend using the default locking

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Kevin King
+1. Well stated. On Thursday, February 7, 2013, Woodward, Bob wrote: In an active user session where users are obtaining a lock for a length of time, you're right. There are lots of times, though, that lock intervention is not a benefit. It all depends on the need of the application and

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Wjhonson
Then you're misunderstanding what I'm saying. -Original Message- From: Kevin King ke...@precisonline.com To: U2 Users List u2-users@listserver.u2ug.org Sent: Thu, Feb 7, 2013 6:48 pm Subject: Re: [U2] Record locks (Unidata 7.2) +1. Well stated. On Thursday, February 7, 2013,

Re: [U2] Record locks (Unidata 7.2)

2013-02-07 Thread Tony Gravagno
I think people understand exactly what you're saying, but disagree. Most applications don't use the more rigorous coding for having a Locked clause that provides additional information to the user, retries, etc. That's not wrong, it's just not necessary ... depending on the site. That said, when