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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Need Maintain Help
 Login/Join
 
Member
posted
I have been trying to do a MAINTAIN to match two files together and if the records match, update a date. However I cannot get it to work no matter what I tried. Here is what I have and hopefully someone can help:

Hold 1 is Format Focus Index A1 A2 A3 A4 (this is the "database" if you will)
Hold 2 has the same keys but is only sorted in the key order (ie. by A1 by A2 by A3 by A4. no indexing or format).

Using Maintain, I am trying to match the records in Hold 2 to the database (hold 1) However it is not working. If there is a match, I need to update a date field on the database record that matched (the date field is not a key field). Hold 2 will contain records that are on the database and some that are not. If there is no match, I want to reject the record and move onto the next on Hold 2.

No matter what I try, my results are 1 Commit and nothing is updated when I know that around 150 records should be updated.

Can someone please help? It would be much appreciated. Thanks!
 
Posts: 13 | Registered: June 01, 2005Report This Post
Master
posted Hide Post
A simple TABLE FILE and MODIFY Will Work
  
DEFINE FILE HOLD2
MYDATE/MDYY = 1117205;
END

TABLE FILE HOLD2
PRINT
MYDATE
BY A1
BY A2
BY A3
BY A4
ON TABLE HOLD AS NEWDATA
END

MODIFY FILE HOLD1
FIXFORM FROM NEWDATA
MATCH A1 A2 A3 A4
ON NOMATCH REJECT
ON MATCH UPDATE MYDATE
DATA ON NEWDATA
END 


Good Luck




Scott

 
Posts: 865 | Registered: May 24, 2004Report This Post
Member
posted Hide Post
Ok. That worked! Thanks Texas Stingray. However..............

I realize I need to take it a level higher than what I talked about in my original post due to requirements changes. Plus I forgot to mention a couple things.

Hold1 is still the same, however there may be duplicates. There is no way to a complety unique key because I could add records later on in my process by a different key resulting in this key being that same as something that already exists.
Hold2 is the same but there may be duplicates in the hold file.

What I need to do is match Hold2 records one at a time to the database(hold1) by the key. If I find a match, I need to set a date on the database for that record touching no other data for that record. Also, I need to delete that record from Hold2. If I find a match and there are duplicates on the database for that key, I need to keep the record on Hold2 and go to the next record on Hold2.
If I do not find a match on the database, I want to keep the record is Hold2 for later processing and go to the next record on Hold2.

Hopefully someone can help we with these changes to my dilemna. I appreciate it
Thanks.
 
Posts: 13 | Registered: June 01, 2005Report This Post
Master
posted Hide Post
Here is the code that you need. THis compares the code in file B to the codes in file A. IF found, update the date field in file A and delete the record from file B. If not found, move to the next row of B - Mark

cssmhd: MAINTAIN FILE HOLDA AND HOLDB
MODULE IMPORT(MNTUWS)
FOR ALL NEXT HOLDB.CODE INTO STK
FOR ALL NEXT HOLDA.CODE INTO STK2
COMPUTE DATE1/A10 = TODAY2();
COMPUTE DATE2/MDYY = DATE1;
COMPUTE DATE3/YYMD = DATE2;
COMPUTE I/I3=1;
COMPUTE J/I3=1;
REPEAT STK.FOCCOUNT
COMPUTE J=1;
REPEAT STK2.FOCCOUNT
IF STK(I).CODE = STK2(J).CODE THEN BEGIN
COMPUTE STK2(J).XDATE = DATE3;
UPDATE HOLDA.XDATE FROM STK2(J);
DELETE HOLDB.CODE FROM STK(I);
GOTO EXITREPEAT
ENDBEGIN
COMPUTE J=J+1;
ENDREPEAT
COMPUTE I=I+1;
ENDREPEAT
END
 
Posts: 663 | Location: New York | Registered: May 08, 2003Report This Post
Member
posted Hide Post
Thanks! This helps tremendously and is much simpler than what I came up with.
 
Posts: 13 | Registered: June 01, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders