[CMS-PIPELINES] I'm stumped
This: '|Spec printonly EOF a: w3 . set #0+=1', 'if a>#1 then', 'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#1:=a;#2:=b;#3:=c) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', causes: PIPSPE1037E Field identifiers cannot be defined in break items. PIPMSG004I ... Issued from stage 2 of pipeline 2 name "pageRate_alerts". PIPMSG001I ... Running "Spec printonly EOF a: w3 . set #0+=1 if a>#1 then". PIPSPE192I ... Scan at position 31; previous data "a: w3 . set #0+=1 if a>#1 then". and I just can't see it, unless the if...fi clause is considered a break item. No complaints without it though. And I've certainly defined field identifiers within if clauses before, just not in conjunction with a printonly option. Suggestions? Thanks, -- Mike Harding z/VM System Support /sp
Re: [CMS-PIPELINES] I'm stumped
Message 192 gives the game away. Wouldn't you say that EOF is a break? On 09/05/2013 09:05 PM, Michael Harding wrote: This: '|Spec printonly EOF a: w3 . set #0+=1', 'if a>#1 then', 'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#1:=a;#2:=b;#3:=c) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', causes: PIPSPE1037E Field identifiers cannot be defined in break items. PIPMSG004I ... Issued from stage 2 of pipeline 2 name "pageRate_alerts". PIPMSG001I ... Running "Spec printonly EOF a: w3 . set #0+=1 if a>#1 then". PIPSPE192I ... Scan at position 31; previous data "a: w3 . set #0+=1 if a>#1 then". and I just can't see it, unless the if...fi clause is considered a break item. No complaints without it though. And I've certainly defined field identifiers within if clauses before, just not in conjunction with a printonly option. Suggestions? Thanks, -- Mike Harding z/VM System Support /sp
Re: [CMS-PIPELINES] I'm stumped
Well, I thought "printonly eof" was a stage option rather than a break, and the latter "eof" following the if clause sets the break action. There aren't any field definitions after that one. Too, from what you're saying it should complain about the definition of a:, when instead it seems to be complaining about the definition of b: within the if clause. So I removed the printonly eof and the latter eof, just for grins, and got the same error. Completely flummoxed now... Reviewing the Specs reference, I did come across: | Conditional groups cannot contain input sources that have identifiers, as it | is indeterminate, in general, whether the field has been defined or not. So maybe that's the problem and the message 1037 was leading me down the wrong path, except the only identifier being used as an input source was in "if a>#1", so I put a in another counter prior to the if and tested that: |Spec printonly EOF a: w3 . set (#0+=1;#5:=a)', 'if #5>#1 then', 'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#1:=a;#2:=b;#3:=c) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', Same error 1037, with or without the printonly and later eof. Finally, taking all identifier references out of the if clause worked: '|Spec printonly EOF a: w3 . b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#0+=1;#5:=a;#6:=b;#7:=c)', 'if #5>#1 then', 'set (#1:=a;#2:=#6;#3:=#7) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', 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... Anyway, thanks for the response. -- Mike Harding z/VM System Support mhard...@us.ibm.com mikehard...@mindless.com (925) 926-3179 (w) (925) 323-2070 (c) /sp CMSTSO Pipelines Discussion List wrote on 09/05/2013 01:05:50 PM: > From: "John P. Hartmann" > To: CMS-PIPELINES@vm.marist.edu, > Date: 09/05/2013 01:06 PM > Subject: Re: I'm stumped > Sent by: CMSTSO Pipelines Discussion List > > Message 192 gives the game away. Wouldn't you say that EOF is a break? > > On 09/05/2013 09:05 PM, Michael Harding wrote: > > This: > > '|Spec printonly EOF a: w3 . set #0+=1', > > 'if a>#1 then', > >'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', > >'set (#1:=a;#2:=b;#3:=c) fi', > > 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', > >'/on/ nw print #2 strip nw /at/ nw print #3 strip nw', > > > > causes: > > PIPSPE1037E Field identifiers cannot be defined in break items. > > PIPMSG004I ... Issued from stage 2 of pipeline 2 name "pageRate_alerts". > > PIPMSG001I ... Running "Spec printonly EOF a: w3 . set #0+=1 if a>#1 then". > > PIPSPE192I ... Scan at position 31; previous data "a: w3 . set #0+=1 if > > a>#1 then". > > > > and I just can't see it, unless the if...fi clause is considered a break > > item. No complaints without it though. > > And I've certainly defined field identifiers within if clauses before, > > just not in conjunction with a printonly option. > > > > Suggestions? > > Thanks, > > -- > > Mike Harding > > z/VM System Support > > > > /sp >
Re: [CMS-PIPELINES] I'm stumped
Mike, you are right right, I was a tad too fast off the mark. The problem is at the end of the 192 string with b:. You can refer to field identifiers in conditional parts, but you cannot define them. I guess I should have reworded message 1037 or at least updated the help file, but such is life. Sorry about the confusion. On 09/05/2013 11:12 PM, Michael Harding wrote: Well, I thought "printonly eof" was a stage option rather than a break, and the latter "eof" following the if clause sets the break action. There aren't any field definitions after that one. Too, from what you're saying it should complain about the definition of a:, when instead it seems to be complaining about the definition of b: within the if clause. So I removed the printonly eof and the latter eof, just for grins, and got the same error. Completely flummoxed now... Reviewing the Specs reference, I did come across: | Conditional groups cannot contain input sources that have identifiers, as it | is indeterminate, in general, whether the field has been defined or not. So maybe that's the problem and the message 1037 was leading me down the wrong path, except the only identifier being used as an input source was in "if a>#1", so I put a in another counter prior to the if and tested that: |Spec printonly EOF a: w3 . set (#0+=1;#5:=a)', 'if #5>#1 then', 'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#1:=a;#2:=b;#3:=c) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', Same error 1037, with or without the printonly and later eof. Finally, taking all identifier references out of the if clause worked: '|Spec printonly EOF a: w3 . b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#0+=1;#5:=a;#6:=b;#7:=c)', 'if #5>#1 then', 'set (#1:=a;#2:=#6;#3:=#7) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', 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... Anyway, thanks for the response. -- Mike Harding z/VM System Support mhard...@us.ibm.com mikehard...@mindless.com (925) 926-3179 (w) (925) 323-2070 (c) /sp CMSTSO Pipelines Discussion List wrote on 09/05/2013 01:05:50 PM: From: "John P. Hartmann" To: CMS-PIPELINES@vm.marist.edu, Date: 09/05/2013 01:06 PM Subject: Re: I'm stumped Sent by: CMSTSO Pipelines Discussion List Message 192 gives the game away. Wouldn't you say that EOF is a break? On 09/05/2013 09:05 PM, Michael Harding wrote: This: '|Spec printonly EOF a: w3 . set #0+=1', 'if a>#1 then', 'b: substr 1.8 of w2 . c: substr 9.6 of w2 .', 'set (#1:=a;#2:=b;#3:=c) fi', 'eof print #0 strip 5 /samples, max was/ nw print #1 strip nw', '/on/ nw print #2 strip nw /at/ nw print #3 strip nw', causes: PIPSPE1037E Field identifiers cannot be defined in break items. PIPMSG004I ... Issued from stage 2 of pipeline 2 name "pageRate_alerts". PIPMSG001I ... Running "Spec printonly EOF a: w3 . set #0+=1 if a>#1 then". PIPSPE192I ... Scan at position 31; previous data "a: w3 . set #0+=1 if a>#1 then". and I just can't see it, unless the if...fi clause is considered a break item. No complaints without it though. And I've certainly defined field identifiers within if clauses before, just not in conjunction with a printonly option. Suggestions? Thanks, -- Mike Harding z/VM System Support /sp >
Re: [CMS-PIPELINES] I'm stumped
On Thu, Sep 5, 2013 at 11:12 PM, Michael Harding 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 9.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