zOs/TX/WK991DDL
set current sqlid = 'S100447';
drop TABLESPACE $db.a991a;
commit;
$@[
if $phase >= 1 then $@=[
CREATE TABLESPACE a991a
IN $db
USING STOGROUP GSMS
PRIQTY -1 SECQTY -1
FREEPAGE 10 PCTFREE 5
GBPCACHE CHANGED
TRACKMOD YES
LOGGED
DSSIZE 4 G
NUMPARTS 4
BUFFERPOOL BP2
LOCKSIZE ANY
LOCKMAX SYSTEM
CLOSE $-[if($phase<=2, YES, NO)$]
COMPRESS YES
CCSID EBCDIC
DEFINE YES
MAXROWS 255;
CREATE TABLE $creator.TWK991a1
(part SMALLINT NOT NULL
$@[
if $phase == 1 then $@=[
,text varCHAR(40) FOR SBCS DATA NOT NULL
$] else if $phase == 2 then $@=[
,text varCHAR(3) FOR SBCS DATA NOT NULL
$] else if $phase == 3 then $@=[
,text int NOT NULL
$] else if $phase == 4 then $@=[
, tst2char timestamp
, char2tst char(20)
$] else if $phase == 5 then $@=[
, tst2char char(20)
, char2tst timestamp
$]
$]
)
IN $db.a991a
PARTITION BY (part asc
$-[if($phase < 4, ', text desc')$]
)
( PART 1 VALUES(1)
, PART 2 VALUES(2)
, PART 3 VALUES(3)
, PART 4 VALUES(4)
)
AUDIT NONE
DATA CAPTURE NONE
CCSID EBCDIC
NOT VOLATILE
APPEND NO ;
CREATE INDEX $creator.Iwk991PIE1
ON $creator.Twk991A1
(PART, TEXT)
USING STOGROUP GSMS
PRIQTY -1 SECQTY -1
ERASE NO
BUFFERPOOL BP1
GBPCACHE CHANGED
not CLUSTER
CLOSE YES
COPY NO
DEFINE YES
PIECESIZE 1 G;
CREATE INDEX $creator.Iwk991PIE2
ON $creator.Twk991A1
(PART, TEXT)
USING STOGROUP GSMS
PRIQTY -1 SECQTY -1
ERASE NO
BUFFERPOOL BP1
GBPCACHE CHANGED
not CLUSTER
CLOSE YES
COPY NO
DEFINE YES
PIECESIZE 2 G;
CREATE INDEX $creator.Iwk991PIE4
ON $creator.Twk991A1
(PART, TEXT)
USING STOGROUP GSMS
PRIQTY -1 SECQTY -1
ERASE NO
BUFFERPOOL BP1
GBPCACHE CHANGED
not CLUSTER
CLOSE YES
COPY NO
DEFINE YES
PIECESIZE 4 G;
$@[
if $phase == 1 then $@=[
insert into $creator.TWK991a1 values (1, '100 hundert part 1 ');
insert into $creator.TWK991a1 values (1, '111 hundertelf part 1');
insert into $creator.TWK991a1 values (2, '200 zweiHun part 2 ');
insert into $creator.TWK991a1 values (2, '222 zweiHun22 part 2 ');
insert into $creator.TWK991a1 values (3, '300 dreiHundert pa 3 ');
insert into $creator.TWK991a1 values (4, '400 vierHundert pa 4 ');
$@[ if $addPa then $@=[
commit;
alter table $creator.TWK991a1
add partition ending at (5);
commit;
insert into $creator.TWK991a1 values (5, '500 fuenfHundert pa 5 ');
commit;
alter table $creator.TWK991a1
add partition ending at (6);
commit;
insert into $creator.TWK991a1 values (6, '600 fuenfHundert pa 6 ');
$]
$]
$] else if $phase == 2 then $@=[
insert into $creator.TWK991a1 values (1, '100');
insert into $creator.TWK991a1 values (1, '111');
insert into $creator.TWK991a1 values (2, '200');
insert into $creator.TWK991a1 values (2, '222');
insert into $creator.TWK991a1 values (2, 'zwe');
insert into $creator.TWK991a1 values (3, '300');
insert into $creator.TWK991a1 values (3, 'dre');
insert into $creator.TWK991a1 values (4, '400');
$] else if $phase == 3 then $@=[
insert into $creator.TWK991a1 values (1, 100 );
insert into $creator.TWK991a1 values (1, 111 );
insert into $creator.TWK991a1 values (2, 200 );
insert into $creator.TWK991a1 values (2, 222 );
insert into $creator.TWK991a1 values (3, 300 );
insert into $creator.TWK991a1 values (4, 400 );
$] else if $phase == 4 then $@=[
insert into $creator.TWK991a1 values (1, current timestamp, 'a');
insert into $creator.TWK991a1 values (1, current timestamp, 'b');
insert into $creator.TWK991a1 values (2, current timestamp, 'c');
insert into $creator.TWK991a1 values (2, current timestamp, 'd');
insert into $creator.TWK991a1 values (3, current timestamp, 'e');
insert into $creator.TWK991a1 values (4, current timestamp, 'f');
$] else if $phase == 5 then $@=[
insert into $creator.TWK991a1 values (1, 'a', current timestamp);
insert into $creator.TWK991a1 values (1, 'b', current timestamp);
insert into $creator.TWK991a1 values (2, 'c', current timestamp);
insert into $creator.TWK991a1 values (2, 'd', current timestamp);
insert into $creator.TWK991a1 values (3, 'e', current timestamp);
insert into $creator.TWK991a1 values (4, 'f', current timestamp);
$]
$]
commit;
$]
$]