zOs/TX/PER03DDL

------------$-{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';
drop tablespace $db.aPer03;
commit;
------------------------------------------------------------------------
CREATE TABLESPACE aPer03
    IN $db
    USING STOGROUP GSMS
    PRIQTY -1 SECQTY -1
    ERASE  NO
    FREEPAGE 0 PCTFREE 10
    GBPCACHE CHANGED
    TRACKMOD YES
    segsize 64
    BUFFERPOOL BP2
    LOCKSIZE ANY
    LOCKMAX SYSTEM
    CLOSE YES
    COMPRESS YES
    CCSID      EBCDIC
    DEFINE YES
    MAXROWS 255
;  ---------------------------------------------------------------------
  CREATE TABLE $creator.tPer03
     ( v decimal(13) not null,
       b decimal(13) not null,
       t char(1) not null
     )
     IN $db.aPer03
     AUDIT NONE
     DATA CAPTURE NONE
     CCSID      EBCDIC
     NOT VOLATILE ;
CREATE unique INDEX $creator.IPer03x0
  ON $creator.tPer03
   (v asc, b asc, t asc)
  USING STOGROUP GSMS
  PRIQTY -1 SECQTY -1
  ERASE  NO
  FREEPAGE 0 PCTFREE 5
  GBPCACHE CHANGED
  CLUSTER
  BUFFERPOOL BP1
  CLOSE YES
  COPY NO
  DEFER NO
  DEFINE YES ;
$=i=insert into $creator.tper03 values
$i(-9999999999999,       1700000, 'a');
$i(       1700001,       3200000, 'b');
$i(       3200001,       4500000, 'c');
$i(       4500001,       5000000, 'd');
$i(       5000001,       6980000, 'e');
$i(       6980001,       9200000, 'f');
$i(       9200001,      10000000, 'g');
$i(      10000001,      10500000, 'h');
$i(      10500001,      11000000, 'i');
$i(      11000001, 9999999999999, 'j');
------------------------------------------------------------------------
CREATE VIEW $creator.vPer03V AS
              SELECT v.* FROM GDB0351.TFI027A1 v, $creator.tPer03 t
                      WHERE t = 'a' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027B1 v, $creator.tPer03 t
                      WHERE t = 'b' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027C1 v, $creator.tPer03 t
                      WHERE t = 'c' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027D1 v, $creator.tPer03 t
                      WHERE t = 'd' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027E1 v, $creator.tPer03 t
                      WHERE t = 'e' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027F1 v, $creator.tPer03 t
                      WHERE t = 'f' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027G1 v, $creator.tPer03 t
                      WHERE t = 'g' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027H1 v, $creator.tPer03 t
                      WHERE t = 'h' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027I1 v, $creator.tPer03 t
                      WHERE t = 'i' and TKKEY between v and b
    union all SELECT v.* FROM GDB0351.TFI027J1 v, $creator.tPer03 t
                      WHERE t = 'j' and TKKEY between v and b
;
commit;