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
 

 

Things to Avoid while writing cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Things to Avoid while writing cobol program
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: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Thu Apr 04, 2013 6:34 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Apr 04, 2013 6:49 pm    Post subject: Reply to: Do / Don't or Use / Avoid while writing cobol pr
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    Post subject:
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    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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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