zOs/SQL/STPRVERS

$>.fEdit('~wk.texv(out)')
$<=[
set current sqlid = 's100447' ;
drop   procedure A540769.versP1;
drop   procedure A540769.versP2;
drop   procedure gdb9998.versP1;
drop   procedure gdb9998.versP2;
terminator    } ;
create procedure gdb9998.versP1(out ve char(4))
        version v1 deterministic contains sql
    set ve = 'p1V1'
}
alter  procedure gdb9998.versP1 add version v2 (out ve char(4))
                   deterministic contains sql
    set ve = 'p1V2'
}
create procedure gdb9998.versP2(in ci varchar(100), out da date,
                            out ve varchar(100))
        version v1
        deterministic contains sql
    begin
    set da = current date + 1 day;
    call gdb9998.versP1(ve);
    set ve = 'p2 v1 - curr=''' || current routine version|| ''', '||ve;

    end
}
alter  procedure gdb9998.versP2 add version v2
        (in ci varchar(100), out da date,
                            out ve varchar(100))
        deterministic contains sql
    begin
    set da = current date + 2 day;
    call gdb9998.versP1(ve);
    set ve = 'p2 v2 - curr=''' || current routine version||''', '||ve;
    end
}
alter  procedure gdb9998.versP2 add version v3
        (in ci varchar(100), out da date,
                            out ve varchar(100))
        deterministic contains sql
    begin
    set da = current date + 3 day;
    call gdb9998.versP1(ve);
    set ve = 'p2 v3 - curr=''' || current routine version || ''', '||ve;
    end
}
terminator ; }
$=eins=wie geht es dir?
call gdb9998.versP2(wie geht es Dir Konstäntchen? oder , :res,);
set current routine version v1;
call gdb9998.versP2(wie geht es Dir v1? , :res,);
set current routine version v2;
call gdb9998.versP2(wie geht es Dir v2? , :res,);
set current routine version v3;
call gdb9998.versP2(wie geht es Dir v3? , :res,);
set current routine version = '';
call gdb9998.versP2(wie geht es Dir v empty? , :res,);
alter  procedure gdb9998.versP2 activate version v3;
call gdb9998.versP2(wie geht es Dir Konstäntchen? oder , :res,);
set current routine version v1;
call gdb9998.versP2(wie geht es Dir v1? , :res,);
set current routine version v2;
call gdb9998.versP2(wie geht es Dir v2? , :res,);
set current routine version v3;
call gdb9998.versP2(wie geht es Dir v3? , :res,);
set current routine version = '';
call gdb9998.versP2(wie geht es Dir v empty? , :res,);
alter  procedure gdb9998.versP2 activate version v2;
call gdb9998.versP2(wie geht es Dir Konstäntchen? oder , :res,);
set current routine version v1;
call gdb9998.versP2(wie geht es Dir v1? , :res,);
set current routine version v2;
call gdb9998.versP2(wie geht es Dir v2? , :res,);
set current routine version v3;
call gdb9998.versP2(wie geht es Dir v3? , :res,);
set current routine version = '';
call gdb9998.versP2(wie geht es Dir v empty? , :res,);
set current routine version = 'V9';
call gdb9998.versP2(wie geht es Dir v empty? , :res,);
--call gdb9998.P1(?, ?, ?);
--call gdb9998.P1(WIE geht es dir konstante? , :zwei, :res);
commit;
$] call sqlStmtsOpt
$#out                                              20110608 20:11:21
*** run error ***
sqlCode SQLCODE not numeric
sqlCode SQLCODE sqlState=SQLSTATE
    errMC=SQLERRMC
    warnings= 0=SQLWARN.0 1=SQLWARN.1 2=SQLWARN.2 3=SQLWARN.3 4=SQLWARN.4 5=SQLW
    errD.1=SQLERRD.1 2=SQLERRD.2 3=SQLERRD.3
    errD.4=SQLERRD.4 5=SQLERRD.5 6=SQLERRD.6
stmt =  execSql call GDB9998.VERSP2 using descriptor :M.SQLSTMTCALL
with M.SQLSTMTCALL = M.SQLSTMTCALL
$#out                                              20110608 14:38:06
$#out                                              20110603 18:07:48
$#out                                              20110530 09:55:59
$#out                                              20110524 17:27:35
$#out                                              20110524 17:26:03
$#out                                              20110524 17:21:09
$#out                                              20110524 17:03:44