On Thu, Sep 5, 2013 at 11:12 PM, Michael Harding <[email protected]>wrote:

Seems unnecessarily tortuous to me, but then I'm not programming it
> And, I would swear I've used similar code before, deciding how to parse a
> record depending on the value of a fixed field.
> I.e.    ... a: w1 . if a=="type1" then b:  10.3 . else b: 20.3 endif....
> Or maybe I just wrote a rexx stage...
>
> I think there's no reason to want the defnition of the fields in the
conditional part, other than maybe using the spec stage as documentation of
your data structure. No doubt you see the problem when we would do

   if a=='USER' then b: w3 - else b: w7 - fi
   ,password:, 1 id b nw

I like the structured data in CMS Pipelines a lot for this kind of things.
Like when dealing with monitor data, I would

'| spec qual mrioddev select second 9.8 c2t(*) 1 ',
       'set #0:=delta(scgssch) print #0 nw',
       'print #0/60 pic zzzz9.9 nw',
       'print delta(rdevrdct) nw print delta(rdevwrct) nw',
       'print delta(scmfptim)/#0/8 pic zzz9.999 nw',
       'print delta(scmddtim)/#0/8 pic zzz9.999 nw',
       'print delta(scmcntim)/#0/8 pic zzz9.999 nw',

I believe you can 'qual' within the 'then' and 'else' clause.Don't think I
normally use the 'if' to distinguish between different data, but more
likely would have a selection stage to separate the streams first. But
heavily use the 'if' *stage to avoid forgetting the appendices. Some of the
more weird cases are on my blog, like
 x: if drop | sort | x:

| Sir Rob the Plumber

Reply via email to