CREATE TABLESPACE SBA01010
   IN DB2TSTE
   USING STOGROUP SYSPOOL1
   PRIQTY 720 SECQTY 720
   ERASE  NO
   FREEPAGE 5 PCTFREE 15 FOR UPDATE 0
   GBPCACHE CHANGED
   TRACKMOD YES
   MAXPARTITIONS 20
   LOGGED
   DSSIZE 8 G
   SEGSIZE 32
   LOCKSIZE ANY
   LOCKMAX SYSTEM
   CLOSE NO
   COMPRESS NO
   CCSID      EBCDIC
   DEFINE YES
   MAXROWS 255
   INSERT ALGORITHM 0;

CREATE TABLE DB2TSTE.TPOCTAB10
  (STUDENT_ID           INTEGER NOT NULL,
   STUDENT_TYP_C        CHAR(2) FOR SBCS DATA NOT NULL,
   ADDITIONAL_COLUMN    CHAR(2) FOR SBCS DATA NOT NULL
       DEFAULT 'XX',
   STUDENT_SEQ          SMALLINT NOT NULL,
   STUDENT_MAJOR        CHAR(35) FOR SBCS DATA NOT NULL,
   START_DT             DATE NOT NULL,
   LAST_MTN_DT          DATE NOT NULL,
   LAST_MTN_TM          TIME NOT NULL,
   LAST_MTN_ID          CHAR(8) FOR SBCS DATA NOT NULL,
   CONSTRAINT PRIMARY_TPOC_CBA_CIES_CI_ID
   PRIMARY KEY (STUDENT_ID,
   STUDENT_TYP_C),
   CONSTRAINT CI_ID0 CHECK (STUDENT_ID > 0 ))
  IN DB2TSTE.SBA01010
  PARTITION BY SIZE
  AUDIT NONE
  DATA CAPTURE CHANGES
  CCSID      EBCDIC
  NOT VOLATILE
  APPEND NO;

COMMENT ON TABLE DB2TSTE.TPOCTAB10 IS 'STUDENT MAJOR TABLE';
COMMENT ON DB2TSTE.TPOCTAB10
   (LAST_MTN_ID IS 'Last Maintenance      ID',
    LAST_MTN_TM IS 'Last Maintenance      Time
                                         FORMAT: HH:MM:SS',
    LAST_MTN_DT IS 'Last Maintenance      Date
                                         FORMAT: MM/DD/YY',
    STUDENT_ID IS 'STUDENT IDENTIFICATION INTERNALLY GENERATED NUMBER USE
                                         FORMAT: MM/DD/YY',
    STUDENT_ID IS 'STUDENT IDENTIFICATION INTERNALLY GENERATED NUMBER USE
D TO IDENTIFY A STUDENT');

CREATE UNIQUE INDEX DB2TSTE.XBA0103C
    ON DB2TSTE.TPOCTAB10
     (STUDENT_ID            ASC,
      STUDENT_TYP_C         ASC)
    USING STOGROUP SYSDEFLT
    PRIQTY 720 SECQTY 72
    ERASE  NO
    FREEPAGE 5 PCTFREE 15
    GBPCACHE CHANGED
    CLUSTER
    COMPRESS NO
    INCLUDE NULL KEYS
    CLOSE NO
    COPY NO
    DEFER NO
    DEFINE YES
    PIECESIZE 2 G;

CREATE INDEX DB2TSTE.XBA01031
    ON DB2TSTE.TPOCTAB10
     (LAST_MTN_ID           ASC,
      STUDENT_TYP_C         ASC)
    USING STOGROUP SYSDEFLT
    PRIQTY 720 SECQTY 72
    ERASE  NO
    FREEPAGE 5 PCTFREE 15
    GBPCACHE CHANGED
    NOT CLUSTER
    COMPRESS NO
    INCLUDE NULL KEYS
    CLOSE NO
    COPY NO
    DEFER NO
    DEFINE YES
    PIECESIZE 2 G;
COMMIT;
