Skip to main content

We need a Code Count (Lines of Code) Utility of our COBOL code. Does Microfocus have something like that for NetExpress and Mainframe Express or could you suggest a tool?

 

We need a Code Count (Lines of Code) Utility of our COBOL code. Does Microfocus have something like that for NetExpress and Mainframe Express or could you suggest a tool?

 

You could try David Wheeler's Open Source sloccount software; it claims to support COBOL:

www.dwheeler.com/sloccount

Note that on Windows it requires Cygwin (http://cygwin.org).


We need a Code Count (Lines of Code) Utility of our COBOL code. Does Microfocus have something like that for NetExpress and Mainframe Express or could you suggest a tool?

 

If you compile with the LINECOUNT(2) directive, the Visual COBOL compiler will emit the following information at the end of the listing file:

COBOL TEST.CBL ILGEN linecount(2) verbose list();

* Micro Focus COBOL                  V2.2 revision 000 03-Dec-13 08:33 Page   1

* TEST.CBL

* Options: NOLIST NOASMLIST OMF(OBJ) GNT(.\\) OBJ(.\\) ILGEN linecount(2)

*          verbose list()

    1$set ilusing(System)

    2

    3 01 a-string string.       *> string and object known to compiler

    4 01 b-string type String.  *> obtained thru ilusing statement

    5 01 c-string type System.String.

    6

    7 procedure division.

    8

    9    set a-string to "hello world"

   10    display a-string

   11    .

* Micro Focus COBOL                  V2.2 revision 000 Compiler

* Copyright (C) Micro Focus 1984-2013. All rights reserved.

*                                                        REF GNR-093202000AG

* Total Messages:     0

* Lines of Source            11    Lines of Code             4

* Comment lines               2    Text comments             2

* Comment percentage         18    Statements                2

* Sections                    0    Paragraphs                0

* Files                       0    Data-items                3

* Condition                   0    Screen Name               0

* Report                      0    Level 78                  0

* Call (by number)            0    Call (by name)            0

* Call (data-item)            0    Linkage 01's              6

* Maximum Nesting             0    Overlap. prfms            0