SELECT
  RTRIM(SSCTYP) AS ssctyp,
  RTRIM(SSCCDE) AS ssccde,
  RTRIM(SSCDE1) AS sscde1,
  RTRIM(SSCDE2) AS sscde2,
  RTRIM(SSCDE3) AS sscde3,
  RTRIM(SSCCUSR) AS ssccusr,
  CASE WHEN SSCCDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE SSCCDAT END AS ssccdat,
  SSCCTME AS sscctme,
  RTRIM(SSCUUSR) AS sscuusr,
  CASE WHEN SSCUDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE SSCUDAT END AS sscudat,
  SSCUTME AS sscutme,
  RTRIM(SSCFUT1) AS sscfut1,
  RTRIM(SSCFUT2) AS sscfut2,
  RTRIM(SSCFUT3) AS sscfut3,
  RTRIM(SSCFUT4) AS sscfut4,
  RTRIM(SSCFUT5) AS sscfut5,
  RTRIM(SSCFUT6) AS sscfut6,
  SSCLN AS sscln,
  RTRIM(SSCLNU) AS ssclnu,
  SSCWD AS sscwd,
  RTRIM(SSCWDU) AS sscwdu,
  SSCHG AS sschg,
  RTRIM(SSCHGU) AS sschgu,
  SSCWG AS sscwg,
  RTRIM(SSCWGU) AS sscwgu,
  RTRIM(SSCFGTY) AS sscfgty,
  RTRIM(SSCFGAT) AS sscfgat,
  RTRIM(SSCFGCL) AS sscfgcl,
  RTRIM(SSCFGFT) AS sscfgft,
  RTRIM(SSCFGFZ) AS sscfgfz
FROM LGDAT.SSCC
