- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - OpenVMS
- >
- COBOL (STANDARD=V3) RRL+NLK -> NQL file status ret...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-20-2008 10:14 AM
06-20-2008 10:14 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-20-2008 11:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-20-2008 12:30 PM
06-20-2008 12:30 PM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
Also... don't just believe it. Try it!
Note... OK_RLK is a little harder to get.
Sample run and program used below.
Hein.
$ set rms/query_lock=enable
$ mcr sys$Login:ok_rrl sys$login:y.idx
record 22,1
NQL ___ status = 10001
RRL ___ status = 18029
RRL NLK status = 18029
___ NLK status = 182AA
___ ___ status = 182AA
$ set rms/query_lock=disable
$ mcr sys$Login:ok_rrl sys$login:y.idx
record 22,1
NQL ___ status = 10001
RRL ___ status = 18029
RRL NLK status = 10001
___ NLK status = 182AA
___ ___ status = 182AA
$ type ok_rrl.c
#include
#include
#include
#define MAXRECSIZ 32767
int SYS$OPEN(), SYS$CONNECT(), SYS$GET(), SYS$REWIND();
main (int argc, char *argv[])
{
struct FAB fab;
struct RAB rab;
char recbuf[MAXRECSIZ+1];
int i, stat;
fab = cc$rms_fab;
rab = cc$rms_rab;
fab.fab$b_shr = FAB$M_MSE | FAB$M_UPD;
fab.fab$b_fac = FAB$M_GET | FAB$M_UPD;
fab.fab$l_fna = argv[1];
fab.fab$b_fns = strlen( argv[1] );
stat = SYS$OPEN ( &fab );
if (!(stat&1)) return stat;
rab.rab$l_fab = &fab;
rab.rab$l_ubf = recbuf;
rab.rab$w_usz = MAXRECSIZ;
stat = SYS$CONNECT ( &rab );
if (!(stat&1)) return stat;
stat = SYS$GET ( &rab ); // lock record
rab.rab$w_isi = 0; // new context
stat = SYS$CONNECT ( &rab );
rab.rab$v_nql = 1;
stat = SYS$GET ( &rab ); // no query lock first to get RFA for sure
printf ("record %d,%d\n", rab.rab$l_rfa0, rab.rab$w_rfa4);
printf ("NQL ___ status = %X\n", stat);
rab.rab$v_nql = 0;
rab.rab$v_rrl = 1;
SYS$REWIND( &rab );
stat = SYS$GET ( &rab );
printf ("RRL ___ status = %X\n", stat);
rab.rab$v_nlk = 1;
SYS$REWIND( &rab );
stat = SYS$GET ( &rab );
printf ("RRL NLK status = %X\n", stat);
rab.rab$v_rrl = 0;
SYS$REWIND( &rab );
stat = SYS$GET ( &rab );
printf ("___ NLK status = %X\n", stat);
rab.rab$v_nlk = 0;
SYS$REWIND( &rab );
stat = SYS$GET ( &rab ); // no options
printf ("___ ___ status = %X\n", stat);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-20-2008 12:43 PM
06-20-2008 12:43 PM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-24-2008 05:26 AM
06-24-2008 05:26 AM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-24-2008 08:00 AM
06-24-2008 08:00 AM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
Yes that is correct.
With NQL active RMS will only take out bucket locks (temporarely) to make sure it has an up-to-date copy of the block holding the data record.
There is NO record locking.
Typically this is ok.
Here is how I see it...
Let's say the process using NQL needs to display customer name and address on the screen. 'Obviously' it does not matter whether the current balance for that customer is being updated. IMHO it even does not really matter if the address is being updated.
Had the program asked a millisecond earlier, it would have had the (now) stale record in its buffer and displayed, possibly for a long time, while already no longer being up to date also.
No biggie.
Now if you are also about to update that balnce, then you had better lock it properly and read the actual value before updating!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-24-2008 09:13 AM
06-24-2008 09:13 AM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
I'm sorry if I'm being dense... but... how then would I lock it properly? I would have done a READ ALLOWING NO OTHERS (to lock it properly) then REWRITE to update the record.
Also, Applications' response to me:
"Well, his last sentence is the issue â once you turn this on system wide there appears to be no possible way to lock a record.
Or am I missing it?
At least no way in Cobol.
I hope he understood the question â we are not trying to lock the record so that someone doing a regardless-of-lock would be blocked. We want someone doing a allowing-no-others to block someone else doing a allowing-no-others."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-24-2008 10:43 AM
06-24-2008 10:43 AM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
Just open for IO and READ.
>> I would have done a READ ALLOWING NO OTHERS (to lock it properly) then REWRITE to update the record.
Correct.
>> Also, Applications' response to me:
>> "Well, his last sentence is the issue â  once you turn this on system wide there appears to be no possible way to lock a record.
>> Or am I missing it?
They completely missed the fact that the RMS process/system flag is ONLY looked at when "READ REGARDLESS" is in effect.
There is ZERO, NO, ZILCH worry needed about loosing locking. You would only loose lock status information for processes which are not supposed to care too much... thye asked "READ REGARDLESS"
>> We want someone doing a allowing-no-others to block someone else doing a allowing-no-others."
NO impact.
Only impact is on the error status for RAAD REGARDLESS, which already blows through the allowin no others.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-25-2008 04:57 AM
06-25-2008 04:57 AM
Re: COBOL (STANDARD=V3) RRL+NLK -> NQL file status returned
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP