Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 6967
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: RETURN CHANNEL pahiker CA Products 21 Thu Apr 20, 2017 12:31 am
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us