CREATE MULTISET TABLE DWHFRT.STAMP_EVT_RCU ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO
     (
      IDT_CNT_RCU CHAR(35) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Rec. -ID or Container ID' NOT NULL,
      DAT_LOC_EVT TIMESTAMP(0) TITLE 'Event time stamp Local Time' NOT NULL,
      COD_EVT CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Event Code' NOT NULL COMPRESS '001',
      DAT_CRN_ODS TIMESTAMP(0) TITLE 'Timestamp when row was imported to ODS' NOT NULL,
      SRC_DON_ESC CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Data sourced from Station' NOT NULL COMPRESS ('AMS','CDG','CPH','JFK'),
      SRC_ESC_TSP CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Source Station Transport Co.' NOT NULL COMPRESS '2',
      IDT_TYP CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Id-Type' COMPRESS ,
      IDT_CNT VARCHAR(35) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Container ID' COMPRESS ,
      PDS_BRT DECIMAL(6,1) TITLE 'Gross weight' COMPRESS ,
      COD_RSN CHAR(3) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'ReasonCode' COMPRESS ,
      ESC_ORI CHAR(7) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Origin Station' COMPRESS ,
      ESC_DST CHAR(7) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Dest. Station' COMPRESS ,
      NOM_PRN_ORI VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Partner at Origin' COMPRESS ,
      NOM_PRN_DST VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Partner at Dest.' COMPRESS ,
      NUM_VOL_DEP VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Dep. Flight No.' COMPRESS ,
      NUM_VOL_ARV VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Arrv. Flight No.' COMPRESS ,
      DAT_DEP TIMESTAMP(0) TITLE 'Departure Date/Time' COMPRESS ,
      DAT_VOL TIMESTAMP(0) TITLE 'Arrival Date/Time' COMPRESS ,
      IDT_VOL VARCHAR(32) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Flight ID' COMPRESS ,
      COD_LCT VARCHAR(10) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Location' COMPRESS ,
      NOM_CND VARCHAR(25) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Driver' COMPRESS ,
      STT_SPP CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Delete Flag' COMPRESS ,
      STT_MLD CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'MLD generated flag' COMPRESS ,
      STT_ANL CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Booking cancelled via MLD' COMPRESS ,
      STT_ANL_2 CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Booking cancelled via MLD 2' COMPRESS ,
      STT_LIV CHAR(1) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Delivery confirmed flag' COMPRESS ,
      DAT_LIV TIMESTAMP(0) TITLE 'Delivery Timestamp' COMPRESS ,
      DAT_DNI_MDF VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Delivered to Office of Exchange' COMPRESS ,
      DAT_MDF TIMESTAMP(0) TITLE 'Last modified Time Stamp' COMPRESS ,
      UTI_MDF VARCHAR(14) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Changed By' COMPRESS ,
      STT_MDF_PC CHAR(8) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Changed on Workstation' COMPRESS ,
      NUM_VOL_DEP_CLC VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Dep. Flight No.' COMPRESS ,
      NUM_VOL_ARV_CLC VARCHAR(17) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Arrv. Flight No.' COMPRESS ,
      CIE_VOL_DEP CHAR(4) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Dep. Flight No.' COMPRESS ,
      CIE_VOL_ARV CHAR(4) CHARACTER SET LATIN NOT CASESPECIFIC TITLE 'Arrv. Flight No.' COMPRESS ,
      DAT_CRN_DWH DATE FORMAT 'YYYYMMDD' TITLE 'DWH creation date' NOT NULL)
PRIMARY INDEX PI_STAMP_EVT_RCU ( IDT_CNT_RCU ,DAT_LOC_EVT );


SELECT	IDT_CNT_RCU, DAT_LOC_EVT, COD_EVT, DAT_CRN_ODS, SRC_DON_ESC,
		SRC_ESC_TSP,
		IDT_TYP,
		IDT_CNT,
		PDS_BRT,
		COD_RSN,
		ESC_ORI,
		ESC_DST,
		NOM_PRN_ORI,
		NOM_PRN_DST,
		NUM_VOL_DEP,
		NUM_VOL_ARV,
		DAT_DEP,
		DAT_VOL,
		IDT_VOL,
		COD_LCT,
		NOM_CND,
		STT_SPP,
		STT_MLD,
		STT_ANL,
		STT_ANL_2,
		STT_LIV,
		DAT_LIV,
		DAT_DNI_MDF,
		DAT_MDF,
		UTI_MDF,
		STT_MDF_PC,
		NUM_VOL_DEP_CLC,
		NUM_VOL_ARV_CLC,
		CIE_VOL_DEP,
		CIE_VOL_ARV,
		DAT_CRN_DWH
FROM	DWHFRT.STAMP_EVT_RCU

