ancheswaroop
Programmer
select
substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,5,2) || substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,7,2)
|| substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,3,2) as CHDATE,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_TIME,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_TRANSACTION_AMOUNT,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_APPROVAL_CODE,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_MERCHANT_ID,
TEDCLZ.CA_AUTH_DLY_FILE.HASH_SRC_CRCD_I
from
TEDCLZ.CA_AUTH_DLY_FILE
left join
TEDCLZ.NEW_DAILY_AUTH_REC_IN
on
CHDATE = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_TRANSACTION_TIME
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_TRANSACTION_AMOUNT = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_TRANSACTION_AMOUNT
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_APPROVAL_CODE = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_APPROVAL_CODE
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_MERCHANT_ID = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_MERCHANT_ID
and TEDCLZ.CA_AUTH_DLY_FILE.HASH_SRC_CRCD_I = TEDCLZ.NEW_DAILY_AUTH_REC_IN.HASH_SRC_CRCD_I
and TEDCLZ.CA_AUTH_DLY_FILE.BATCH_LOAD_NUMBER = TEDCLZ.NEW_DAILY_AUTH_REC_IN.BATCH_LOAD_NUMBER
where TEDCLZ.CA_AUTH_DLY_FILE.BATCH_LOAD_NUMBER =1100
and TEDCLZ.NEW_DAILY_AUTH_REC_IN.BATCH_LOAD_NUMBER =1100
and this is the error message
DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: CHDATE
Message: "CHDATE" is not valid in the context where it is used.
substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,5,2) || substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,7,2)
|| substr(TEDCLZ.CA_AUTH_DLY_FILE.LG3_DATE,3,2) as CHDATE,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_TIME,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_TRANSACTION_AMOUNT,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_APPROVAL_CODE,
TEDCLZ.CA_AUTH_DLY_FILE.LG3_MERCHANT_ID,
TEDCLZ.CA_AUTH_DLY_FILE.HASH_SRC_CRCD_I
from
TEDCLZ.CA_AUTH_DLY_FILE
left join
TEDCLZ.NEW_DAILY_AUTH_REC_IN
on
CHDATE = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_TRANSACTION_TIME
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_TRANSACTION_AMOUNT = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_TRANSACTION_AMOUNT
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_APPROVAL_CODE = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_APPROVAL_CODE
and TEDCLZ.CA_AUTH_DLY_FILE.LG3_MERCHANT_ID = TEDCLZ.NEW_DAILY_AUTH_REC_IN.IN_MERCHANT_ID
and TEDCLZ.CA_AUTH_DLY_FILE.HASH_SRC_CRCD_I = TEDCLZ.NEW_DAILY_AUTH_REC_IN.HASH_SRC_CRCD_I
and TEDCLZ.CA_AUTH_DLY_FILE.BATCH_LOAD_NUMBER = TEDCLZ.NEW_DAILY_AUTH_REC_IN.BATCH_LOAD_NUMBER
where TEDCLZ.CA_AUTH_DLY_FILE.BATCH_LOAD_NUMBER =1100
and TEDCLZ.NEW_DAILY_AUTH_REC_IN.BATCH_LOAD_NUMBER =1100
and this is the error message
DB2 SQL error: SQLCODE: -206, SQLSTATE: 42703, SQLERRMC: CHDATE
Message: "CHDATE" is not valid in the context where it is used.