Ln:1 CREATE TABLE
Ln:1 CREATE TABLE tab
  (
    SOURCE_ID  INT,
    RUN_ID     INT,
    STATUS     CHAR,
    LOAD_START timestamp(0),
    LOAD_END   timestamp(0)
  )
Ln:10 CREATE TABLE
Ln:10 CREATE TABLE ctl
AS
(
        SELECT
                EBC.SOURCE_ID, MAX(EBC.RUN_ID) AS RUN_ID, EBC.STATUS, EBC.LOAD_START, EBC.LOAD_END
        FROM EBC
        WHERE EBC.SOURCE_ID = 451 AND EBC.STATUS = 'R'
        GROUP BY
                1,3,4,5
)
Ln:28 CREATE LOCAL TEMPORARY TABLE
CREATE TEMPORARY TABLE ctl2
AS
(
        SELECT
                EBC.SOURCE_ID, MAX(EBC.RUN_ID) AS RUN_ID, EBC.STATUS, EBC.LOAD_START, EBC.LOAD_END
        FROM EBC
        WHERE EBC.SOURCE_ID = 451 AND EBC.STATUS = 'R'
        GROUP BY
                1,3,4,5
)