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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Fault Analyzer - listings question. egrove IBM Tools 4 Thu Aug 11, 2016 5:31 pm
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am


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