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     Using MODIFY FILE match on multiple keys [CLOSED]

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Using MODIFY FILE match on multiple keys [CLOSED]
 Login/Join
 
Gold member
posted
Is it possible to use MODIFY FILE and match on multiple keys?

Like this:
MODIFY FILE M1247FF
FIXFORM FROM M1247FIN
MATCH CUST_ID ACCT_ID
ON NOMATCH INCLUDE
DATA ON M1247FIN
END

Basically, wherever the CUST_ID or the ACCT_ID is in the source file (M1247FIN), I want it rejected and not appended in file being modified (M1247FF).

thanks

Bob

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


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Expert
posted Hide Post
Yes, but it very much depends on the source table type and structure.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
I assume that what you mean is that if a record already exists in the file being modified - M1247FF - then you don't want to process any matching incoming records from the HOLD file.

The following will accomplish that.
quote:

MODIFY FILE M1247FF
FIXFORM FROM M1247FIN
MATCH CUST_ID ACCT_ID
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA ON M1247FIN
END


However you say "wherever the CUST_ID or the ACCT_ID is in the source file (M1247FIN), I want it rejected". The tricky part here is the OR in your statement. Right now you are matching on two keys. If both of those are in the same segment I don't think you can easily deal with the OR - both have to be a match to the incoming data to get the REJECT to work.

However, as Waz hints, if the CUST_ID is in a top segment and the ACCOUNT_ID in a lower segment (or vice versa) than you can MATCH them independently and INCLUDE or REJECT appropriately.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Gold member
posted Hide Post
George - Most important, I don't want the ACCT_ID to be included if matched. But it is possible (albeit unlikely) that a CUST_ID could change for an ACCT_ID thereby creating a scenario where that customer ends up in my universe of accounts after other suppressions. I did not see a code sample from Waz, so I'm not sure if there is a solution.

The source is a flat file. I suppose I could create a two step process and join that hold first on CUST_ID, suppress and hold, then join on ACCT_ID, suppress and hold. Then append to my final DB2.

thanks

Bob


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Master
posted Hide Post
Are you willing to gamble that the CUST_ID and ACCT_ID will forever be linked?

If it's only the ACCT_ID that you want to act on then create your M1274FF.MAS with a single key, namely ACCT_ID. Make CUST_ID a normal, non-key field.

Reporting from a flat file is not a problem - I assume you have a MFD / Synonym already created for that.

Probably the easiest thing to do is create a HOLD file from the contents of your flat file. Then the MODIFY becomes a piece of cake:
TABLE FILE M1247FIN
PRINT field list
BY ACCT_ID
ON TABLE HOLD
END

MODIFY FILE M1247FF
FIXFORM FROM HOLD
MATCH ACCT_ID
ON MATCH REJECT
ON NOMATCH INCLUDE
DATA ON HOLD
END


If you do it this way you don't have to worry about specifying the fieldname and length for each item in the FIXFORM command. The HOLD file will have everything sequenced the way you want and will create a temporary synonym that contains the field lengths to be used in the MODIFY. It might be possible to do this directly from the flat file, but I've never tried it in nearly 30 years worth of MODIFYs.

This message has been edited. Last edited by: George Patton,


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Virtuoso
posted Hide Post
Bob,
What is the structure of M1247FF?
I gather it is a DB2 table. Are CUST_ID and ACCT_ID defined as KEYS?


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
Danny,
yes, M1247FF is a DB2. Source is a flat file. Only CUST_ID is keyed.


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Virtuoso
posted Hide Post
Are there multiple records having the same CUST_ID ?


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

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
It's possible to have multiple CUST_ID for different ACCT_IDs. Not likely, but possible.


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
 
Posts: 93 | Registered: February 20, 2008Report This Post
Virtuoso
posted Hide Post
In MODIFY on a FOCUS file, matching on non-key fields is supported. Not sure whether that carries over to relational datasources.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
From what I've seen, you can match on any field in a relational DB, but I think you need to have a custom master with the match fields first.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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     Using MODIFY FILE match on multiple keys [CLOSED]

Copyright © 1996-2020 Information Builders