Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: derman@mindspring.com (Jon Derman)
Subject: Datatrieve Repeating List-Field - PLEASE HELP
Date: 1997/09/20	[thread overview]
Message-ID: <3424fca8.18663999@news.mindspring.com> (raw)
In-Reply-To: 341720f2.178322@news.mindspring.com


I figured out the answer to a question I posted last week on
comp.os.vms.  I wanted to flatten the hierarchy of a domain with a
repeating list-field, and I used a View Domain to do it.

So if my original domain was called TEST_DOM, and it looked like this:

05 SSN PIC X(9).
05 TEST OCCURS 25 TIMES.
   07 TEST_NAME USAGE WORD.
   07 TEST_SCORE PIC X(7).

...I flattened it by doing this:

DEFINE DOMAIN TEST_FLAT_VIEW OF TEST_DOM USING
01 TEST_FLAT OCCURS FOR TEST_DOM CROSS TEST.
   03 SSN        FROM TEST_DOM.
   03 TEST_NAME  FROM TEST_DOM.
   03 TEST_SCORE FROM TEST_DOM.;

...But there is still one thing I would really like to be able to do,
and so far, I haven't been able to figure it out.  In the View Domain,
I want an element that shows the occurence number of the repeating
element TEST from the original domain -- something like TEST_INDEX
shown below:

DEFINE DOMAIN TEST_FLAT_VIEW OF TEST_DOM USING
01 TEST_FLAT OCCURS FOR TEST_DOM CROSS TEST.
   03 SSN        FROM TEST_DOM.
   03 TEST_INDEX computed by OCCURENCE# of TEST FROM TEST_DOM.
   03 TEST_NAME  FROM TEST_DOM.
   03 TEST_SCORE FROM TEST_DOM.;

...Of course, there's no such thing as "OCCURENCE#" but there must be
a way to compute it.

Can anyone help me, please?


 



           reply	other threads:[~1997-09-20  4:00 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <341720f2.178322@news.mindspring.com>]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox