Date:         Fri, 21 Apr 1995 09:38:16 -0400
Reply-To:     The NOMAD2 Discussion List
Sender:       The NOMAD2 Discussion List
From:         Shannon Huggins
Subject:      Re: recno(): how to find reco...

Here's a better way than LIST to get the total nbr of records:

slist {mastername} query used

After execution, &SLIST contains the number of instances in the segment.

As for record number, that's tougher.  There's not a built-in function that I
know of that keeps track of this.  In the absence of something better, you
could do something like this:

define recno in {mastername} as 9 expr = 1;
from {mastername} crlist recno cum {your key item} on {ddname}

Now you've got a created database that contains your key item and an
artificial record number that represents each key's position relative to
other keys.  You could, then, do a keyed read against this table whenever you
wanted to know the relative record number.  However, keep in mind that you
would have to re-execute the CRLIST whenever any records were inserted or
deleted, in order to keep the record number current.

If anyone knows of a better way, let us know!  Meanwhile, I hope this helps.

Shannon Huggins
Springs Industries
Lancaster, SC  29720
(803) 286-3822



back to index