Decrementing a loop



IBM's Command List programming language & Restructured Extended Executor

Decrementing a loop

Postby Jeri Kattar » Fri Sep 21, 2007 7:07 pm

Hi,
To decrement a loop, I am using the following code. Please let me know if this fine.
I = 10
DO Z = I TO 1
SAY I
Z = I - 1
END
Jeri Kattar
 
Posts: 10
Joined: Wed Sep 19, 2007 6:37 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Decrementing a loop

Postby Jeri Kattar » Fri Sep 21, 2007 8:29 pm

Pls anyone reply to this
Jeri Kattar
 
Posts: 10
Joined: Wed Sep 19, 2007 6:37 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Decrementing a loop

Postby CICS Guy » Fri Sep 21, 2007 9:34 pm

If you are in that much of a hurry, why not just look at the manual?
Controlled Repetitive Loops
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Decrementing a loop

Postby scorpio.negi » Fri Mar 21, 2008 1:04 am

Check the IBM manual.....btw ur code wont work coz the do incrementer always adds the value (by default 1)....if you want to decrement do something like...

do i = 10 to 1 step by -1
....
....
end
scorpio.negi
 
Posts: 1
Joined: Fri Mar 21, 2008 12:54 am
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post