Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How do you represent a hierarchy in unrelated records?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How do you represent a hierarchy in unrelated records?
 Login/Join
 
<kiddpete>
posted
I have a FIX file which consists of several record types. The 'parent' information consists of several fields that the records have in common. Other than this parent info, the records are unrelated and have different formats. They can be distinguished by a RECTYPE field.

Can this file structure be represented in FOCUS? I would like to extract data from two or more record types, and sort the results based on the common parent information without using an intermediate file such as HOLD.
 
Report This Post
Guru
posted Hide Post
If the records have no meaningful positional relationship, use the 'dummy' parent technique per p 5-32 of Describig Data for WebFOCUS Language (5.2). If they are positionally related, the technique on p 5-29 can be your model.
Then you can access the data directly ie you will not need to first HOLD the data.
HTH
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
<kiddpete>
posted
Jimster06,

You did not answer my question. As I explained, the records are not positionally related. However, they do all have a common set of fields which contain 'parent' information. Can I extract from two or more segments, and sort the data using the common parent fields without using a HOLD file? Right now I think I can't, but maybe someone else sees how to do this.
 
Report This Post
Guru
posted Hide Post
Give me an idea of what your data looks like; where are the common fields, what are the key fields, etc.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Gold member
posted Hide Post
quote:
Originally posted by kiddpete:
[qb] Can this file structure be represented in FOCUS? I would like to extract data from two or more record types, and sort the results based on the common parent information without using an intermediate file such as HOLD. [/qb]
Yup. To do this, you simply define the fixed portion of the record as the PARENT segment - SEGNAME=ROOT - which is everything in the record up until the RECTYPE identifier.

Then define each logical child with "PARENT=ROOT, OCCURS=VARIABLE" because each child record may or may not exist for each parent record.

You begin each child record with your RECTYPE field and specify the VALUE in the ALIAS that defines each specific record type. Each RECTYPE gets its own SEGMENT (unless you have one segment that has multiple RECTYPE identifiers, in which case you can use the ACCEPT clause to specifiy a list or range of RECTYPE values).

The only way you'll get into trouble is if you try to print from multiple segments and you do WHERE or IF tests on values in one of the CHILD segments. This would get you a "testing on independent paths" error message since you'd be testing on one logical path and printing from another. But you might be able to do an alternate view to get around that. I'm pretty sure you can do this even on fixed files. Testing on fields in the ROOT segment will not cause any errors.

Here's a sample MFD so you can see the syntax. Search the doc for the section "Describing a VSAM Repeating Group With RECTYPEs" to see more examples.

In this example, RECTYPE values of "B" or "C" represent one type of child record, "D" is another type and "E" is the final record type.

FILENAME=SAMPLE,SUFFIX=VSAM,$
SEGNAME=ROOT,SEGTYPE=S0,$
GROUP=GRPKEY ,ALIAS=KEY ,USAGE=A8 ,ACTUAL=A8 ,$
FIELD=FLD000 ,E00 ,A08 ,A08 ,$
FIELD=A_DATA ,E01 ,A02 ,A02 ,$
SEGNAME=SEG001,PARENT=ROOT,OCCURS=VARIABLE,SEGTYPE=S0 ,$
FIELD=RECTYPE ,A01 ,A01 ,ACCEPT=B OR C ,$
FIELD=B_OR_C_DATA ,E02 ,A08 ,A08 ,$
SEGNAME=SEG002,PARENT=SEG001,OCCURS=VARIABLE,SEGTYPE=S0,$
FIELD=RECTYPE ,D ,A01 ,A01 ,$ FIELD=D_DATA ,E03 ,A07 ,A07 ,$
SEGNAME=SEG003,PARENT=ROOT,OCCURS=VARIABLE,SEGTYPE=S0 ,$
FIELD=RECTYPE ,E ,A01 ,A01 ,$ FIELD=E_DATA ,E04 ,A06 ,A06 ,$


If the RECTYPE does not appear at the very end of the fixed portion of the record, then you may be able to do this a little differently with MAPFIELD/MAPVALUE (similar to RECTYPE).

Hope this helps.

-Chris
 
Posts: 55 | Location: New York | Registered: March 07, 2003Report This Post
<kiddpete>
posted
Thanks Chris. That looks very nice!
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How do you represent a hierarchy in unrelated records?

Copyright © 1996-2020 Information Builders