SELECT
  DW5COMN AS dw5comn,
  RTRIM(DW5STS) AS dw5sts,
  DW5SYPR AS dw5sypr,
  RTRIM(DW5SETO) AS dw5seto,
  DW5LYPR AS dw5lypr,
  DW5TAGL AS dw5tagl,
  RTRIM(DW5CUSR) AS dw5cusr,
  CASE WHEN DW5CDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE DW5CDAT END AS dw5cdat,
  DW5CTME AS dw5ctme,
  RTRIM(DW5UUSR) AS dw5uusr,
  CASE WHEN DW5UDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE DW5UDAT END AS dw5udat,
  DW5UTME AS dw5utme,
  RTRIM(DW5RSET) AS dw5rset
FROM LGDAT.GLCC
