SELECT
  RTRIM(Y3PART) AS y3part,
  RTRIM(Y3PLNT) AS y3plnt,
  Y3STCS AS y3stcs,
  Y3ACCS AS y3accs,
  Y3AVCS AS y3avcs,
  Y3SUC AS y3suc,
  Y3SSHR AS y3sshr,
  Y3SSHC AS y3sshc,
  Y3SOC AS y3soc,
  CASE WHEN Y3SDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE Y3SDAT END AS y3sdat,
  Y3SQTY AS y3sqty,
  Y3LUC AS y3luc,
  Y3LSHC AS y3lshc,
  Y3LOC AS y3loc,
  Y3AQTY AS y3aqty,
  RTRIM(Y3TYPE) AS y3type,
  Y3SMAT AS y3smat,
  Y3SLAB AS y3slab,
  Y3SVBR AS y3svbr,
  Y3SFBR AS y3sfbr,
  Y3SOTC AS y3sotc,
  Y3LMAT AS y3lmat,
  Y3LLAB AS y3llab,
  Y3LVBR AS y3lvbr,
  Y3LFBR AS y3lfbr,
  Y3LOTC AS y3lotc,
  Y3AMAT AS y3amat,
  Y3ALAB AS y3alab,
  Y3AVBR AS y3avbr,
  Y3AFBR AS y3afbr,
  Y3AOTC AS y3aotc,
  Y3AUNC AS y3aunc,
  Y3ASHC AS y3ashc,
  Y3ACRC AS y3acrc,
  RTRIM(Y3FUT1) AS y3fut1,
  RTRIM(Y3FUT2) AS y3fut2,
  RTRIM(Y3FUT3) AS y3fut3,
  Y3FUT4 AS y3fut4,
  Y3FUT5 AS y3fut5,
  RTRIM(Y3FLG1) AS y3flg1,
  RTRIM(Y3FLG2) AS y3flg2,
  RTRIM(Y3FLG3) AS y3flg3,
  RTRIM(Y3CRCD) AS y3crcd,
  Y3STCR AS y3stcr,
  Y3LSCR AS y3lscr
FROM LGDAT.FTCSTR
