Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 8201
Location: Dubuque, Iowa, 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: 7314

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 The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us