zOs/TX/PER10RU

if \ ${?j} then
    $=j=C
$=fa=1e6
$=ba=- c2d($j)*$fa
$=tb=QZ92CRT.tqz91Per10
call sqlConnect dp4g
m.sql_retOk = '*'
$@do ix=1      $@[
    $<dsn.tx.case(per10Ru$j)
    $@for li $@[
        parse upper value $li with w1 w2 wR
        stTi = time()
        say stTi $ix w1 'begin e' time(e)
        call time r
        sc = 0
        if w1 == exit   then $@[
            exit
        $] else if w1 = insert then $@[
            sc = sqlExec("insert into" $tb ,
            "select mod(mod(max("$ba", max(key)), 1000)*199, 1000),",
                   "max("$ba", max(key))+1, '"time()"'" ,
                "from" $tb "where key <" ($ba+$fa))
        $] else if w1 = massInsert then $@[
            sc = sqlExec("insert into" $tb ,
            "select mod(row_number () over(), 1000)," ,
                   "(row_number () over()) +" ,
                  "(select max(" (300*$fa)", max(key))+1 from" $tb")" ,
                  ",strip(left(name, 40)) from sysibm.sysColumns",
                  "fetch first 1000 rows only")
        $] else if w1 = select then $@[
            cnt = sql2One("with s as (select text t from" $tb ,
                 "where text < '9' fetch first 10 rows only)" ,
                 "select count(*) from s with cs",,,, '----')
            say time() 'select text' cnt
            if cnt < 0 then
                sc = cnt
        $] else if w1 = select then $@[
            cnt = sql2One('select count(*) from' $tb 'with rs')
            say time() 'select count' cnt
        $] else if w1 = commit then $@[
            sc = sqlCommit()
        $] else if w1 = rollback then $@[
            sc = sqlExec('rollback')
        $] else $@[
            say 'unknown' strip($li)
        $]
        if sc \== 0 & sc \== 1 then
            say sqlMsg()
        say left('#'$j, 4) stTi time() format(time(e), 4,4) ,
               left('sqlCode='sc, 15) w1 $ix
        $]
    slSt = time()
    call time r
    call sleep 3
    say left('#'$j, 4) stTi time() format(time(e), 4,4) ,
               left('', 15) 'sleeping' $ix
    $]
call sqlDisconnect
$#out                                              20110209 11:31:16