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.
I would like to use mainframe batch Focus to update a DB2 table as follows: 1. Read a flat file record 2. If the record (key) exists on the DB2 table then update the DB2 row. 3. If the record (key) does not, insert it.
Can anyone provide the pseudo-code for this logic??
Thanks to all, Ken Focus 7.2.5 Z/OS IBM mainframeThis message has been edited. Last edited by: Kerry,
You could do the insert part with SQL passthrough too.
(..initial processing to read flat file and assign values to amper vars...)
-INSERT_LOOP to be processed as many times are needed
SQL DB2
INSERT statement using above amper vars
;
TABLE
END
-RUN
-SET &SQL_ERROR1 = &RETCODE;
-TYPE SQL ERROR1: &SQL_ERROR1
-IF (&SQL_ERROR1.EVAL EQ '0' OR &SQL_ERROR1.EVAL EQ -803) GOTO LBL_NXT1;
(else do ERROR processing here)
-LBL_NXT1
(continue processing after sucessful insert)
-INSERT_LOOP_END
The -803 check takes care of the duplicate condition and treats it as successful operation. All other errors should be handled appropriately.
Sandeep Mamidenna
------------------------------------------------------------------------------------------------- Blue Cross & Blue Shield of MS WF.76-10 on (WS2003 + WebSphere) / EDA on z/OS + DB2 + MS-SQL MRE, BID, Dev. Studio, Self-Service apps & a dash of fun !!
Posts: 218 | Location: Jackson, MS | Registered: October 31, 2006