On Fri, Aug 19, 2011 at 1:01 PM, John P. Hartmann <[email protected]> wrote:
> Kris, are you saying that STATE should create a unit of work to do its
> deed on?
>
> I have never understood why querying something could leave a work unit
> changed.
In theory, when there's uncommitted work you can't really predict what
your usage is after the work unit is committed or rolled back. I think
Q LIMITS is trying too hard. Why not simply state the current usage
with the state of the open work units. When it forces me to run it in
a private work unit, I believe it sees the world as it was before the
work units opened. That may be what I need, but I'd rather decide for
that myself.
I've been using a pipeline stage similar to the idiom Kris shows. This
lets me run a series of CMS commands in a private work unit and
decides to roll back or commit the work unit. If nothing else, I would
use PIPE literal Q LIMITS | privwu command | cons
/* PRIVWU REXX */
parse arg stage
rc = mycsl('DMSGETWU retc reas wuid') + mycsl('DMSPUSWU retc reas
wuid')
'callpipe (end \) *: |' stage '| *:'
piprc = rc
if rc <> 0 then rc = mycsl('DMSROLLB retc reas')
else rc = mycsl('DMSCOMM retc reas')
rc = mycsl('DMSPOPWU retc reas') + mycsl('DMSRETWU retc reas wuid')
return piprc
mycsl:
parse arg routine retc reas .
myrc = csl(arg(1))
if myrc <> 0 then say 'RC='myrc 'from CSL call' routine,
'Reason Code' value(reas)
return myrc