zOs/SQL/CATCOLCO

$#@
call sqlConnect DP4G
$*( generate sql to compare the columns of two tables
--cr1 = CMNBATCH
--cr2 = A540769 $*)
$<>
$<=[
with t (tb, crL, crR) as
(
   select 'PLAN_TABLE', 'CMNBATCH', 'A540769' from sysibm.sysDummy1
)
, c as
(
   select c.name col, colType ct, tb, crL, crR, c.*
     from t
      join sysibm.sysColumns c
        on c.tbCreator = crL and c.tbName = t.tb
)
select * from c order by tb, colNo
$] call sqlSel
$|
tb = ''
$forWith i $@=[
     $@ if tb <> $TB & tb \== '' then $@tbEnd
     $@ if tb <> $TB       then $@[tb = $TB; $@tbBegin $]
     $@ call mAdd col, $COL
     || case when l.$COL is null
              and r.$COL is null then ' '

             when l.$COL is null then 'r'
             when r.$COL is null then 'l'
             when l.$COL <> r.$COL then '|'
             else ' '
        end
$]
$@tbEnd
$proc $@/tbBegin/
    $$ select ''
    m.col.0 = 0
$/tbBegin/
$proc $@/tbEnd/
     $do cx=1 to m.col.0 $@=[
         $=col =- m.col.cx
         , value(l.$col
                ,r.$col
                )  $col
         $]
$/tbEnd/
$#out                                              20150211 15:10:54
select ''
     || case when l.QUERYNO is null
              and r.QUERYNO is null then ' '

             when l.QUERYNO is null then 'r'
             when r.QUERYNO is null then 'l'
             when l.QUERYNO <> r.QUERYNO then '|'
             else ' '
        end
     || case when l.QBLOCKNO is null
              and r.QBLOCKNO is null then ' '

             when l.QBLOCKNO is null then 'r'
             when r.QBLOCKNO is null then 'l'
             when l.QBLOCKNO <> r.QBLOCKNO then '|'
             else ' '
        end
     || case when l.APPLNAME is null
              and r.APPLNAME is null then ' '

             when l.APPLNAME is null then 'r'
             when r.APPLNAME is null then 'l'
             when l.APPLNAME <> r.APPLNAME then '|'
             else ' '
        end
     || case when l.PROGNAME is null
              and r.PROGNAME is null then ' '

             when l.PROGNAME is null then 'r'
             when r.PROGNAME is null then 'l'
             when l.PROGNAME <> r.PROGNAME then '|'
             else ' '
        end
     || case when l.PLANNO is null
              and r.PLANNO is null then ' '

             when l.PLANNO is null then 'r'
             when r.PLANNO is null then 'l'
             when l.PLANNO <> r.PLANNO then '|'
             else ' '
        end
     || case when l.METHOD is null
              and r.METHOD is null then ' '

             when l.METHOD is null then 'r'
             when r.METHOD is null then 'l'
             when l.METHOD <> r.METHOD then '|'
             else ' '
        end
     || case when l.CREATOR is null
              and r.CREATOR is null then ' '

             when l.CREATOR is null then 'r'
             when r.CREATOR is null then 'l'
             when l.CREATOR <> r.CREATOR then '|'
             else ' '
        end
     || case when l.TNAME is null
              and r.TNAME is null then ' '

             when l.TNAME is null then 'r'
             when r.TNAME is null then 'l'
             when l.TNAME <> r.TNAME then '|'
             else ' '
        end
     || case when l.TABNO is null
              and r.TABNO is null then ' '

             when l.TABNO is null then 'r'
             when r.TABNO is null then 'l'
             when l.TABNO <> r.TABNO then '|'
             else ' '
        end
     || case when l.ACCESSTYPE is null
              and r.ACCESSTYPE is null then ' '

             when l.ACCESSTYPE is null then 'r'
             when r.ACCESSTYPE is null then 'l'
             when l.ACCESSTYPE <> r.ACCESSTYPE then '|'
             else ' '
        end
     || case when l.MATCHCOLS is null
              and r.MATCHCOLS is null then ' '

             when l.MATCHCOLS is null then 'r'
             when r.MATCHCOLS is null then 'l'
             when l.MATCHCOLS <> r.MATCHCOLS then '|'
             else ' '
        end
     || case when l.ACCESSCREATOR is null
              and r.ACCESSCREATOR is null then ' '

             when l.ACCESSCREATOR is null then 'r'
             when r.ACCESSCREATOR is null then 'l'
             when l.ACCESSCREATOR <> r.ACCESSCREATOR then '|'
             else ' '
        end
     || case when l.ACCESSNAME is null
              and r.ACCESSNAME is null then ' '

             when l.ACCESSNAME is null then 'r'
             when r.ACCESSNAME is null then 'l'
             when l.ACCESSNAME <> r.ACCESSNAME then '|'
             else ' '
        end
     || case when l.INDEXONLY is null
              and r.INDEXONLY is null then ' '

             when l.INDEXONLY is null then 'r'
             when r.INDEXONLY is null then 'l'
             when l.INDEXONLY <> r.INDEXONLY then '|'
             else ' '
        end
     || case when l.SORTN_UNIQ is null
              and r.SORTN_UNIQ is null then ' '

             when l.SORTN_UNIQ is null then 'r'
             when r.SORTN_UNIQ is null then 'l'
             when l.SORTN_UNIQ <> r.SORTN_UNIQ then '|'
             else ' '
        end
     || case when l.SORTN_JOIN is null
              and r.SORTN_JOIN is null then ' '

             when l.SORTN_JOIN is null then 'r'
             when r.SORTN_JOIN is null then 'l'
             when l.SORTN_JOIN <> r.SORTN_JOIN then '|'
             else ' '
        end
     || case when l.SORTN_ORDERBY is null
              and r.SORTN_ORDERBY is null then ' '

             when l.SORTN_ORDERBY is null then 'r'
             when r.SORTN_ORDERBY is null then 'l'
             when l.SORTN_ORDERBY <> r.SORTN_ORDERBY then '|'
             else ' '
        end
     || case when l.SORTN_GROUPBY is null
              and r.SORTN_GROUPBY is null then ' '

             when l.SORTN_GROUPBY is null then 'r'
             when r.SORTN_GROUPBY is null then 'l'
             when l.SORTN_GROUPBY <> r.SORTN_GROUPBY then '|'
             else ' '
        end
     || case when l.SORTC_UNIQ is null
              and r.SORTC_UNIQ is null then ' '

             when l.SORTC_UNIQ is null then 'r'
             when r.SORTC_UNIQ is null then 'l'
             when l.SORTC_UNIQ <> r.SORTC_UNIQ then '|'
             else ' '
        end
     || case when l.SORTC_JOIN is null
              and r.SORTC_JOIN is null then ' '

             when l.SORTC_JOIN is null then 'r'
             when r.SORTC_JOIN is null then 'l'
             when l.SORTC_JOIN <> r.SORTC_JOIN then '|'
             else ' '
        end
     || case when l.SORTC_ORDERBY is null
              and r.SORTC_ORDERBY is null then ' '

             when l.SORTC_ORDERBY is null then 'r'
             when r.SORTC_ORDERBY is null then 'l'
             when l.SORTC_ORDERBY <> r.SORTC_ORDERBY then '|'
             else ' '
        end
     || case when l.SORTC_GROUPBY is null
              and r.SORTC_GROUPBY is null then ' '

             when l.SORTC_GROUPBY is null then 'r'
             when r.SORTC_GROUPBY is null then 'l'
             when l.SORTC_GROUPBY <> r.SORTC_GROUPBY then '|'
             else ' '
        end
     || case when l.TSLOCKMODE is null
              and r.TSLOCKMODE is null then ' '

             when l.TSLOCKMODE is null then 'r'
             when r.TSLOCKMODE is null then 'l'
             when l.TSLOCKMODE <> r.TSLOCKMODE then '|'
             else ' '
        end
     || case when l.TIMESTAMP is null
              and r.TIMESTAMP is null then ' '

             when l.TIMESTAMP is null then 'r'
             when r.TIMESTAMP is null then 'l'
             when l.TIMESTAMP <> r.TIMESTAMP then '|'
             else ' '
        end
     || case when l.REMARKS is null
              and r.REMARKS is null then ' '

             when l.REMARKS is null then 'r'
             when r.REMARKS is null then 'l'
             when l.REMARKS <> r.REMARKS then '|'
             else ' '
        end
     || case when l.PREFETCH is null
              and r.PREFETCH is null then ' '

             when l.PREFETCH is null then 'r'
             when r.PREFETCH is null then 'l'
             when l.PREFETCH <> r.PREFETCH then '|'
             else ' '
        end
     || case when l.COLUMN_FN_EVAL is null
              and r.COLUMN_FN_EVAL is null then ' '

             when l.COLUMN_FN_EVAL is null then 'r'
             when r.COLUMN_FN_EVAL is null then 'l'
             when l.COLUMN_FN_EVAL <> r.COLUMN_FN_EVAL then '|'
             else ' '
        end
     || case when l.MIXOPSEQ is null
              and r.MIXOPSEQ is null then ' '

             when l.MIXOPSEQ is null then 'r'
             when r.MIXOPSEQ is null then 'l'
             when l.MIXOPSEQ <> r.MIXOPSEQ then '|'
             else ' '
        end
     || case when l.VERSION is null
              and r.VERSION is null then ' '

             when l.VERSION is null then 'r'
             when r.VERSION is null then 'l'
             when l.VERSION <> r.VERSION then '|'
             else ' '
        end
     || case when l.COLLID is null
              and r.COLLID is null then ' '

             when l.COLLID is null then 'r'
             when r.COLLID is null then 'l'
             when l.COLLID <> r.COLLID then '|'
             else ' '
        end
     || case when l.ACCESS_DEGREE is null
              and r.ACCESS_DEGREE is null then ' '

             when l.ACCESS_DEGREE is null then 'r'
             when r.ACCESS_DEGREE is null then 'l'
             when l.ACCESS_DEGREE <> r.ACCESS_DEGREE then '|'
             else ' '
        end
     || case when l.ACCESS_PGROUP_ID is null
              and r.ACCESS_PGROUP_ID is null then ' '

             when l.ACCESS_PGROUP_ID is null then 'r'
             when r.ACCESS_PGROUP_ID is null then 'l'
             when l.ACCESS_PGROUP_ID <> r.ACCESS_PGROUP_ID then '|'
             else ' '
        end
     || case when l.JOIN_DEGREE is null
              and r.JOIN_DEGREE is null then ' '

             when l.JOIN_DEGREE is null then 'r'
             when r.JOIN_DEGREE is null then 'l'
             when l.JOIN_DEGREE <> r.JOIN_DEGREE then '|'
             else ' '
        end
     || case when l.JOIN_PGROUP_ID is null
              and r.JOIN_PGROUP_ID is null then ' '

             when l.JOIN_PGROUP_ID is null then 'r'
             when r.JOIN_PGROUP_ID is null then 'l'
             when l.JOIN_PGROUP_ID <> r.JOIN_PGROUP_ID then '|'
             else ' '
        end
     || case when l.SORTC_PGROUP_ID is null
              and r.SORTC_PGROUP_ID is null then ' '

             when l.SORTC_PGROUP_ID is null then 'r'
             when r.SORTC_PGROUP_ID is null then 'l'
             when l.SORTC_PGROUP_ID <> r.SORTC_PGROUP_ID then '|'
             else ' '
        end
     || case when l.SORTN_PGROUP_ID is null
              and r.SORTN_PGROUP_ID is null then ' '

             when l.SORTN_PGROUP_ID is null then 'r'
             when r.SORTN_PGROUP_ID is null then 'l'
             when l.SORTN_PGROUP_ID <> r.SORTN_PGROUP_ID then '|'
             else ' '
        end
     || case when l.PARALLELISM_MODE is null
              and r.PARALLELISM_MODE is null then ' '

             when l.PARALLELISM_MODE is null then 'r'
             when r.PARALLELISM_MODE is null then 'l'
             when l.PARALLELISM_MODE <> r.PARALLELISM_MODE then '|'
             else ' '
        end
     || case when l.MERGE_JOIN_COLS is null
              and r.MERGE_JOIN_COLS is null then ' '

             when l.MERGE_JOIN_COLS is null then 'r'
             when r.MERGE_JOIN_COLS is null then 'l'
             when l.MERGE_JOIN_COLS <> r.MERGE_JOIN_COLS then '|'
             else ' '
        end
     || case when l.CORRELATION_NAME is null
              and r.CORRELATION_NAME is null then ' '

             when l.CORRELATION_NAME is null then 'r'
             when r.CORRELATION_NAME is null then 'l'
             when l.CORRELATION_NAME <> r.CORRELATION_NAME then '|'
             else ' '
        end
     || case when l.PAGE_RANGE is null
              and r.PAGE_RANGE is null then ' '

             when l.PAGE_RANGE is null then 'r'
             when r.PAGE_RANGE is null then 'l'
             when l.PAGE_RANGE <> r.PAGE_RANGE then '|'
             else ' '
        end
     || case when l.JOIN_TYPE is null
              and r.JOIN_TYPE is null then ' '

             when l.JOIN_TYPE is null then 'r'
             when r.JOIN_TYPE is null then 'l'
             when l.JOIN_TYPE <> r.JOIN_TYPE then '|'
             else ' '
        end
     || case when l.GROUP_MEMBER is null
              and r.GROUP_MEMBER is null then ' '

             when l.GROUP_MEMBER is null then 'r'
             when r.GROUP_MEMBER is null then 'l'
             when l.GROUP_MEMBER <> r.GROUP_MEMBER then '|'
             else ' '
        end
     || case when l.IBM_SERVICE_DATA is null
              and r.IBM_SERVICE_DATA is null then ' '

             when l.IBM_SERVICE_DATA is null then 'r'
             when r.IBM_SERVICE_DATA is null then 'l'
             when l.IBM_SERVICE_DATA <> r.IBM_SERVICE_DATA then '|'
             else ' '
        end
     || case when l.WHEN_OPTIMIZE is null
              and r.WHEN_OPTIMIZE is null then ' '

             when l.WHEN_OPTIMIZE is null then 'r'
             when r.WHEN_OPTIMIZE is null then 'l'
             when l.WHEN_OPTIMIZE <> r.WHEN_OPTIMIZE then '|'
             else ' '
        end
     || case when l.QBLOCK_TYPE is null
              and r.QBLOCK_TYPE is null then ' '

             when l.QBLOCK_TYPE is null then 'r'
             when r.QBLOCK_TYPE is null then 'l'
             when l.QBLOCK_TYPE <> r.QBLOCK_TYPE then '|'
             else ' '
        end
     || case when l.BIND_TIME is null
              and r.BIND_TIME is null then ' '

             when l.BIND_TIME is null then 'r'
             when r.BIND_TIME is null then 'l'
             when l.BIND_TIME <> r.BIND_TIME then '|'
             else ' '
        end
     || case when l.OPTHINT is null
              and r.OPTHINT is null then ' '

             when l.OPTHINT is null then 'r'
             when r.OPTHINT is null then 'l'
             when l.OPTHINT <> r.OPTHINT then '|'
             else ' '
        end
     || case when l.HINT_USED is null
              and r.HINT_USED is null then ' '

             when l.HINT_USED is null then 'r'
             when r.HINT_USED is null then 'l'
             when l.HINT_USED <> r.HINT_USED then '|'
             else ' '
        end
     || case when l.PRIMARY_ACCESSTYPE is null
              and r.PRIMARY_ACCESSTYPE is null then ' '

             when l.PRIMARY_ACCESSTYPE is null then 'r'
             when r.PRIMARY_ACCESSTYPE is null then 'l'
             when l.PRIMARY_ACCESSTYPE <> r.PRIMARY_ACCESSTYPE then '|'
             else ' '
        end
     || case when l.PARENT_QBLOCKNO is null
              and r.PARENT_QBLOCKNO is null then ' '

             when l.PARENT_QBLOCKNO is null then 'r'
             when r.PARENT_QBLOCKNO is null then 'l'
             when l.PARENT_QBLOCKNO <> r.PARENT_QBLOCKNO then '|'
             else ' '
        end
     || case when l.TABLE_TYPE is null
              and r.TABLE_TYPE is null then ' '

             when l.TABLE_TYPE is null then 'r'
             when r.TABLE_TYPE is null then 'l'
             when l.TABLE_TYPE <> r.TABLE_TYPE then '|'
             else ' '
        end
     || case when l.TABLE_ENCODE is null
              and r.TABLE_ENCODE is null then ' '

             when l.TABLE_ENCODE is null then 'r'
             when r.TABLE_ENCODE is null then 'l'
             when l.TABLE_ENCODE <> r.TABLE_ENCODE then '|'
             else ' '
        end
     || case when l.TABLE_SCCSID is null
              and r.TABLE_SCCSID is null then ' '

             when l.TABLE_SCCSID is null then 'r'
             when r.TABLE_SCCSID is null then 'l'
             when l.TABLE_SCCSID <> r.TABLE_SCCSID then '|'
             else ' '
        end
     || case when l.TABLE_MCCSID is null
              and r.TABLE_MCCSID is null then ' '

             when l.TABLE_MCCSID is null then 'r'
             when r.TABLE_MCCSID is null then 'l'
             when l.TABLE_MCCSID <> r.TABLE_MCCSID then '|'
             else ' '
        end
     || case when l.TABLE_DCCSID is null
              and r.TABLE_DCCSID is null then ' '

             when l.TABLE_DCCSID is null then 'r'
             when r.TABLE_DCCSID is null then 'l'
             when l.TABLE_DCCSID <> r.TABLE_DCCSID then '|'
             else ' '
        end
     || case when l.ROUTINE_ID is null
              and r.ROUTINE_ID is null then ' '

             when l.ROUTINE_ID is null then 'r'
             when r.ROUTINE_ID is null then 'l'
             when l.ROUTINE_ID <> r.ROUTINE_ID then '|'
             else ' '
        end
     || case when l.CTEREF is null
              and r.CTEREF is null then ' '

             when l.CTEREF is null then 'r'
             when r.CTEREF is null then 'l'
             when l.CTEREF <> r.CTEREF then '|'
             else ' '
        end
     || case when l.STMTTOKEN is null
              and r.STMTTOKEN is null then ' '

             when l.STMTTOKEN is null then 'r'
             when r.STMTTOKEN is null then 'l'
             when l.STMTTOKEN <> r.STMTTOKEN then '|'
             else ' '
        end
     || case when l.PARENT_PLANNO is null
              and r.PARENT_PLANNO is null then ' '

             when l.PARENT_PLANNO is null then 'r'
             when r.PARENT_PLANNO is null then 'l'
             when l.PARENT_PLANNO <> r.PARENT_PLANNO then '|'
             else ' '
        end
     || case when l.BIND_EXPLAIN_ONLY is null
              and r.BIND_EXPLAIN_ONLY is null then ' '

             when l.BIND_EXPLAIN_ONLY is null then 'r'
             when r.BIND_EXPLAIN_ONLY is null then 'l'
             when l.BIND_EXPLAIN_ONLY <> r.BIND_EXPLAIN_ONLY then '|'
             else ' '
        end
     || case when l.SECTNOI is null
              and r.SECTNOI is null then ' '

             when l.SECTNOI is null then 'r'
             when r.SECTNOI is null then 'l'
             when l.SECTNOI <> r.SECTNOI then '|'
             else ' '
        end
     || case when l.EXPLAIN_TIME is null
              and r.EXPLAIN_TIME is null then ' '

             when l.EXPLAIN_TIME is null then 'r'
             when r.EXPLAIN_TIME is null then 'l'
             when l.EXPLAIN_TIME <> r.EXPLAIN_TIME then '|'
             else ' '
        end
     || case when l.MERGC is null
              and r.MERGC is null then ' '

             when l.MERGC is null then 'r'
             when r.MERGC is null then 'l'
             when l.MERGC <> r.MERGC then '|'
             else ' '
        end
     || case when l.MERGN is null
              and r.MERGN is null then ' '

             when l.MERGN is null then 'r'
             when r.MERGN is null then 'l'
             when l.MERGN <> r.MERGN then '|'
             else ' '
        end
         , value(l.QUERYNO
                ,r.QUERYNO
                )  QUERYNO
         , value(l.QBLOCKNO
                ,r.QBLOCKNO
                )  QBLOCKNO
         , value(l.APPLNAME
                ,r.APPLNAME
                )  APPLNAME
         , value(l.PROGNAME
                ,r.PROGNAME
                )  PROGNAME
         , value(l.PLANNO
                ,r.PLANNO
                )  PLANNO
         , value(l.METHOD
                ,r.METHOD
                )  METHOD
         , value(l.CREATOR
                ,r.CREATOR
                )  CREATOR
         , value(l.TNAME
                ,r.TNAME
                )  TNAME
         , value(l.TABNO
                ,r.TABNO
                )  TABNO
         , value(l.ACCESSTYPE
                ,r.ACCESSTYPE
                )  ACCESSTYPE
         , value(l.MATCHCOLS
                ,r.MATCHCOLS
                )  MATCHCOLS
         , value(l.ACCESSCREATOR
                ,r.ACCESSCREATOR
                )  ACCESSCREATOR
         , value(l.ACCESSNAME
                ,r.ACCESSNAME
                )  ACCESSNAME
         , value(l.INDEXONLY
                ,r.INDEXONLY
                )  INDEXONLY
         , value(l.SORTN_UNIQ
                ,r.SORTN_UNIQ
                )  SORTN_UNIQ
         , value(l.SORTN_JOIN
                ,r.SORTN_JOIN
                )  SORTN_JOIN
         , value(l.SORTN_ORDERBY
                ,r.SORTN_ORDERBY
                )  SORTN_ORDERBY
         , value(l.SORTN_GROUPBY
                ,r.SORTN_GROUPBY
                )  SORTN_GROUPBY
         , value(l.SORTC_UNIQ
                ,r.SORTC_UNIQ
                )  SORTC_UNIQ
         , value(l.SORTC_JOIN
                ,r.SORTC_JOIN
                )  SORTC_JOIN
         , value(l.SORTC_ORDERBY
                ,r.SORTC_ORDERBY
                )  SORTC_ORDERBY
         , value(l.SORTC_GROUPBY
                ,r.SORTC_GROUPBY
                )  SORTC_GROUPBY
         , value(l.TSLOCKMODE
                ,r.TSLOCKMODE
                )  TSLOCKMODE
         , value(l.TIMESTAMP
                ,r.TIMESTAMP
                )  TIMESTAMP
         , value(l.REMARKS
                ,r.REMARKS
                )  REMARKS
         , value(l.PREFETCH
                ,r.PREFETCH
                )  PREFETCH
         , value(l.COLUMN_FN_EVAL
                ,r.COLUMN_FN_EVAL
                )  COLUMN_FN_EVAL
         , value(l.MIXOPSEQ
                ,r.MIXOPSEQ
                )  MIXOPSEQ
         , value(l.VERSION
                ,r.VERSION
                )  VERSION
         , value(l.COLLID
                ,r.COLLID
                )  COLLID
         , value(l.ACCESS_DEGREE
                ,r.ACCESS_DEGREE
                )  ACCESS_DEGREE
         , value(l.ACCESS_PGROUP_ID
                ,r.ACCESS_PGROUP_ID
                )  ACCESS_PGROUP_ID
         , value(l.JOIN_DEGREE
                ,r.JOIN_DEGREE
                )  JOIN_DEGREE
         , value(l.JOIN_PGROUP_ID
                ,r.JOIN_PGROUP_ID
                )  JOIN_PGROUP_ID
         , value(l.SORTC_PGROUP_ID
                ,r.SORTC_PGROUP_ID
                )  SORTC_PGROUP_ID
         , value(l.SORTN_PGROUP_ID
                ,r.SORTN_PGROUP_ID
                )  SORTN_PGROUP_ID
         , value(l.PARALLELISM_MODE
                ,r.PARALLELISM_MODE
                )  PARALLELISM_MODE
         , value(l.MERGE_JOIN_COLS
                ,r.MERGE_JOIN_COLS
                )  MERGE_JOIN_COLS
         , value(l.CORRELATION_NAME
                ,r.CORRELATION_NAME
                )  CORRELATION_NAME
         , value(l.PAGE_RANGE
                ,r.PAGE_RANGE
                )  PAGE_RANGE
         , value(l.JOIN_TYPE
                ,r.JOIN_TYPE
                )  JOIN_TYPE
         , value(l.GROUP_MEMBER
                ,r.GROUP_MEMBER
                )  GROUP_MEMBER
         , value(l.IBM_SERVICE_DATA
                ,r.IBM_SERVICE_DATA
                )  IBM_SERVICE_DATA
         , value(l.WHEN_OPTIMIZE
                ,r.WHEN_OPTIMIZE
                )  WHEN_OPTIMIZE
         , value(l.QBLOCK_TYPE
                ,r.QBLOCK_TYPE
                )  QBLOCK_TYPE
         , value(l.BIND_TIME
                ,r.BIND_TIME
                )  BIND_TIME
         , value(l.OPTHINT
                ,r.OPTHINT
                )  OPTHINT
         , value(l.HINT_USED
                ,r.HINT_USED
                )  HINT_USED
         , value(l.PRIMARY_ACCESSTYPE
                ,r.PRIMARY_ACCESSTYPE
                )  PRIMARY_ACCESSTYPE
         , value(l.PARENT_QBLOCKNO
                ,r.PARENT_QBLOCKNO
                )  PARENT_QBLOCKNO
         , value(l.TABLE_TYPE
                ,r.TABLE_TYPE
                )  TABLE_TYPE
         , value(l.TABLE_ENCODE
                ,r.TABLE_ENCODE
                )  TABLE_ENCODE
         , value(l.TABLE_SCCSID
                ,r.TABLE_SCCSID
                )  TABLE_SCCSID
         , value(l.TABLE_MCCSID
                ,r.TABLE_MCCSID
                )  TABLE_MCCSID
         , value(l.TABLE_DCCSID
                ,r.TABLE_DCCSID
                )  TABLE_DCCSID
         , value(l.ROUTINE_ID
                ,r.ROUTINE_ID
                )  ROUTINE_ID
         , value(l.CTEREF
                ,r.CTEREF
                )  CTEREF
         , value(l.STMTTOKEN
                ,r.STMTTOKEN
                )  STMTTOKEN
         , value(l.PARENT_PLANNO
                ,r.PARENT_PLANNO
                )  PARENT_PLANNO
         , value(l.BIND_EXPLAIN_ONLY
                ,r.BIND_EXPLAIN_ONLY
                )  BIND_EXPLAIN_ONLY
         , value(l.SECTNOI
                ,r.SECTNOI
                )  SECTNOI
         , value(l.EXPLAIN_TIME
                ,r.EXPLAIN_TIME
                )  EXPLAIN_TIME
         , value(l.MERGC
                ,r.MERGC
                )  MERGC
         , value(l.MERGN
                ,r.MERGN
                )  MERGN
$#out                                              20150211 15:09:47