zOs/SQL/CATUNLOA
select ', ' || strip(c.name) || ' '
|| case when c.colType in ('DATE', 'TIME', 'TIMESTAMP')
then strip(c.colType) || ' EXTERNAL'
else strip(c.colType) end
, c.colNo, c.coltype, c.Name col
, t.dbName db, t.tsName ts, t.name tb, t.type
from sysibm.sysTables t
join sysibm.sysColumns c
on t.creator = c.tbCreator and t.name = c.tbName
and t.dbName = 'CSQDP2G'
and t.name = 'ADMIN_B_MESSAGES'
where t.type = 'T'
order by t.dbName, t.tsName, t.name
, case when strip(c.colType) like '_LOB'
or c.colType = 'XML' then 1 else 0 end
, c.colNo