IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use of Perform Thru Exit


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MichelleSpeer

New User


Joined: 22 Aug 2020
Posts: 7
Location: United States

PostPosted: Wed Aug 02, 2023 1:11 am
Reply with quote

I've been a cobol programmer for 28 years, all shops standards were like below.

Code:
     PERFORM A000-PARA THRU A000-PARA-EXIT.
A000-PARA.
     DO STUFF.
     DO MORE STUFF.
A000-PARA-EXIT.
     EXIT.


I have recently started in new area and, without any reason, I was told not to code the THRU and A000-PARA-EXIT. Just wondering is this new standard due to use of IBM Enterprise COBOL for z/OS 6.3.0? Does anyone have any thoughts/explanation?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Aug 02, 2023 2:14 am
Reply with quote

The 'standard' is just what was being taught back then.

I do it that way, but it is no way the official standard.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Aug 02, 2023 3:42 am
Reply with quote

One reason to always use THRU...EXIT is that one can easily see where the PERFORMED code ends.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3066
Location: NYC,USA

PostPosted: Wed Aug 02, 2023 6:36 am
Reply with quote

It’s a choice .. people used to work with lots of GOTOs and you need that thru exit routines .. I would always prefer thru but I have also seen mixed bags some use thru and some don’t and need to follow period and if we miss by any chance then a potential bug .

So both will work but it’s company enforced standards to adhere.
Back to top
View user's profile Send private message
MichelleSpeer

New User


Joined: 22 Aug 2020
Posts: 7
Location: United States

PostPosted: Tue Aug 22, 2023 8:27 pm
Reply with quote

@Phrzby Phil exactly.

Thanks for response from everyone. I've just never worked in shop that the THRU EXIT was not required per standards, even though GOTOs were not allowed.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Aug 23, 2023 2:37 am
Reply with quote

Ironically, I was taught and use:

Code:
GOTO PARAGRAPH-EXIT


to quickly get out of that's paragraph code.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Fri Aug 25, 2023 7:04 am
Reply with quote

When I started PERFORM….THRU was our shop standard. 40 years later, it is forbidden by the standard.

I used to ignore the old standard anyway because I felt it was pointless when you don’t use GO TO.

As far as finding the paragraph end, our standard forbids the use of periods except when required by syntax rules. The end of a paragraph is one of those times that it is required. We code that period on a line all by itself to make it stand out.

The nice thing about Standards is that there are so many to choose from. 😅
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts user exit in IBM Infosphere Optim DB2 8
No new posts ACS exit routine JCL & VSAM 0
No new posts Research regarding csqcapx exit CICS 0
No new posts ISPF END or EXIT in Rexx CLIST & REXX 13
No new posts Need to locate SMF Exit IEFUJI All Other Mainframe Topics 3
Search our Forums:

Back to Top