zOs/TX/WK978DDL

------------$-{right(userid() sysvar(sysnode) date(s) time(), 60, '-')}
-- testCase $dsn
-- env      $env      phase $phase
-- subsys   $subsys     db $db       creator $creator
-----------------------------------------------------------------------
---||| begin ddl testcase $mbr env $env phase $phase
SET CURRENT SQLID='S100447';
SET CURRENT SCHEMA = $creator;
drop tablespace $db.a978A;
  commit;
$@[
if $phase >= 1 then $@=[
  CREATE TABLESPACE A978A
    IN $db
    USING STOGROUP GSMS
    PRIQTY -1 SECQTY -1
    FREEPAGE 10 PCTFREE 10
    GBPCACHE $-[if($env=='SRC', ALL, CHANGED)$]
    TRACKMOD YES
    numparts 8
    $dsSize
    BUFFERPOOL BP2
    LOCKSIZE ANY
    LOCKMAX SYSTEM
    CLOSE YES
    COMPRESS YES
    CCSID      EBCDIC
    DEFINE YES
    MAXROWS 255;
  CREATE TABLE $creator.Twk978A1
     (Wk978Part            int      not null
     ,wk978chb             char(10) NOT NULL
     ,wk978chc             char(10) NOT NULL
     )
     PARTITION BY (wk978Part)
      (PART 1 VALUES(1)
      ,PART 2 VALUES(2)
      ,PART 3 VALUES(3)
      ,PART 4 VALUES(4)
      ,PART 5 VALUES(5)
      ,PART 6 VALUES(6)
      ,PART 7 VALUES(7)
      ,PART 8 VALUES(8)
      )
    IN $db.A978A
    AUDIT NONE
    DATA CAPTURE NONE
    CCSID      EBCDIC
    NOT VOLATILE
;
CREATE unique INDEX $creator.IWK978A0
  ON $creator.TWK978A1
  (WK978ChB asc
  )
  USING STOGROUP GSMS
  PRIQTY -1 SECQTY -1
  ERASE  NO
  FREEPAGE 10 PCTFREE 10
  GBPCACHE CHANGED
  CLUSTER
  BUFFERPOOL BP1
  CLOSE YES
  COPY NO
  DEFER NO
  DEFINE YES
;
alter table $creator.TWK978A1
    add primary key (WK978ChB) ;
commit ;
$]
if $phase >= 2 then $@=[
    alter table $creator.TWK978A1
        drop primary key;
    drop index $creator.IWK978A0;
    commit;
    $@do px=9 to $parts $@=[
    alter TABLE $creator.Twk978A1 add partition ending($px);
    $]
CREATE unique INDEX $creator.IWK978A0
  ON $creator.TWK978A1
  (WK978Part              asc
  ,WK978ChB               asc
  )
  USING STOGROUP GSMS
  PRIQTY -1 SECQTY -1
  ERASE  NO
  FREEPAGE 10 PCTFREE 10
  PARTITIONED
  GBPCACHE CHANGED
  NOT CLUSTER
  BUFFERPOOL BP1
  CLOSE YES
  COPY NO
  DEFER NO
  DEFINE YES
;
alter table $creator.TWK978A1
    add primary key (WK978Part,  WK978ChB );
$]
if $phase  =77 then $@=[
CREATE INDEX $creator.IWK978A0
  ON $creator.TWK978A1
  (WK978Part              asc
  )
  USING STOGROUP GSMS
  PRIQTY 12 SECQTY 7200
  ERASE  NO
  FREEPAGE 10 PCTFREE 10
  GBPCACHE CHANGED
  CLUSTER
  BUFFERPOOL BP1
  CLOSE YES
  COPY NO
  DEFER NO
  DEFINE YES
  Partition by (
      partition 1 ending (1),
      partition 2 ending (9999)
     )
;
$]
$]
commit;
$**
$@[
$@do ix=-1 to  8 $@=[
    insert into $creator.twk978a1 values($ix, 'b $ix', 'c $ix');
    $]
$*(
if $phase  >= 2 then $@=[
alter table $creator.twk978a1
    alter partition 1 ending at (1);
commit;
$@do px= 2 to $phase -1 $@=[
    alter table $creator.twk978a1
        add partition ending at ($px);
commit;
    $]
$]
alter table $creator.twk978a1
    add partition ending at (9999);
commit;
$*)
$]