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     [SOLVED] How to join data from one segment of a file to data from another

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to join data from one segment of a file to data from another
 Login/Join
 
Guru
posted
Not sure if I'm asking this correctly, but....
Is it possible to join data from one segment of a file to data from another segment of the same file, provided of course that there is a field common to both segments? I need to put data form one segment, say, Employee, Earnings codes and so on from one segment and then hire date, job, title from another segment, and yes there is an employee id in the segments to join.

I'm just not sure how to go about this.

Thank you.

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Expert
posted Hide Post
What kind of "file" is this? VSAM? IMS? FOCUS?

If they're different segments in the same table and they both have Employee as a field, then they're most likely already related and you wouldn't have to do the JOIN, non?

If you need a join, the join syntax can include the segment name, something like this:

JOIN table-name1.segment-name1.EMPLOYEE IN table-name1 to table-name1.segment-name2.EMPLOYEE IN table-name1 AS J1


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Hi, Francis, and thank you for replying.

Here is some abbreviated info from my MFD. These are the two segments whose data I want to join or to work with.

I just am not sure if I should do a join or try to work with the data without a join as such.

Incidentally, the file is VSAM

Looking forward to hearing back from you.


$***********************************************************************
SEGNAME=EB_300 , SEGTYPE=S0, PARENT=ROOT
FIELD=DELETE_300 , ,A01 ,A01 ,TITLE='Del,Byte'
GROUP=KEY_300 ,ALIAS=KEY ,A19 ,A19 ,TITLE='Segment Key'
GROUP=KEY_300B ,ALIAS=KEY8 ,A12 ,A12 ,TITLE='SEGMENT KEy'
FIELD=CORP_300 , ,A03 ,A03 ,TITLE='Corp'
FIELD=EMP_ID_300 , ,A09 ,A09 ,TITLE='Employee, ID'


===========================================================================
I WANT TO JOIN DATA IN THE ABOVE SEGMENT TO DATA IN THE BELOW SEGMENT
===========================================================================

$***********************************************************************
SEGNAME=EB_210 , SEGTYPE=S0, PARENT=ROOT
FIELD=DELETE_210 , ,A01 ,A01 ,TITLE='Del,Byte'
GROUP=KEY_210 ,ALIAS=KEY ,A19 ,A19 ,TITLE='Segment Key'
GROUP=KEY_210B ,ALIAS=KEY3 ,A12 ,A12 ,TITLE='SEGMENT KEy'
FIELD=CORP_210 , ,A03 ,A03 ,TITLE='Corp'
FIELD=EMP_ID_210 , ,A09 ,A09 ,TITLE='Employee, ID'


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Expert
posted Hide Post
WM,

Look up recursive join. That should work for you. You will have to TAG the join so that you will be able to differentiate between the fields with the same names but on different levels.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Guru
posted Hide Post
Hi, Ginny,

I was wondering about that....I'll look it up and see what it can do for me. I've never really understood recursive joions, so there's no time like the present to learn.

Thanks!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Expert
posted Hide Post
They make your eyes cross, Roll Eyes, and aren't a lot of fun.

Good luck!


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Silver Member
posted Hide Post
Webmeinster,

From the MFD you have provided, it is clear the key filed of the two segment is same. There should be some identifier in each segment to identify the type of the record. For instance consider CORP, EMPLOYEE ID and TYPE (values 0000001 and 0000002) forms the key of the VSAM file. You can use the below approach to join the two segments of the data source:

  
DEFINE FILE filename
KEY_1/A12 = EDIT(KEY_300,'999999999999$$$$$$$');
END

TABLE FILE filename
PRINT EMPNAME
      EARNINGCODE
BY KEY_1
IF TYPE EQ '0000001'
ON TABLE HOLD AS TP1HLD
END

TABLE FILE filename
PRINT HIREDATE
      JOB
      TITILE
BY KEY_210
IF TYPE EQ '0000002'
ON TABLE HOLD AS TP2HLD
END

JOIN KEY_1 IN TP1HLD TO KEY_210 IN TP2HLD AS JOIN12

TABLE FILE TP1HLD
PRINT EMPNAME
      EARNINGCODE
      HIREDATE
      JOB
      TITLE
BY KEY_1
END


-Shrikant


FOCUS 7.2.3
Platform: IBM system Z9 Business class
O/P formats: Flat files, excel and CSV files
 
Posts: 39 | Location: Hyderabad, India | Registered: April 28, 2007Report 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     [SOLVED] How to join data from one segment of a file to data from another

Copyright © 1996-2020 Information Builders