Hi,
We are making a solution where a CICS program PGM1 calls a series of programs to invoke a web service SRVC01. And based on the response of the service, we make a decision:
A. If the response is '0' - we want to INSERT a row with all columns into the table TABLE1 (to be created anew-cloned from an existing one).
B. But If the response is '0' - we want to INSERT a row with but this time, only with some columns into the table TABLE1.
The rationale is, two separate automatically started transaction (after every 5 minutes) AAA2 and AAA3 linked to CICS programs PGM2 and PGM3 respectively reads rows from DB2 TABLE1 in a way:
1. PGM2 should read rows that were INSERTed as a result of '0' response code from the web service.
1. PGM3 should read rows that were INSERTed as a result of non '0' response code from the web service.
Now, there are two ways to store the response code from the service into the table TABLE1:
1. I recommended - We add an extra column SERVICE_CODE and simply move the response code from SRVC01 to it, so that the rows can be picked by PGM2 if SRVC01 = '0' or picked up by PGM3 if SRVC01 NOT = '0'.
2. Senior recommended - there exists a TIMESTAMP column. Senior suggested that rather than having an extra column in the table, we save the effort and update the TS column to be current TS if response is '0' and '9999-12-31 24:00:00.0' if resp is other than '0'. After that, PGM2 will FETCH rows where TS NOT = '9999-12-31 24:00:00.0' and PGM3 will FETCH rows where TS = '9999-12-31 24:00:00.0'.
I think the 2nd suggestion will work but sounds confusing to anyone who will analyse/work on this solution after that. Personally, just for saving the extra effort of asking DBA to include an extra column and having a working but misleading approach is not good.
Let the extra column (of one byte only) store the return code of the service and make things obvious and a lot easier to understand.
What is your suggestion? Does anyone think that PGM1- having to MOVE high value of TS and PGM2/PGM3 having to FETCH rows on the basis of such a value would create performance or any other problems?