Focal Point
[CLOSED] INDEX question

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/185103881

July 23, 2009, 12:49 AM
Remya
[CLOSED] INDEX question
Hi all,

I have a doubt regarding how to identify the key or index by looking at the MASTER file.

FILENAME=LMAST,SUFFIX=FOC
SEGNAME=LDATA,SEGTYPE=SH1,$
FIELD=LNO , , I8 ,INDEX=I,$
FIELD=RHD_KEY , , A14,INDEX=I,$
FIELD=L_STATUS , , A1 ,$


SEGNAME=RHDXRF,SEGTYPE=KU,PARENT=LDATA,CRFILE=LMAST,
CRKEY=RHD_KEY,CRSEGNAME=LDATA
FIELD=XLNO , , I8 ,INDEX=I,$ FIELD=RHD_KEY , , A14,INDEX=I,$
FIELD=XL_STATUS , , A1 ,$

Given above is the MASTER file of the FOCUS database LMAST. Here is RHD_KEY part of index as it has INDEX=I written in the field defenition. But SEGTYPE=SH1 for the segment LDATA, which means LNO is the only key for LDATA segment. I am confused because of the conflicting SEGTYPE and INDEX components.

Also, please help me understand the second segment RHDXRF. It has a SEGTYPE of KU, what does it mean?

I am a beginner in FOCUS, any help would be appreciated.

This message has been edited. Last edited by: Kerry,


FCOUS 7.6.1
Z/OS
use focus in report generaton as well as in online screens
July 23, 2009, 05:15 AM
Danny-SRL
quote:

FILENAME=LMAST,SUFFIX=FOC
SEGNAME=LDATA,SEGTYPE=SH1,$
FIELD=LNO , , I8 ,INDEX=I,$
FIELD=RHD_KEY , , A14,INDEX=I,$
FIELD=L_STATUS , , A1 ,$

SEGNAME=RHDXRF,SEGTYPE=KU,PARENT=LDATA,CRFILE=LMAST,
CRKEY=RHD_KEY,CRSEGNAME=LDATA
FIELD=XLNO , , I8 ,INDEX=I,$
FIELD=RHD_KEY , , A14,INDEX=I,$
FIELD=XL_STATUS , , A1 ,$


Remya,

First of all, I suggest you read thoroughly the documentation of File Definitions:
Describing Data With WebFOCUS Language

Now for your question:
1. Your file is a FOCUS file
2. SEGTYPE=SH1 says that the segment LDATA is stored sorted Hi-to-Lo on the values of the first field LNO
3. LNO is also described as an INDEX, meaning that you can JOIN to this field
4. RHD_KEY is also an INDEX
5. Segment LDATA has a child segment RHDXRF which is stored in file LMAST, meaning that the segment points to itself. KU means that the relationship is 1-to-1.
6. The segments are linked by the RHD_KEY field
7. In the child segment, the fields LNO and L_STATUS are renamed with the X letter prefixed

I would be interested to know the reason for this recursion.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF