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 statement

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

New User


Joined: 13 Feb 2008
Posts: 3
Location: India

PostPosted: Wed Feb 17, 2010 11:15 am    Post subject: Question on Perform statement
Reply with quote

Hi,

I have a quick question on the below code with how the PERFORM statement works..

Code:
.
.
.
        PERFORM PARA-NAME-1 THRU PARA-NAME-1.
.
.
.
PARA-NAME-1.
        .
        .
        .
EX-PARA-NAME-1.
   EXIT.




Ideally the above PERFORM statement should have been written as
PERFORM PARA-NAME-1 THRU EX-PARA-NAME-1. But there was a typo mistake and the actual code was PERFORM PARA-NAME-1 THRU PARA-NAME-1. When the above code is executed will the statements inside the PARA-NAME-1 would be executed or not?
Back to top
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Feb 17, 2010 11:27 am    Post subject:
Reply with quote

Quote:
When the above code is executed will the statements inside the PARA-NAME-1 would be executed or not?

They will be executed (once).
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Feb 17, 2010 11:35 am    Post subject:
Reply with quote

Hello,

Quote:
But there was a typo mistake and the actual code was PERFORM PARA-NAME-1 THRU PARA-NAME-1.
If there is an instruction in PARA-NAME-1 that issues a GO TO EX-PARA-NAME-1, the result will be unpredictable as the execution can "fall thru" and cause a wide variety of surprises. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Feb 17, 2010 2:10 pm    Post subject: Reply to: Question on Perform statement
Reply with quote

Why not run a quick test for what you've asked?
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 Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm
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


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