COBOL quality check on mainframes, any tool?

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Locked
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

COBOL quality check on mainframes, any tool?

Post 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 ...
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COBOL quality check on mainframes, any tool?

Post 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.
Regards
Nic
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL quality check on mainframes, any tool?

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: COBOL quality check on mainframes, any tool?

Post by William Collins »

OPTIMIZE is not going to help with "indentation".
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: COBOL quality check on mainframes, any tool?

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

Re: COBOL quality check on mainframes, any tool?

Post 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?
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COBOL quality check on mainframes, any tool?

Post 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.
Regards
Nic
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

Re: COBOL quality check on mainframes, any tool?

Post by Mukul Roy »

Yes I mean ISPF editor. But we manually align in ISPF or have I missed some functionality of it?
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: COBOL quality check on mainframes, any tool?

Post 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 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: COBOL quality check on mainframes, any tool?

Post by nicc »

Also, ISPF will autoident the cursor on newly inserted lines according to the rules as specified in the help.
Regards
Nic
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

Re: COBOL quality check on mainframes, any tool?

Post by Mukul Roy »

Thanks for all the replies.

So basically a programmer has to it all manually and no such automated tool is available.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL quality check on mainframes, any tool?

Post 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.
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

Re: COBOL quality check on mainframes, any tool?

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL quality check on mainframes, any tool?

Post 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?
Mukul Roy
Website Team
Website Team
Posts: 24
Joined: Wed Jul 17, 2013 9:07 am

Re: COBOL quality check on mainframes, any tool?

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: COBOL quality check on mainframes, any tool?

Post 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.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: COBOL quality check on mainframes, any tool?

Post by enrico-sorichetti »

that' s the reason i locked the topic ...
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Locked

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”