Re: Beautify code



"Arnold Trembley" <arnold.trembley@xxxxxxxxxxxxxxxx> wrote in message
news:445AC1AA.5080804@xxxxxxxxxxxxxxxxxxx
Posted and emailed

Steve Rainbird wrote:

I have a huge Cobol program which I have been asked to maintain.
Unfortunately its very badly indented which makes it difficult to follow.

Does anyone know of any software (preferably free) which will indent it
nicely for me?


Here's my own amateur attempt at beautification, although I don't think it
will fix IF statement indentation. On the other hand, it is completely
free.

http://home.att.net/~arnold.trembley/cb2align.zip

From the notes:

Tue-16-july-2002

CB2ALIGN can be run as a simple MVS batch job, in a step that would
look somthing like this:

//STEP010 EXEC PGM=CB2ALIGN
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYS001 DD DSN=MY.COBOL.LIB(COBPROG),DISP=SHR
//SYS201 DD DSN=MY.NEW.PROGRAM,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(2,2),RLSE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6800)
//SYSIN DD *
ALIGN,PARA,NOHANDLE
/*

The SYSIN DD can be a member in a Partitioned Dataset, as long
as it has 80-byte records. It does not have to be instream data.

The SYS201 output DD can be a QSAM file or a member in a PDS. It
is a fixed-block file with 80-byte records.

The runtime parameters have the following meaning:

ALIGN/NOALIGN align "TO" objects in procedure division
PARA/NOPARA generate flower-box comments (or not)
NOHANDLE generate "NOHANDLE" on EXEC CICS commands

CB2ALIGN was originally written to convert IBM OS/VS COBOL
programs into VS COBOL II programs. It doesn't handle all
situations correctly. EXAMINE is converted to INSPECT, but
the syntax may not be compatible. It does not even attempt
to convert TRANSFORM. It should handle the NOTE verb
correctly. "NEXT SENTENCE" will always be converted to
CONTINUE.

CB2ALIGN always attempts to clean up the DATA Division, so it
uses consistent PICTURE clauses and and keyword alignment.

--
http://arnold.trembley.home.att.net/



Cheers Arnold

--
Steve

Remove "nospam" from email address to reply to me personally


.