zOs/SQL/DIVCATTI

$#@
call sqlConnect
$=cnt= 100000
$$- timing()
$@% tst1
$@% tst1 oa1p.fqzCastI2cPack( )
$@% tst1 oa1p.fqzCastI2c( )
$@% tst1 oa1p.fqzI2c4( )
$@% tst1 oa1p.fqzc2i4(oa1p.fqzI2c4( ))
$proc $@/tst1/
$arg fuL fuR
$<>
$<=[
with n (n)  as (
    select             0 from sysIbm.sysDummy1
    union all select   n+1 from n where n < $cnt
)
, i as
( select int(n) n from n )
, m as
(
  select n, case when hex(n) = hex( $fuL n $fuR )
                        then 'pos eq' else 'pos <>' end pos
          , case when hex(-n) = hex( $fuL -n $fuR )
                        then 'neg eq' else 'neq <>' end neg
    from i
)
select count(*), pos, neg
    from m
    group by pos, neg
$]
call sqlStmts
$$- timing() $fuL $fuR
$/tst1/
$#out                                              20160115 17:34:51
17:34:51 ela=    0 cpu= 219.990 su= 15487481
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:34:51 ela=    0 cpu= 220.190 su= 15501686 oa1p.fqzCastI2cPack( )
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:34:54 ela=    0 cpu= 222.530 su= 15666241 oa1p.fqzCastI2c( )
  COL1 POS    NEG
     1 pos eq neg eq
100000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:34:54 ela=    0 cpu= 223.090 su= 15705532 oa1p.fqzI2c4( )
  COL1 POS    NEG
100001 pos <> neq <>
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:34:56 ela=    0 cpu= 224.420 su= 15799266 oa1p.fqzc2i4(oa1p.fqzI2c4( ))
$#out                                              20160115 17:33:15
17:33:15 ela=    0 cpu= 219.380 su= 15444444
 COL1 POS    NEG
10001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:33:15 ela=    0 cpu= 219.410 su= 15446793 oa1p.fqzCastI2cPack( )
 COL1 POS    NEG
10001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:33:16 ela=    0 cpu= 219.660 su= 15463972 oa1p.fqzCastI2c( )
 COL1 POS    NEG
    1 pos eq neg eq
10000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:33:16 ela=    0 cpu= 219.720 su= 15468602 oa1p.fqzI2c4( )
 COL1 POS    NEG
10001 pos <> neq <>
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:33:16 ela=    0 cpu= 219.870 su= 15479221 oa1p.fqzc2i4(oa1p.fqzI2c4( ))
$#out                                              20160115 17:32:37
17:32:37 ela=    0 cpu= 219.170 su= 15429984
COL1 POS    NEG
1001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:37 ela=    0 cpu= 219.180 su= 15430782 oa1p.fqzCastI2cPack( )
COL1 POS    NEG
1001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:37 ela=    0 cpu= 219.220 su= 15432959 oa1p.fqzCastI2c( )
COL1 POS    NEG
   1 pos eq neg eq
1000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:37 ela=    0 cpu= 219.230 su= 15433736 oa1p.fqzI2c4( )
COL1 POS    NEG
1001 pos <> neq <>
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:37 ela=    0 cpu= 219.260 su= 15436072 oa1p.fqzc2i4(oa1p.fqzI2c4( ))
$#out                                              20160115 17:32:01
17:32:01 ela=    0 cpu= 218.980 su= 15416191
COL1 POS    NEG
1001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:01 ela=    0 cpu= 218.990 su= 15417099 oa1p.fqzCastI2cPack( )
COL1 POS    NEG
1001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:02 ela=    0 cpu= 219.030 su= 15419622 oa1p.fqzCastI2c( )
COL1 POS    NEG
   1 pos eq neg eq
1000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
17:32:02 ela=    0 cpu= 219.050 su= 15420885 oa1p.fqzI2c4( )
*** run error ***
SQLCODE = -199: ILLEGAL USE OF KEYWORD THEN.  TOKEN OVER
    CONCAT !! / MICROSECONDS MICROSECOND SECONDS SECOND WAS EXPECTED
src ...m sysIbm.sysDummy1 union all select n+1 from n where n < 1000 ) ,
  +  i as ( select int(n) n from n ) , m as ( select n, case when hex(n)
  +  = hex( oa1p(fqzc2i4(oa1p.fqzI2c4( n )) ) then 'pos eq' else 'pos...
  >                       >>>pos 673 of 1173>>>
sql = with n (n)  as (
stmt = prepare s10 into :M.SQL.10.D from :src
with into :M.SQL.10.D = M.SQL.10.D
$#out                                              20160115 17:31:38
17:31:38 ela=    0 cpu= 218.830 su= 15405598
COL1 POS    NEG
1001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
*** run error ***
undefined var fun
$#out                                              20160115 16:24:09
16:24:09 ela=    0 cpu= 213.640 su= 15039116
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:24:09 ela=    0 cpu= 213.840 su= 15053023 fqzCastI2cPack
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:24:11 ela=    0 cpu= 216.100 su= 15212182 fqzCastI2c
  COL1 POS    NEG
     1 pos eq neg eq
100000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:24:12 ela=    0 cpu= 216.640 su= 15250283 fqzI2c4
$#out                                              20160115 16:20:03
16:20:03 ela=    0 cpu= 209.120 su= 14720949
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:20:04 ela=    0 cpu= 210.190 su= 14796161 fqzCastI2cPack
  COL1 POS    NEG
100001 pos eq neg eq
1 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:20:07 ela=    0 cpu= 212.410 su= 14952721 fqzCastI2c
  COL1 POS    NEG
     1 pos eq neg eq
100000 pos eq neq <>
2 rows fetched: with n (n) as ( select 0 from sysIbm.sysDummy1 union all s...
16:20:07 ela=    0 cpu= 212.960 su= 14991178 fqzI2c4
$#out                                              20160115 16:18:04