| Code: 
							
								
								
								| 
    create table DATE_DIM (
  D_DATE_SK integer not null
 ,D_DATE DATE default null
 ,D_MONTH_SEQ for column D_MSEQ integer default null
 ,D_WEEK_SEQ for column D_WSEQ integer default null
 ,D_QUARTER_SEQ for column D_QSEQ integer default null
 ,D_PERIOD_SEQ for column D_PSEQ integer default null
 ,D_YEAR integer default null
 ,D_DOW integer default null
 ,D_DAYOFWEEKINMONTH For Column D_DOWINM Integer Default Null
 ,D_MOY integer default null
 ,D_DOM integer default null
 ,D_WOY integer default null
 ,D_WEEKYEAR integer default null
  ,D_PERIOD integer default null
 ,D_QOY integer default null
 ,D_QTRWEEK integer default null
  ,D_FISCAL_YEAR for column D_F_YEAR integer default null
 ,D_FISCAL_QUARTER for column D_F_QOY integer default null
 ,D_FISCAL_PERIOD for column D_F_PERIOD integer default null
  ,D_FIRST_DOM for column D_FDOM integer default null
 ,D_LAST_DOM  for column D_LDOM integer default null
 ,D_FIRST_DOW for column D_FDOW integer default null
 ,D_LAST_DOW  for column D_LDOW integer default null
 ,D_SAME_DAY_LY for column D_LYDAY integer default null
 ,D_SAME_DAY_LQ for column D_LQDAY integer default null
 ,D_SAME_WEEK_LY for column D_LYWEEK integer default null
  ,D_DAY_NAME char(9) ccsid 37 default null
 ,D_MONTH_NAME for column D_MOYN char(9) ccsid 37 default null
 ,D_MONTH_ABRV for column D_MOYNA char(3) ccsid 37 default null
 ,D_MONTH_YEAR for column D_MNYR char(8) ccsid 37 default null
 ,D_QUARTER_NAME  for column D_QOYN char(7) ccsid 37 default null
 ,D_FISCAL_QUARTER_NAME for column D_F_QOYN char(7) ccsid 37 default null
  ,D_HOLIDAY char(1) ccsid 37 default null
 ,D_HOLIDAY_NAME for column D_HOLNAME Varchar(50) ccsid 37 default null
 ,D_FOLLOWING_HOLIDAY for column D_FOLOWHOL char(1) ccsid 37 default null
 ,D_WEEKEND char(1) ccsid 37 default null
 ,D_MONTH_FIRST_SAT for column D_FIRSTSAT char(1) ccsid 37 default null
 ,D_MONTH_FIRST_FULL_WEEK for column D_FIRSTFW char(1) ccsid 37 default null
 ,D_MONTH_LAST_SAT for column D_LASTSAT char(1) ccsid 37 default null
 ,D_MONTH_LAST_FULL_WEEK for column D_LASTFW char(1) ccsid 37 default null
  ,D_CURRENT_13_WEEKS for column D_CUR13WK char(1) ccsid 37 default null
  ,D_DATEYYMD decimal(8, 0) default null
 ,D_DATEMDYY decimal(8, 0) default null
 ,D_DATECYMD decimal(7, 0) default null
 ,D_JULIAN decimal(7, 0) default null
 ,D_CENTURY decimal(2, 0) default null
 ,D_YEAR2 decimal(2, 0) default null
);
 label on table DATE_DIM
 IS 'Date datastructure of all types of date values';
 label on column DATE_DIM
(
 D_DATE_SK      is 'Date Unique         Seq Key'
,D_DATE         is 'Date'
,D_MONTH_SEQ    is 'Month               Seq Key'
,D_WEEK_SEQ     is 'Week                Seq Key'
,D_QUARTER_SEQ  is 'Quarter             Seq Key'
,D_PERIOD_SEQ   is 'Period              Seq Key'
,D_YEAR         is 'Year'
,D_DOW          is 'Day of              Week'
,D_DAYOFWEEKINMONTH is 'Day of              Week In             Month'
,D_MOY          is 'Month of            Year'
,D_DOM          is 'Day of              Month'
,D_WOY          is 'Week of             Year'
,D_WEEKYEAR     is 'Year for            Week'
,D_PERIOD       is 'Period              Year'
,D_QOY          is 'Quarter of          Year'
,D_QTRWEEK      is 'Quarter week of     Year'
,D_FISCAL_YEAR  is 'Fiscal              Year'
,D_FISCAL_QUARTER is 'Fiscal              Quarter'
,D_FISCAL_PERIOD  is 'Fiscal              Period'
,D_FIRST_DOM    is 'First               Day of              Month Id'
,D_LAST_DOM     is 'Last                Day of              Month Id'
,D_FIRST_DOW    is 'First               Day of              Week Id'
,D_LAST_DOW     is 'Last                Day of              Week Id'
,D_SAME_DAY_LY  is 'Same Day            Last                Year Id'
,D_SAME_DAY_LQ  is 'Same Day            Last                Quarter Id'
,D_SAME_WEEK_LY is 'Same Week           Last                Year Id'
,D_DAY_NAME     is 'Day Name '
,D_MONTH_NAME   is 'Month Name'
,D_MONTH_ABRV   is 'Month               Abbrv'
,D_MONTH_YEAR   is 'Month Year          Name'
,D_QUARTER_NAME is 'Quarter             Name'
,D_FISCAL_QUARTER_NAME is 'Fiscal              Quarter             Name'
,D_HOLIDAY      is 'Is a                Holiday'
,D_HOLIDAY_NAME is 'Name of Holiday'
,D_FOLLOWING_HOLIDAY is 'Follows             a Holiday'
,D_WEEKEND      is 'Is a                Weekend'
,D_MONTH_FIRST_SAT is 'First               Saturday            of Month'
,D_MONTH_FIRST_FULL_WEEK is 'First               Full Week           of Month'
,D_MONTH_LAST_SAT is 'Last                Saturday            of Month'
,D_MONTH_LAST_FULL_WEEK is 'Last                Full Week           of Month'
,D_CURRENT_13_WEEKS is 'Day In              Current             13 Weeks'
,D_DATEYYMD     is 'Year                Month Day           Date'
,D_DATEMDYY     is 'Month Day           Year                Date'
,D_DATECYMD     is 'Century Year        Month Day           Date'
,D_JULIAN       is 'Julian              Date'
,D_CENTURY      is 'Century'
,D_YEAR2        is 'Year'
) ;
 label on column DATE_DIM
(
 D_DATE_SK           text is 'Date Unique Seq Key'
,D_DATE              text is 'The Date'
,D_MONTH_SEQ         text is 'Month Seq Key'
,D_WEEK_SEQ          text is 'Week Seq Key'
,D_QUARTER_SEQ       text is 'Quarter Seq Key'
,D_PERIOD_SEQ        text is 'Period Seq Key'
,D_YEAR              text is 'Year'
,D_DOW               text is 'Day of Week'
,D_DAYOFWEEKINMONTH  text is 'Day of Week In Month'
,D_MOY               text is 'Month of Year'
,D_DOM               text is 'Day of Month'
,D_WOY               text is 'Week of Year'
,D_WEEKYEAR          text is 'Year for week when different than day year'
,D_PERIOD            text is 'Period Year'
,D_QOY               text is 'Quarter of Year'
,D_QTRWEEK           text is 'Quarter week of Year'
,D_FISCAL_YEAR       text is 'Fiscal Year'
,D_FISCAL_QUARTER    text is 'Fiscal Quarter'
,D_FISCAL_PERIOD     text is 'Fiscal Period'
,D_FIRST_DOM         text is 'First Day of Month Index Entry'
,D_LAST_DOM          text is 'Last Day of Month Index Entry'
,D_FIRST_DOW         text is 'First Day of Week Index Entry'
,D_LAST_DOW          text is 'Last Day of Week Index Entry'
,D_SAME_DAY_LY       text is 'Same Day Last Year Index Entry'
,D_SAME_DAY_LQ       text is 'Same Day Last Quarter Index Entry'
,D_SAME_WEEK_LY      text is 'Same Week Last Year Index Entry'
,D_DAY_NAME          text is 'Day Name '
,D_MONTH_NAME        text is 'Month Name'
,D_MONTH_ABRV        text is 'Month Abbrv'
,D_MONTH_YEAR        text is 'Month Name Selecting'
,D_QUARTER_NAME      text is 'Quarter Name'
,D_FISCAL_QUARTER_NAME text is 'Fiscal Quarter Name'
,D_HOLIDAY           text is 'Is a Holiday'
,D_HOLIDAY_NAME      text is 'Name of Holiday'
,D_WEEKEND           text is 'Is a Weekend'
,D_FOLLOWING_HOLIDAY text is 'Follows a Holiday'
,D_MONTH_FIRST_SAT   text is 'First Saturday of Month'
,D_MONTH_FIRST_FULL_WEEK text is 'First Full Week of Month'
,D_MONTH_LAST_SAT text is 'Last Saturday of Month'
,D_MONTH_LAST_FULL_WEEK text is 'Last Full Week of Month'
,D_CURRENT_13_WEEKS  text is 'This is the Current 13 Weeks'
,D_DATEYYMD          text is 'Numeric Year Month Day Date'
,D_DATEMDYY          text is 'Numeric Month Day Year Date'
,D_DATECYMD          text is 'Numeric Century Year Month Day Date'
,D_JULIAN            text is 'Julian Date'
,D_CENTURY           text is 'Century'
,D_YEAR2             text is 'Year'
) ; |  |