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
 

 

Replacing GO TO Statements

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

New User


Joined: 16 Oct 2008
Posts: 73
Location: Boston

PostPosted: Tue Dec 02, 2014 5:28 pm    Post subject: Replacing GO TO Statements
Reply with quote

My management as part of a COBOL standard that they introduced recently wants to replace all the GO TO statements. They have blindly said 'No GO TOs please for any of the new as well as the existing programs'.
There are more than 600+ Cobol programs having GO TOs in them which they want to be changed. This changing of GO TOs for the existing program does not make any sense to me as they work perfectly well now and they could have said they want it to be implemented for new programs.

Just wanted to know if there would be any way this can be done without me getting to analyse all the GO TO statements in each of the 600+ programs making sure that I dont tamper with the existing functionality.

Any suggestion in this regard would be highly appreciated.

Thank you!
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Dec 02, 2014 5:50 pm    Post subject: Reply to: Replacing GO TO Statements
Reply with quote

It will be very costly to analyse, change and test 600 programs to remove GO TOs and subsequently ensure that their behaviour is identical.

However, if that is what is ordered, then presumably the large cost (both in financial terms and in analysis/development/testing resources) has already been accepted.

There are no shortcuts. Unless you are lucky.

If, for instance, the only use of GO TO is to get to a fatal-error routine, then replacing the GO TO by a PERFORM will do (the fatal error generated will ensure there is no return from the PERFORM)..

However, it is much more likely that the GO TOs are in ordinary code, and that to post facto avoid their use will require sufficient restructuring as to require considerable amounts of testing.

He who pays the Piper calls the tune. But do they really know the cost? To achieve what, for that cost?

I've never heard of going back and removing GO TOs from all programs. For major changes to an existing program, it is reasonable to consider, since the testing can cover those changes as well. For small-to-medium changes to existing programs, it is not "worth" upsetting the existing program, in general.

If your company has money, resources and time to burn then OK (and get them to contact me, I don't mind making the changes in such situations of largesse).

For new programs, entirely reasonable. For existing programs not under major change, let's be polite and say it is a "questionable" idea at best.

PM me for contact and bank account details.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1238
Location: Richfield, MN, USA

PostPosted: Tue Dec 02, 2014 7:46 pm    Post subject:
Reply with quote

Bill brings up valid points, but I'd like to add another. The cost of replacing GO TOs should be weighed against the cost of maintaining those programs as is. Many of us have dealt with programs written decades ago and have been modified by numerous developers with numerous coding styles. The longer these programs exist the more difficult they become to understand because of those reasons. Advancement of COBOL functions have not always been taken advantage of. One option woud be to deal with these programs one at a time when other changes are required instead of biting the bullet with all 600 at one time.
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Tue Dec 02, 2014 8:26 pm    Post subject:
Reply with quote

Replacing GO TO could change the way the program was created.

Having said no GO TO in the new programs is a better idea.

But replacing all GO TO in existing programs is not a good idea.

I personally feel it is not worthy at all .. Assuming it will just take 2 hrs to do the analysis & change and 1 hr to do the promote and 1 hr for documentation and 1hr to retest .. 600 * 5 = 3000 hrs..

Assuming you work for 10 productive hrs a day = 300 days

Its just not worth it
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 Symbolic Parameters in SYSIN DD state... madishpa DFSORT/ICETOOL 3 Mon Jun 27, 2016 6:23 pm
No new posts Replacing Start Transid with LINK pkmurali CICS 12 Tue Apr 19, 2016 8:22 pm
No new posts Extracting Information from DD Statem... Charles Wolters All Other Mainframe Topics 7 Wed Apr 13, 2016 10:21 pm
No new posts Parsing JCL SET var=value statements prino CLIST & REXX 0 Sat Dec 26, 2015 4:41 am
No new posts DFSORT control statements in any order ? ronald masters DFSORT/ICETOOL 2 Tue Dec 15, 2015 11:22 pm


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