SELECT
  RTRIM(BSMJCD) AS bsmjcd,
  RTRIM(BSMNCD) AS bsmncd,
  RTRIM(BSDES1) AS bsdes1,
  RTRIM(BSDES2) AS bsdes2,
  CASE WHEN BSDATE IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE BSDATE END AS bsdate
FROM LGDAT.MMSL
