zOs/REXX/ABUBEXP

$#@
$** export contents of abub rule
call sqlConnect dp4g
$;
$>. fEdit()
$@%[expTb - 'oa1p.tQZ046AbUbRule', , 'abub rule'$]
$@proc expTb $@/expTb/
    parse arg , tb, wh, tit
    $$- ''
    $$- '---------------' tit
    $$- '-- delete from' tb copies('where' wh, wh \== '')
    $$  ;
    $;
    call sqlSel 'select * from' tb copies('where' wh, wh \== '')
    $|
    lst = ''
    cx = 0
    $@for oo $@[
        cx = cx + 1
        o1 = $.oo
        call sql4Obj o1, tb
        if wordPos(m.o1.name, lst) < 1 then
            lst = lst m.o1.name
        $]
    say right(cx, 5) 'inserts into' left(tb, 24) 'for' tit
    $=names=- lst
$/expTb/
$#out                                              20160104 11:08:54
$#out                                              20140328 08:29:29