Creating a Subfile of Sequential Numbers

Chris Sharman chris.sharman@ccagroup.co.uk
Wed, 26 Sep 2001 09:16:46 +0100


>How can I create a subfile of sequential numbers from 1 to 999999?  We do
>not have any datasets or files that have that many records in it to access.

With indexed subfiles, or a suitable dictionary file:

access anyfile ; at least 1k records
set rep lim 1000
def knum int*4 = 1
def snum int*9 = 1
set subfile name i1k index knum
rep sum knum snum subt
go
access *i1k link (1) to *i1k alias ikk ; link allows n-squared records
set rep lim 999999
def seqnum int*9 = 1
set subfile name i1m keep
rep sum seqnum subt
go

For larger numbers, or with a smaller 'seed', a 2nd link would allow
n-cubed.

Regards,
Chris



-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.