Re: New Rexx Question
or, Stop_Condtition = 99 Size = Atay.0 + 1 Array.Size = Stop_Condition i = 0 Do While (i <> Stop_Condtition) i = i + 1 InsertCond? Array.Size = NewValue Size = Size + 2 Atrray. Size = Stop_Condtition End End ITschak On Fri, Feb 28, 2020 at 6:01 AM Bob Bridges wrote: > You can also use UNTIL to simulate an IF block from which you can LEAVE. > Otherwise it's difficult, or at least a little complicated. Like this: > > /* hard way */ > if condition1 then do > if \subcondition2 then do > v1=calculation(a,b) > v2=calculation(c,d) > if v15 then do > /* process your logic */ > end > end > end > > You can't make it a pure CASE statement because of the calculations you > have to perform inside the block. But you can do this: > > /* I prefer: */ > do until true /* in other words, do once */ > if \condition1 then leave > if subconfition2 then leave > v1=calculation(a,b) > v2=calculation(c,d) > if \(v15) then leave > /* process your logic */ > end > > I think this is simpler to look at. > > --- > Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313 > > /* God's never been disappointed in me, because he never had any illusions > about me. -Clay McLean */ > > -Original Message- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On > Behalf Of Paul Gilmartin > Sent: Thursday, February 27, 2020 17:29 > > > UNTIL has the minor simplification over WHILE in that it's not evaluated > until the end, so its variables needn't be preset. I've taken advantage of > that on occasion. > > --- On Thu, 27 Feb 2020 21:58:29 +, Gibney, Dave wrote: > >I left out the bit where the addition was conditional. > >I suppose using the while or until is actually more understandable anyway. > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > -- ITschak Mugzach *|** IronSphere Platform* *|* *Information Security Continuous Monitoring for Legacy **| * -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
You can also use UNTIL to simulate an IF block from which you can LEAVE. Otherwise it's difficult, or at least a little complicated. Like this: /* hard way */ if condition1 then do if \subcondition2 then do v1=calculation(a,b) v2=calculation(c,d) if v15 then do /* process your logic */ end end end You can't make it a pure CASE statement because of the calculations you have to perform inside the block. But you can do this: /* I prefer: */ do until true /* in other words, do once */ if \condition1 then leave if subconfition2 then leave v1=calculation(a,b) v2=calculation(c,d) if \(v15) then leave /* process your logic */ end I think this is simpler to look at. --- Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313 /* God's never been disappointed in me, because he never had any illusions about me. -Clay McLean */ -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Paul Gilmartin Sent: Thursday, February 27, 2020 17:29 > UNTIL has the minor simplification over WHILE in that it's not evaluated until the end, so its variables needn't be preset. I've taken advantage of that on occasion. --- On Thu, 27 Feb 2020 21:58:29 +, Gibney, Dave wrote: >I left out the bit where the addition was conditional. >I suppose using the while or until is actually more understandable anyway. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
I love the ITERATE statement, to the extent that I've insisted on its availability in other languages. In VBA, for instance, like this: For each oxct in xcts If Not Exists(Collection, xct.Key) Then Goto IterateXct ...blah, blah, blah... IterateXct: Next oxct Very handy to prevent long indented If blocks; multiple ITERATES are much easier to debug. --- Bob Bridges, robhbrid...@gmail.com, cell 336 382-7313 /* Three people may keep a secret, if two of them are dead. -Poor Richard */ -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Gibney, Dave Sent: Thursday, February 27, 2020 17:40 On further contemplation, I also wanted to use iterate, so I surrounded the whole thing with i = 1 do forever do i = i to stem.0 /* Processing with conditional additions and iterates */ end if i > stem.0 leave end -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
On further contemplation, I also wanted to use iterate, so I surrounded the whole thing with i = 1 do forever do i = i to stem.0 /* Processing with conditional additions and iterates */ end if i > stem.0 leave end > -Original Message- > From: IBM Mainframe Discussion List On > Behalf Of Paul Gilmartin > Sent: Thursday, February 27, 2020 2:29 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Re: New Rexx Question > > On Thu, 27 Feb 2020 21:58:29 +, Gibney, Dave wrote: > > >I left out the bit where the addition was conditional. > >I suppose using the while or until is actually more understandable anyway. > > > UNTIL has the minor simplification over WHILE in that it's not evaluated until > the end, so its variables needn't be preset. I've taken advantage of that on > occasion. > > -- gil > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, send email to > lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
On Thu, 27 Feb 2020 21:58:29 +, Gibney, Dave wrote: >I left out the bit where the addition was conditional. >I suppose using the while or until is actually more understandable anyway. > UNTIL has the minor simplification over WHILE in that it's not evaluated until the end, so its variables needn't be preset. I've taken advantage of that on occasion. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
I left out the bit where the addition was conditional. I suppose using the while or until is actually more understandable anyway. > -Original Message- > From: IBM Mainframe Discussion List On > Behalf Of Billy Ashton > Sent: Thursday, February 27, 2020 1:52 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Re: New Rexx Question > > Dave, you are correct that stem.0 is resolved at the start. If you think about > it, if it were dynamic, then your code would be a never-ending loop. > > The key here is to know how many items you want to add, and where in the > stem list you want to add them. Give us a little more detail, and we can help > you out. > > Billy > > > From: "Gibney, Dave" > To: IBM-MAIN@listserv.ua.edu > Sent: 2/27/2020 4:14:49 PM > Subject: New Rexx Question > > >I wish to process a basic stem variable with stem.0 containing the > >occurrences, do I = 1 to stem.0 > >/* but, inside here, I wish to add additional occurrences */ > > a = stem.0 + 1 > > stem.a = 'New item' > > stem.0 = a > >end > > > >It appears that the do start and stop are evaluated and fixed at the > beginning and subsequent alterations to the end value aren't effective. > >Is this just the way it is? Or is there a technique I don't know? > > > >Dave Gibney > >Information Technology Services > >Washington State University > > > > > >-- > >For IBM-MAIN subscribe / signoff / archive access instructions, send > >email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, send email to > lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
Yup. Page 53 of z/OS V2R1.0 TSO/E REXX Reference. I see it now. > -Original Message- > From: IBM Mainframe Discussion List On > Behalf Of Binyamin Dissen > Sent: Thursday, February 27, 2020 1:51 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Re: New Rexx Question > > By definition: > > "They are evaluated only one time, before the loop begins and before the > control variable is set to its initial value." > > Use WHILE or UNTIL > > On Thu, 27 Feb 2020 21:14:49 + "Gibney, Dave" > wrote: > > :>I wish to process a basic stem variable with stem.0 containing the > occurrences, :>do I = 1 to stem.0 > :>/* but, inside here, I wish to add additional occurrences */ :> a = stem.0 > + > 1 :> stem.a = 'New item' > :> stem.0 = a > :>end > > :>It appears that the do start and stop are evaluated and fixed at the > beginning and subsequent alterations to the end value aren't effective. > :>Is this just the way it is? Or is there a technique I don't know? > > -- > Binyamin Dissen > https://urldefense.proofpoint.com/v2/url?u=http- > 3A__www.dissensoftware.com=DwICAg=C3yme8gMkxg_ihJNXS06Zy > Wk4EJm8LdrrvxQb- > Je7sw=u9g8rUevBoyCPAdo5sWE9w=anYLYeJKFF_g8L3d7dTdL98BheR- > p- > DuaBjZQvOY9oo=2H1QCNgt2DVGmsSfiJR8VmpFv6p5jBees0gwtJ9whzw > = > > Director, Dissen Software, Bar & Grill - Israel > > > Should you use the mailblocks package and expect a response from me, you > should preauthorize the dissensoftware.com domain. > > I very rarely bother responding to challenge/response systems, especially > those from irresponsible companies. > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, send email to > lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
Dave, you are correct that stem.0 is resolved at the start. If you think about it, if it were dynamic, then your code would be a never-ending loop. The key here is to know how many items you want to add, and where in the stem list you want to add them. Give us a little more detail, and we can help you out. Billy From: "Gibney, Dave" To: IBM-MAIN@listserv.ua.edu Sent: 2/27/2020 4:14:49 PM Subject: New Rexx Question I wish to process a basic stem variable with stem.0 containing the occurrences, do I = 1 to stem.0 /* but, inside here, I wish to add additional occurrences */ a = stem.0 + 1 stem.a = 'New item' stem.0 = a end It appears that the do start and stop are evaluated and fixed at the beginning and subsequent alterations to the end value aren't effective. Is this just the way it is? Or is there a technique I don't know? Dave Gibney Information Technology Services Washington State University -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
By definition: "They are evaluated only one time, before the loop begins and before the control variable is set to its initial value." Use WHILE or UNTIL On Thu, 27 Feb 2020 21:14:49 + "Gibney, Dave" wrote: :>I wish to process a basic stem variable with stem.0 containing the occurrences, :>do I = 1 to stem.0 :>/* but, inside here, I wish to add additional occurrences */ :> a = stem.0 + 1 :> stem.a = 'New item' :> stem.0 = a :>end :>It appears that the do start and stop are evaluated and fixed at the beginning and subsequent alterations to the end value aren't effective. :>Is this just the way it is? Or is there a technique I don't know? -- Binyamin Dissen http://www.dissensoftware.com Director, Dissen Software, Bar & Grill - Israel Should you use the mailblocks package and expect a response from me, you should preauthorize the dissensoftware.com domain. I very rarely bother responding to challenge/response systems, especially those from irresponsible companies. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: New Rexx Question
I think thats true. You should be able to code do while i <= stem.0 to do what you want. You will have to set initial value for i and increment it in your loop. Dana On Thu, 27 Feb 2020 21:14:49 +, Gibney, Dave wrote: > >It appears that the do start and stop are evaluated and fixed at the beginning >and subsequent alterations to the end value aren't effective. >Is this just the way it is? Or is there a technique I don't know? > >Dave Gibney >Information Technology Services >Washington State University -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN