Range of numbers

Thomson, Martyn AETT:EX martyn.thomson@gems1.gov.bc.ca
Mon, 11 Jan 1999 11:56:36 -0800


Can anybody give me a lead on how to solve this problem? 
I have a subfile containing a start_number and an end_number, say 97001 and
97999.
How would I create a subfile containing one record for each number in this
range? i.e. 97001, 97002, etc.

I found a Supportlink article (Vol. 3. No. 1 "Creating a range of numbers in
an output file on HP MPE") which does this by writing a couple of records to
a subfile, then reading the subfile, incrementing a counter and writing back
to the same subfile until the end_number is reached.  The article states
this is possible by using 2 different names for the subfile i.e. the file
equation "APPFILE = NUMFILE". It also states that "Alias and Set File Open
will not work".

Problem is, I'm using OpenVMS not MPE.  I can use a logical to give the
subfile 2 names, but when I try to write back to the subfile just read I get
locking problems -  

Action Taken: Run terminated.
----------------------------------------------------------------------------
---
%RMS-E-FLK, file currently locked by another user
   File:  APPFILE
----------------------------------------------------------------------------
---
%SYSTEM-W-ACCONFLICT, file access conflict
   File:  APPFILE

I've tried overriding with SET FILE and SET LOCK statements, to no avail.
Also, I've stared at the code in the Supportlink example, and I suspect it's
wrong anyway. 
Can anyone suggest how to get this to work, or perhaps a completely
different strategy??
Martyn Thomson
Ministry of Education,
B.C., Canada
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.