I have been give the task to update one column on our production database with information in the same column on the matching test database. This should be an easy task, but it has turned out to be anything but that.
The version of DB2 we are using is version 7 (I'll have the rest of the information required by morning) on an IBM mainframe running ZOS (latest version).
Here is three versions of the SQL code that I have been attempting to run:
#1
UPDATE EHP.ECD_TB A
SET A.ECD_CL_STATUS = (SELECT B.ECD_CL_STATUS
FROM EHT.ECD_TB B
WHERE A.ECD_RORO_ID = B.ECD_RORO_ID
AND A.ECD_ED_ID = B.ECD_ED_ID
AND A.ECD_DN = B.ECD_DN
AND A.ECD_DN_SEQ = B.ECD_DN_SEQ
AND A.ECD_SEQ_NO = B.ECD_SEQ_NO
AND A.ECD_REJECT_RSN <> ' ')
WHERE EXITS
(SELECT NULL FROM EHT.ECD_TB C
WHERE A.ECD_RORO_ID = C.ECD_RORO_ID
AND A.ECD_ED_ID = C.ECD_ED_ID
AND A.ECD_DN = C.ECD_DN
AND A.ECD_DN_SEQ = C.ECD_DN_SEQ
AND A.ECD_SEQ_NO = C.ECD_SEQ_NO
AND A.ECD_REJECT_RSN <> ' ');
************************************************** **************************
#2
UPDATE EHP.ECD_TB A
SET A.ECD_CL_STATUS = B.ECD_CL_STATUS
FROM EHP.ECD_TB A
EHT.ECD_TB B
WHERE B.ECD_CL_STATUS =(SELECT MAX(C.ECD_SEQ_NO),
C.CL_STATUS
FROM EHT.ECD_TB C
EHP.ECD_TB A
WHERE A.ECD_RORO_ID = C.ECD_RORO_ID
AND A.ECD_ED_ID = C.ECD_ED_ID
AND A.ECD_DN = C.ECD_DN
AND A.ECD_DN_SEQ = C.ECD_DN_SEQ
AND A.ECD_SEQ_NO = C.ECD_SEQ_NO
AND A.ECD_REJECT_RSN <> " ");
************************************************** ********
UDATE EHP.ECD_TB A
SET (A.ECD_CL_STATUS) = (SELECT B.ECD_CL_STATUS
FROM EHT.ECD_TB B
WHERE A.ECD_RORO_ID = B.ECD_RORO_ID
AND A.ECD_ED_ID = B.ECD_ED_ID
AND A.ECD_DN = B.ECD_DN
AND A.ECD_DN_SEQ = B.ECD_DN_SEQ
AND A.ECD_SEQ_NO = B.ECD_SEQ_NO
AND A.ECD_REJECT_RSN <> ' '

WHERE EXITS
(SELECT NULL
FROM EHT.ECD_TB B,
EHP.ECD_TB A
WHERE A.ECD_RORO_ID = B.RORO_ID
AND A.ECD_ED_ID = B.ECD_ED_ID
AND A.ECD_DN = B.ECD_DN
AND A.ECD_DN_SEQ = B.ECD_DN_SEQ
AND A.ECD_SEQ_NO = B.ECD_SEQ_NO
AND A.ECD_REJECT_RSN <> ' '

The table - EHP.EHCD_tb is the production table with EHT.EHCD_TB the test table. The column ehcd_claim_status on EHP is to be updated with the contents of the column EHCD_CLAIM_STATUS from EHT.
We have taken the basic shell of the SQL update and made it into a select and it will pull the data from either table with no problem. Just when we try to get it to update it will post a -104 error indicating that a token "." is in error.
The line where it would normally indicate what token that could be used instead, is blank.
Our problem is trying to find out "which" period is it complaining about so we can utilize this code to update our production database.
I'm posting here in the hopes that someone has gone through something similar or has the DB2 experience, and would be able to give me some guidance in what I have done wrong.
Thanking you all in advance,
Buttonpusher