SELECT
  RTRIM(Y0PART) AS y0part,
  RTRIM(Y0PLNT) AS y0plnt,
  Y0STCS AS y0stcs,
  Y0ACCS AS y0accs,
  Y0AVCS AS y0avcs,
  Y0SUC AS y0suc,
  Y0SSHR AS y0sshr,
  Y0SSHC AS y0sshc,
  Y0SOC AS y0soc,
  CASE WHEN Y0SDAT IN (DATE('0001-01-01'), DATE('9999-12-31')) THEN NULL ELSE Y0SDAT END AS y0sdat,
  Y0SQTY AS y0sqty,
  Y0LUC AS y0luc,
  Y0LSHC AS y0lshc,
  Y0LOC AS y0loc,
  Y0AQTY AS y0aqty,
  RTRIM(Y0TYPE) AS y0type,
  Y0SMAT AS y0smat,
  Y0SLAB AS y0slab,
  Y0SVBR AS y0svbr,
  Y0SFBR AS y0sfbr,
  Y0SOTC AS y0sotc,
  Y0LMAT AS y0lmat,
  Y0LLAB AS y0llab,
  Y0LVBR AS y0lvbr,
  Y0LFBR AS y0lfbr,
  Y0LOTC AS y0lotc,
  Y0AMAT AS y0amat,
  Y0ALAB AS y0alab,
  Y0AVBR AS y0avbr,
  Y0AFBR AS y0afbr,
  Y0AOTC AS y0aotc,
  Y0AUNC AS y0aunc,
  Y0ASHC AS y0ashc,
  Y0ACRC AS y0acrc,
  RTRIM(Y0FUT1) AS y0fut1,
  RTRIM(Y0FUT2) AS y0fut2,
  RTRIM(Y0FUT3) AS y0fut3,
  Y0FUT4 AS y0fut4,
  Y0FUT5 AS y0fut5,
  RTRIM(Y0FLG1) AS y0flg1,
  RTRIM(Y0FLG2) AS y0flg2,
  RTRIM(Y0FLG3) AS y0flg3,
  RTRIM(Y0CRCD) AS y0crcd,
  Y0STCR AS y0stcr,
  Y0LSCR AS y0lscr,
  RTRIM(Y0FUT6) AS y0fut6,
  RTRIM(Y0FUT7) AS y0fut7,
  RTRIM(Y0FUT8) AS y0fut8,
  RTRIM(Y0FUT9) AS y0fut9,
  RTRIM(Y0FUT10) AS y0fut10,
  RTRIM(Y0FUT11) AS y0fut11,
  Y0FUT12 AS y0fut12,
  Y0FUT13 AS y0fut13,
  Y0FUT14 AS y0fut14
FROM LGDAT.ICSTR
