From: n087ec@tamuts.tamu.edu (Hessel Kooistra)
Newsgroups: alt.cobol
Subject: COBOL automatic flow charter
Date: 9 Jan 1993 22:19:42 GMT
Organization: ~/lib/organization
NNTP-Posting-Host: tamuts.tamu.edu

Several people have mailed me asking about my program, so I have 
a history and description worked up:

     I am an "older" undergraduate business analysis student here
at Texas A&M University.  One of the courses I have had to take was
COBOL.  With each lab we turned in, we had to turn in, (get this):

     1.  IPO chart
     2.  Hierarchy chart
     3.  Output design chart
     4.  Flow chart

     I found this to be extremely annoying, having been a
programmer for years before I started college.  So, I fired up the
old C compiler (Turbo C++ 2.0) and went to work.  The IPO charts I
left to be done by hand, but by the time I was through, I
developed:

     HICOL:      Automatic hierarchy chart generator.
                 Reads COBOL source code and generates a hierarchy
                 chart.
     COBOLOUT:   Automatic output design chart generator.
                 Reads COBOL source code and generates an output
                 design chart.
     COBOLSCR:   Automatic COBOL source code screen generator.
                 Reads a text file containing what you want your
                 output (report) to look like and generates the
                 COBOL source code for that output.
     FLOWCHRT:   Automatic COBOL flow charter.
                 Reads COBOL source code and generates a flow
                 chart.

     All work fine for me, but the first three programs require a
little too much tinkering with to be released.  There is a big
difference between a program that the programmer finds usable and
a program that the general public can use.  The first three fall
into the former category.  As for FLOWCHRT, I have been giving it
exclusive attention trying to get it into a releasable form.  My
goal is to be able to flowchart any COBOL program with absolutely
no user intervention required.  I am about there now, with a few
limitations.
     FLOWCHRT reads the source code text file, writes some
intermediate files, then writes binary files containing the HP PCL
(level 3) for the flow chart.  The user then copies the binary
files to the printer and the chart is printed.  It was written in
99% pure ANSI C, with no ++ extensions and should port to most
systems with very little work.  It was specifically designed for PC
use, however.  A printer that is HP compatible (PCL) is required.
I think that most systems running COBOL should have a PC hooked in
somewhere, and the HP compatible laser printers are a standard
today.
     FLOWCHRT will handle all of COBOL 74 and most of the 85
extensions.  Specifically, END-IF's and EVALUATE's are no problem,
and I think those were the major extensions anyway.  The system we
use at school is a IBM 3090 with COBOL 85 and MVS as the operating
system.  I would FTP the source code in ASCII mode to a unix
machine, then download that over the phone to my 486, where I would
flowchart it.  It is important for the source to be in ASCII, not
EBCDIC.
     The entire program was written by me, including the parser.
The only thing I have not written entirely from scratch is Ralph
Brown's SPAWNO replacement for the spawn..() functions which I use
for memory management reasons.  The parser will handle just about
anything right now, and the program's main limitation is the logic
to break the chart up into pages.  At the moment, IF structures
more than about 4 or 5 deep will be bad.  By deep, I mean:
  IF
     IF
       IF
         IF
           IF /* Possible problem here */
             IF /* Real problem here */
  ELSE

and not:
  IF
  ELSE
    IF
  ELSE
    IF ... /* etc., which are handled fine */

     Really badly unstructured code may be a problem, I am not
sure.  The source code must also be running, error free code with
all keywords in capitals. (The capitals thing would be easy to fix,
but I have not gotten around to it.)
     As for releasing the program, well, I am afraid I can not go
the shareware of PD route.  See, there are a couple of concerns:

     1.  I am a broke undergraduate student.
     2.  I will be starting medical school next fall, at which time
         I will be a broke medical student.
     3.  I think this program has some commercial potential.

Therefore, given the above, I can't see going PD or even shareware.
Given the commercial marketing, I am a little leery to release
.exe's to places that are not "under my thumb," so to speak.  I
have seen a few too many pirates and damned good hackers to just
let these things go out.
     I need to test it on some "real" COBOL code.  It works on
everything I have written, and every program in _COBOL Structured
Programming Techniques for Solving Problems_ by George C. Fowler,
the COBOL guru here at A&M.  (He must be a guru, there is a picture
of him and Grace Hopper in the book.)  Anyway, that brought up my
original quest for source code.  I thought there might be some
floating around the net.  I find it very strange that there does
not appear to be any, given the widespread use of COBOL.
     So, if anyone knows of a site that has some COBOL source code
on it, or would not mind mailing me a program or two to try, I
would appreciate it.


Hessel
n087ec@tamuts.tamu.edu

.