Hello all, this is part of a sqlrpgle code that i am working with right now. I need help understanding what it is actually doing.
The Code:
couple things to note: ZCC is a "table" with fields that start with "CC"
:WRKRANK is a packed 2:0
Here is what I understand so far.
Insert into QTEMP/EDIPF // put the following into the EDIPF file inside the QTEMP library
(SELECT EMDID, EMBOX From EDI4XXDTA/EDMAST // get fields EMDID and EMBOX from EDMAST inside the EDI4XXDTA library
Join EDI4XXDTA/EDMTAB on EMFAST = MBMSTS // join EMFAST from EDMAST and MBMSTS from EDMTAB
Where
EMDID IN (Select CAST(CCDESC as char) from ZCC // from here I don't understand...
Where CCSDSC = CAST(:WRKRANK as GRAPHIC))
And EMFAST not in (Select CAST(CCDESC as char) from ZCC)
EDIT: I know how the cast works, just need help with the sql bits!
The Code:
Code:
Insert into QTEMP/EDIPF (SELECT EMDID, EMBOX From EDI4XXDTA/EDMAST Join EDI4XXDTA/EDMTAB on EMFAST = MBMSTS Where EMDID IN (Select CAST(CCDESC as char) from ZCC Where CCSDSC = CAST(:WRKRANK as GRAPHIC)) And EMFAST not in (Select CAST(CCDESC as char) from ZCC) GROUP BY EMDID, EMBOX ORDER BY EMDID, EMBOX);
:WRKRANK is a packed 2:0
Here is what I understand so far.
Insert into QTEMP/EDIPF // put the following into the EDIPF file inside the QTEMP library
(SELECT EMDID, EMBOX From EDI4XXDTA/EDMAST // get fields EMDID and EMBOX from EDMAST inside the EDI4XXDTA library
Join EDI4XXDTA/EDMTAB on EMFAST = MBMSTS // join EMFAST from EDMAST and MBMSTS from EDMTAB
Where
EMDID IN (Select CAST(CCDESC as char) from ZCC // from here I don't understand...
Where CCSDSC = CAST(:WRKRANK as GRAPHIC))
And EMFAST not in (Select CAST(CCDESC as char) from ZCC)
EDIT: I know how the cast works, just need help with the sql bits!
Comment