IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Things to Avoid while writing cobol program


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

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Thu Apr 04, 2013 6:22 pm
Reply with quote

Hi friends,

I would like know what are things need to following while writing cobol programs..

Like : 1) Avoid INTIALIZE table group variable
2) Try to use avoid Evaluate etc
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8568
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 04, 2013 6:34 pm
Reply with quote

First and foremost: FOLLOW YOUR SITE STANDARDS!

Be aware that site standards vary from site to site, so what is not allowed at one site will be mandated at another site. And if you follow site standards, they may contradict anything you are told on this forum so you will need to filter every response against the site standards for your site. There is nothing inherently "good" or "bad" about INITIALIZE or EVALUATE or any other COBOL verb -- there are times when they should be used and times when they should not. Your goal should be to produce clear code that accomplishes the needed task.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Thu Apr 04, 2013 6:49 pm
Reply with quote

Difficult, as Robert has indicated. Within the scope of the standards, people often have their own "style" (or lack of it).

Avoid bad code.

Don't use "NEXT SENTENCE" with a "scope-delimiter", like END-IF or END-SEARCH or anything. Use CONTINUE.

In Production:

Don't do "clever" things which others won't understand.

Don't do things which rely on things which you are not supposed to rely on but happen to work for now.

Don't do things which won't pass an Audit.

CYA.

If the spec says it can never happen but disaster will ensue if it does, abend with appropriate and accurate messages. It'll never happen, remember :-)

Don't change a line of code without a spec for the change. If something looks "wrong", raise it as an issue - but don't just change it.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Apr 04, 2013 7:42 pm
Reply with quote

"Don't do "clever" things which others won't understand. "

My biggest fault. Just yesterday I took a smart job step I had written and replaced it with three dumb ones that anyone could understand.

It's not because other people CAN'T figure it out, it's that the shouldn't HAVE to.
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

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL Performance Tuning COBOL Programming 6
No new posts JCL for replacing code in Cobol JCL & VSAM 8
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
This topic is locked: you cannot edit posts or make replies. Sample CICS Webservices Program CICS 1
No new posts XML Parsing in COBOL creating "h... COBOL Programming 0

Back to Top