Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Question on PERFORM n times

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
skandanuru

New User


Joined: 18 Apr 2007
Posts: 1
Location: India

PostPosted: Tue Feb 19, 2008 3:56 pm    Post subject: Question on PERFORM n times
Reply with quote

If I have a code like

MOVE 01 TO WS-COUNT
PERFORM PARA-1 WS-COUNT TIMES



PARA-1.
DISPLAY ' HI '
ADD +1 TO WS-COUNT
IF WS-COUNT > 10
GO BACK
END-IF.



Howmany times 'HI' will get displyed?
Whether 1 time or 10 times
Since the value of WS-COUNT is getting increased by 1 each time.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Tue Feb 19, 2008 4:52 pm    Post subject:
Reply with quote

test it yourself...................
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 788
Location: Chennai, India

PostPosted: Tue Feb 19, 2008 4:55 pm    Post subject:
Reply with quote

Once
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Feb 19, 2008 5:58 pm    Post subject:
Reply with quote

yes, once OF COURSE.

Quote:

MOVE 01 TO WS-COUNT
PERFORM PARA-1 1 TIMES
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Feb 19, 2008 6:06 pm    Post subject: Reply to: Question on PERFORM n times
Reply with quote

U have coded:

Code:
MOVE 01 TO WS-COUNT
PERFORM PARA-1 WS-COUNT TIMES



That means:

Code:
MOVE 01 TO WS-COUNT i.e. (WS-COUNT=1)


Now u tell the code to:

Code:
PERFORM PARA-1 WS-COUNT TIMES

i.e. PERFORM PARA-1 01 TIMES


Therefore it will perform only once.


Regards,
Shitij
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts question about dfsms management clas... Hervey Martinez IBM Tools 0 Tue Oct 10, 2017 6:19 pm
No new posts Question related to Data dictionary f... rexx77 SYNCSORT 3 Thu Aug 31, 2017 7:23 am
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts QUESTION: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us