Page 1 of 1

COBOL quality check on mainframes, any tool?

Posted: Thu Nov 26, 2015 12:22 pm
by Mukul Roy
Hi,

I amwondering if there are any tools which can verify a COBOL source for indentation mistakes? For example on conditional constructs like IF THEN ELSE construst. Or verify COBOL source for code duplication ...

Re: COBOL quality check on mainframes, any tool?

Posted: Thu Nov 26, 2015 7:06 pm
by nicc
indentation is not a COBOL Language thing - it is the programmer's thing. As such it can vary from person to person and project to project and workplace to workplace. If you need something to enforce this in your place then you a) need to set the standard, b) update old code to meet the standard c) write something to report on standard adherence (your "tool") and d) provide a mechanism (including disciplinary action) to ensure the standard is adhered to.

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Nov 27, 2015 2:34 pm
by Anuj Dhawan
I've not tried it and it's been a while when I used it but have you tried the OPTIMIZE option, which states the following:
Use OPTIMIZE to reduce the run time of your object program; optimization might also reduce the amount of storage your object program uses. Because OPTIMIZE increases compile time, and can change the order of statements in your program, you should not use it when debugging.

If OPTIMIZE is specified without any suboptions, OPTIMIZE(STD) will be in effect.

The FULL suboption requests that, in addition to the optimizations performed under OPT(STD), the compiler discard unreferenced data items from the DATA DIVISION and suppress generation of code to initialize these data items to their VALUE clauses. When OPT(FULL)is in effect, all unreferenced 77-level items and elementary 01-level items will be discarded. In addition, 01-level group items will be discarded, if none of the subordinate items are referenced. The deleted items are shown in the listing. If the MAP option is in effect, a BL number of XXXX in the data map information indicates that the data item was discarded.

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Nov 27, 2015 7:22 pm
by William Collins
OPTIMIZE is not going to help with "indentation".

Re: COBOL quality check on mainframes, any tool?

Posted: Sat Nov 28, 2015 11:58 am
by Anuj Dhawan
I went by the subject line and thought it's more to do with optimizing the code for better quality. I should have considered the content ...

Perhaps it'll benefit OP if he search on "Formatter for COBOL or Beautifier for COBOL", it'll lead to you some products for the very purpose.

Re: COBOL quality check on mainframes, any tool?

Posted: Mon Nov 30, 2015 3:03 pm
by Mukul Roy
Thanks. I have searched online on Beautifier for COBOL and found some links. But all searches suggest for a product to be purchased... can nothing be done in REXX or in the COBOL editor itself?

Re: COBOL quality check on mainframes, any tool?

Posted: Mon Nov 30, 2015 3:23 pm
by nicc
Yes - you can write a program in the language of your choice, e.g. Rexx, to do so. Which COBOL editor do you mean? I am not actially aware of an editor specific to COBOL but, presumably, any editor has commands to help you align the data. Certainly ISPF has.

Re: COBOL quality check on mainframes, any tool?

Posted: Wed Dec 16, 2015 6:06 am
by Mukul Roy
Yes I mean ISPF editor. But we manually align in ISPF or have I missed some functionality of it?

Re: COBOL quality check on mainframes, any tool?

Posted: Wed Dec 16, 2015 4:19 pm
by enrico-sorichetti
any editor has commands to help you align the data. Certainly ISPF has.
But we manually align in ISPF or have I missed some functionality of it?
what Nic meant was that ISPF provides basic commands for formatting

Code: Select all

(( )) << >> ( ) < > 
it does not provide language dependent formatting

the suggestion was to to write Your own formatting/normalizing tools
naturally Your organisation has to make the proper cost/quality analysis
( develop VS. buy )

Re: COBOL quality check on mainframes, any tool?

Posted: Wed Dec 16, 2015 7:23 pm
by nicc
Also, ISPF will autoident the cursor on newly inserted lines according to the rules as specified in the help.

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Dec 18, 2015 3:24 pm
by Mukul Roy
Thanks for all the replies.

So basically a programmer has to it all manually and no such automated tool is available.

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Dec 18, 2015 6:21 pm
by Robert Sample
I use the source indentation as a quality check on the programmer(s) that wrote the code. If the indentation is sloppy (some 4, some 3, some 9 columns for example) then I expect the code to be sloppy as well and check it MUCH more closely than I otherwise would.

Re: COBOL quality check on mainframes, any tool?

Posted: Thu Apr 28, 2016 10:59 am
by Mukul Roy
Robert Sample wrote:I use the source indentation as a quality check on the programmer(s) that wrote the code.  If the indentation is sloppy (some 4, some 3, some 9 columns for example) then I expect the code to be sloppy as well and check it MUCH more closely than I otherwise would.
Can such things be taken care in modern ways of COBOL code writing like RDz or OpenCOBOL?

Re: COBOL quality check on mainframes, any tool?

Posted: Thu Apr 28, 2016 7:10 pm
by Robert Sample
Can such things be taken care in modern ways of COBOL code writing like RDz or OpenCOBOL?
I'm not sure what you mean -- OpenCOBOL (which is the OLD name for GnuCOBOL) is merely a COBOL compiler and does not, in and of itself, enforce any standards for indentation nor quality.  RDz is a COBOL development environment that includes quality analysis tools -- as long as you agree with what IBM calls "quality" then it could be a way to do quality checks.  And I haven't used RDz so I'm not sure if it supports indentation standards or not.
Quality in code is a very broad topic, anyway -- programming styles differ and hence what one person writes in 2000 lines of COBOL may take someone else 3000 lines of COBOL.  Yet both programs produce the same result on the same input data, and the 3000-line program is structured such that it is easy to maintain while the 2000-line program has GOTO statements everywhere.  Which program is higher quality?  Would your answer change if the 2000-line program requires 1 second of CPU time per 1000 records while the 3000-line program requires 10 seconds of CPU per 1000 records?

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Apr 29, 2016 12:31 pm
by Mukul Roy
Quality in code is a very broad topic, anyway -- programming styles differ and hence what one person writes in 2000 lines of COBOL may take someone else 3000 lines of COBOL.  Yet both programs produce the same result on the same input data, and the 3000-line program is structured such that it is easy to maintain while the 2000-line program has GOTO statements everywhere.  Which program is higher quality?  Would your answer change if the 2000-line program requires 1 second of CPU time per 1000 records while the 3000-line program requires 10 seconds of CPU per 1000 records?
That's why I ask this question. COBOL is out there since so long but we don't have a such a quality control easily available to us?

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Apr 29, 2016 4:15 pm
by Robert Sample
 By now you should understand that the answer is no, partly because code quality is a really fuzzy term.  It means different things to different people.

Re: COBOL quality check on mainframes, any tool?

Posted: Fri Apr 29, 2016 4:25 pm
by enrico-sorichetti
that' s the reason i locked the topic ...