View previous topic :: View next topic
|
Author |
Message |
MichelleSpeer
New User
Joined: 22 Aug 2020 Posts: 7 Location: United States
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1049 Location: Richmond, Virginia
|
|
|
|
One reason to always use THRU...EXIT is that one can easily see where the PERFORMED code ends. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
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 |
|
|
MichelleSpeer
New User
Joined: 22 Aug 2020 Posts: 7 Location: United States
|
|
|
|
@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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Ironically, I was taught and use:
Code: |
GOTO PARAGRAPH-EXIT |
to quickly get out of that's paragraph code. |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
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 |
|
|
|