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.
My requirement is to update the focus database but before updating the D/b, I need to check wheather the input file is a duploicate file or processed already by checking the input file header with previously processed file header.
It has a unique field named RECID#.
I should not miss the file or duplicate.
Any suggestions/help..
Thanks in advance...This message has been edited. Last edited by: Kerry,
If your input file has a synonym/master, you can TABLE it to get the first RECID. Otherwise, you will have to -READ it, as Sandy suggested. If the input file is not sorted by lowest RECID first, then use the MIN. prefix operator instead of FST. to get the lowest RECID from the input file. This approach assumes you will never have an input file where some of the records have already been loaded and some have not.
TABLE FILE INPUT_FILE
SUM FST.RECID
ON TABLE SAVE AS RECID1
END
-*
-RUN
-IF (&LINES GT 0) GOTO ID_CHECK1 ;
-TYPE ERROR: Input file is empty.
-TYPE ERROR: Load terminated.
-EXIT
-*
-ID_CHECK1
-READ RECID1, &RECID_1
-*
TABLE FILE DB_FILE
PRINT RECID
WHERE RECID EQ &RECID_1 ;
ON TABLE SAVE
END
-*
-RUN
-IF (&LINES EQ 0) GOTO ID_CHECK2 ;
-TYPE ERROR: Input file has already been loaded.
-TYPE ERROR: Load terminated.
-EXIT
-*
-ID_CHECK2
-SET &RECID_0 = &RECID_1 - 1 ;
-*
TABLE FILE DB_FILE
PRINT RECID
WHERE RECID EQ &RECID_0 ;
ON TABLE SAVE
END
-*
-RUN
-IF (&LINES GT 0) GOTO DB_LOAD ;
-TYPE WARNING: Input file RECIDs are out of sequence.
-TYPE WARNING: Load will continue.
-*
-DB_LOAD
MODIFY FILE DB_FILE
.
.
.
.
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
TABLE FILE CAR
PRINT
CAR
COUNTRY
MODEL
-*Creating a serial counter manually
COMPUTE RECID/I9=IF RECID EQ 2 THEN 4 ELSE IF RECID EQ 7 THEN 9 ELSE LAST RECID+1;
-****Checking if records are missing****
COMPUTE MISSED_RECORD/A2=IF (RECID-LAST RECID) GT 1 THEN 'Y' ELSE 'N';
ON TABLE HOLD AS TABLE_MISSED
END
-*If MISSED_RECORD equals Y then insert record whose record id is (RECID-1)
TABLE FILE TABLE_MISSED
PRINT
COMPUTE INSERT_REC/I9=RECID-1;
BY TOTAL INSERT_REC
WHERE MISSED_RECORD EQ 'Y';
ON TABLE SAVE AS CHECK_MISSED
END
-RUN
-*Append those records with record id IN FILE CHECK_MISSED
WebFOCUS 8.1.05 Windows Excel, PDF, HTML
Posts: 72 | Location: Flowood , MS | Registered: May 11, 2011