SELECT
  RTRIM(JBTYPE) AS jbtype,
  RTRIM(JBCODE) AS jbcode,
  RTRIM(JBPLCD) AS jbplcd,
  CASE WHEN JBFDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE JBFDAT END AS jbfdat,
  CASE WHEN JBTDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE JBTDAT END AS jbtdat,
  RTRIM(JBDISC) AS jbdisc,
  RTRIM(JBDIST) AS jbdist,
  RTRIM(JBUSEG) AS jbuseg,
  RTRIM(JBFLG1) AS jbflg1,
  RTRIM(JBFLG2) AS jbflg2,
  RTRIM(JBFLG3) AS jbflg3,
  RTRIM(JBFLG4) AS jbflg4,
  RTRIM(JBFLG5) AS jbflg5,
  RTRIM(JBFUT1) AS jbfut1,
  RTRIM(JBFUT2) AS jbfut2,
  RTRIM(JBFUT3) AS jbfut3,
  RTRIM(JBFUT4) AS jbfut4,
  RTRIM(JBFUT5) AS jbfut5,
  RTRIM(JBFUT6) AS jbfut6,
  RTRIM(JBFUT7) AS jbfut7,
  RTRIM(JBFUT8) AS jbfut8,
  RTRIM(JBFUT9) AS jbfut9,
  RTRIM(JBFUT10) AS jbfut10,
  RTRIM(JBFUT11) AS jbfut11,
  RTRIM(JBFUT12) AS jbfut12,
  RTRIM(JBFUT13) AS jbfut13,
  RTRIM(JBFUT14) AS jbfut14,
  RTRIM(JBFUT15) AS jbfut15,
  RTRIM(JBFUT16) AS jbfut16,
  RTRIM(JBFUT17) AS jbfut17,
  RTRIM(JBFUT18) AS jbfut18,
  RTRIM(JBFUT19) AS jbfut19,
  RTRIM(JBFUT20) AS jbfut20,
  RTRIM(JBFUT21) AS jbfut21,
  RTRIM(JBFUT22) AS jbfut22,
  RTRIM(JBFUT23) AS jbfut23,
  RTRIM(JBFUT24) AS jbfut24,
  RTRIM(JBFUT25) AS jbfut25,
  JBFUT26 AS jbfut26,
  JBFUT27 AS jbfut27,
  JBFUT28 AS jbfut28,
  JBFUT29 AS jbfut29,
  JBFUT30 AS jbfut30,
  JBFUT31 AS jbfut31,
  JBFUT32 AS jbfut32,
  JBFUT33 AS jbfut33,
  JBFUT34 AS jbfut34,
  JBFUT35 AS jbfut35
FROM LGDAT.IPRCB
