Yes, that would seem better.  But, I no longer have the email(s?) I
exchanged with you when I discovered this problem many years ago.  I think
to remember that your reply was: "the STATE stage should not issue a Commit
and commit everything".  And, that's right indeed.  Maybe my question was
unclear/misleading.

So indeed, if you'd change STATE to use its own workunit, fewer people would
get the surprises of the current behaviour.

And, a remark to Rob: the QUERY LIMITS is just an example of a command that
stops working in an open workunit.  I use this as example as that was where
I discovered there was a problem.  I often stay a very long time in FILELIST
for example, without returning to CMS Ready.  With my changes to FILELIST,
the top line can be changed to
 *   DISK: X R/W 17 Files, DIR POOLSRC:MAINT. 2% of 362000 4K blocks Used*
At some time I saw that this x% used was no longer displayed.  So then I
went looking for which piece of code could be the cause, and I found PIPE
STATE.... and contacted John...

2011/8/19 Rob van der Heij <[email protected]>

> 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
>



--
Kris Buelens,
IBM Belgium, VM customer support

Reply via email to