zOs/TX/WK977DDL

------------$-{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.a977A;
  commit;
$@[
if $phase >= 1 then $@=[
  CREATE TABLESPACE A977A
    IN $db
    USING STOGROUP GSMS
    PRIQTY -1 SECQTY -1
    FREEPAGE 10 PCTFREE 10
    GBPCACHE CHANGED
    TRACKMOD YES
    numparts $-[1 + ($phase==1)$]
    DSSIZE  4G
    BUFFERPOOL BP2
    LOCKSIZE ANY
    LOCKMAX SYSTEM
    CLOSE YES
    COMPRESS YES
    CCSID      EBCDIC
    DEFINE YES
    MAXROWS 255;
  CREATE TABLE $creator.Twk977A1
     (Wk977Part            int      not null
     ,wk977chb             char(10) NOT NULL
     )
$@[
if $phase >= 2 then $@=[
     PARTITION BY (wk977Part)
      (PART 1 VALUES(9999))
    $]
$]
    IN $db.A977A
    AUDIT NONE
    DATA CAPTURE NONE
    CCSID      EBCDIC
    NOT VOLATILE
;
$@[
if $phase  = 1 then $@=[
CREATE INDEX $creator.IWK977A0
  ON $creator.TWK977A1
  (WK977Part              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 20 $@=[
    insert into $creator.twk977a1 values($ix, 'a $ix');
    $]
$@[
if $phase  >= 2 then $@=[
alter table $creator.twk977a1
    alter partition 1 ending at (1);
commit;
$@do px= 2 to $phase -1 $@=[
    alter table $creator.twk977a1
        add partition ending at ($px);
    $]
alter table $creator.twk977a1
    add partition ending at (9999);
commit;
    $]
$]
$]
$]