Range of numbers

Robert J.M. Edis Robert.Edis@creatcomp.com
Mon, 11 Jan 1999 15:34:16 -0500


G'day Martyn

I would do something like:

$QTP
ACCESS some file or table with lots of records but little use
SET PROCESS LIMIT to 1 more than how many records you want to create
TEMP reckey 
ITEM reckey INITIAL 97000
DEFINE cntr = 1
ITEM reckey SUBTOTAL cntr
Do other defines if required
SUBFILE subfilename INCLUDE reckey [,other items as required]
GO


Blue
PowerHouse consultant
Rhode Island, USA

Disclaimer:
The opinions and ideas expressed in this message are my own and have no
relationship to my current employer, Initial Technical Staffing, its client
CCI, or any of CCI's clients.



	-----Original Message-----
	From:	Thomson, Martyn AETT:EX
[SMTP:martyn.thomson@gems1.gov.bc.ca]
	Sent:	Monday, January 11, 1999 2:57 PM
	To:	'POWERHOUSE Listserv'
	Subject:	Range of numbers

	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.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
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.