Home > Archive > Cobol > May 2006 > Beautify code
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Steve Rainbird 2006-04-27, 7:55 am |
| 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?
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| void * clvrmnky() 2006-04-27, 6:55 pm |
| 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?
>
Google came back with some interesting hits for the terms "COBOL
beautifier".
| |
| hcmason@sbcglobal.net 2006-04-27, 6:55 pm |
| Years ago we tried to use a mainframe utility called recoder to replace
go to loops with perform untils...unfortunately the resulting source
code was also hard to understand, and some of our really bad sphagetthi
code made the poor thing do a core dump...
Chris
| |
| Steve Rainbird 2006-04-27, 6:55 pm |
| "void * clvrmnky()" <clvrmnky.invalid@hotmail.com.invalid> wrote in message
news:DM64g.19706$43.12859@nnrp.ca.mci.com!nnrp1.uunet.ca...
> Steve Rainbird wrote:
> Google came back with some interesting hits for the terms "COBOL
> beautifier".
Not really. The only one it came up with was something called cblbeau which
costs $495 for the non-trial version. I only want to do one program!
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| void * clvrmnky() 2006-04-27, 6:55 pm |
| Steve Rainbird wrote:
> "void * clvrmnky()" <clvrmnky.invalid@hotmail.com.invalid> wrote in message
> news:DM64g.19706$43.12859@nnrp.ca.mci.com!nnrp1.uunet.ca...
>
> Not really. The only one it came up with was something called cblbeau which
> costs $495 for the non-trial version. I only want to do one program!
>
Really? I found <http://www.siber.com/sct/tools/cbl-beau.html> as the
first hit, which is advertised as shareware you can try with no line
count restrictions.
I'm not sure how you feel about shareware for what is probably a
commercial use, but I suppose a single use is not really a lost sale.
There is payware at <http://www.semdesigns.com/Purchase/#Formatters> for
US$250.
And it looks like SlickEdit can beautify COBOL, as well. Might be hard
to get a copy, but you could check eBay. Perhaps other editors also do
this (i.e., that Swiss-army knife known as Emacs might be a start).
If you already have a compiler license, see if your vendor has a
beautifier. For example, I think COBOL85 from Fujitsu has a bundles
"structurizer".
Finally, some products like JIndent might be able to do COBOL, or they
are considering it.
| |
| Colin Campbell 2006-04-27, 9:55 pm |
| 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?
>
>
Are you working on an IBM z/OS mainframe? If so, is the program being
compiled with a currently supported IBM COBOL compiler? And, if so,
does your shop have the IBM Debug Tool, including the Debug Tool
Utilities and Advanced Functions? (This module of the Debug Tool
includes IBM CCCA - see below.)
Or, do you have the IBM COBOL Structuring Facility? (This is a
reformatting tool.)
Or, do you have IBM VisualAge COBOL? (The Enterprise Edition included
ports of CCCA and CSF; the last version I had, though, these tools were
only available in the OS/2 version. Later versions, I believe, had them
for the Windoze version - OS/2 support got dropped. This tool may have
been rolled into WebSphere; I haven't been keeping up.)
Or, do you have IBM CCCA (COBOL & CICS Conversion Aid)? (As the name
implies, this tool converts OldBOL to NewBOL, to borrow Bill Klein's
terminology.)
The above are tools for the mainframe that would assist you in
reformatting your code.
=====
There is a non-IBM tool, named MHtran-2, from Prince Software.
This is also a conversion aid, and may be able to do reformatting.
You'll have to Google to find out.
| |
| Steve Rainbird 2006-04-28, 3:55 am |
| "void * clvrmnky()" <clvrmnky.invalid@hotmail.com.invalid> wrote in message
news:B6c4g.19741$43.5356@nnrp.ca.mci.com!nnrp1.uunet.ca...
> Steve Rainbird wrote:
> Really? I found <http://www.siber.com/sct/tools/cbl-beau.html> as the
> first hit, which is advertised as shareware you can try with no line count
> restrictions.
>
That is cblbeau. I tried it and it comes up with an error which says
"too many arguments: 512. This is likely to be a trial version limitation."
> I'm not sure how you feel about shareware for what is probably a
> commercial use, but I suppose a single use is not really a lost sale.
>
> There is payware at <http://www.semdesigns.com/Purchase/#Formatters> for
> US$250.
>
> And it looks like SlickEdit can beautify COBOL, as well. Might be hard to
> get a copy, but you could check eBay. Perhaps other editors also do this
> (i.e., that Swiss-army knife known as Emacs might be a start).
>
> If you already have a compiler license, see if your vendor has a
> beautifier. For example, I think COBOL85 from Fujitsu has a bundles
> "structurizer".
>
> Finally, some products like JIndent might be able to do COBOL, or they are
> considering it.
We use MicroFocus which I don't believe has a supplied beautifier unless
anybody knows otherwise.
Thanks for your other suggestions I think we may already have SlickEdit I
will have a dig.
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| Steve Rainbird 2006-04-28, 3:55 am |
| "Colin Campbell" <cmcampb@adelphia.net> wrote in message
news:mOedneHXyrOWE8zZnZ2dnUVZ_sydnZ2d@ad
elphia.com...
> Steve Rainbird wrote:
> Are you working on an IBM z/OS mainframe?
<snip>
No Microfocus on Linux.
Thanks for the suggestions anyway.
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| Steve Rainbird 2006-04-28, 3:55 am |
| "Steve Rainbird" <news.nospam@rainbird.me.nospam.uk> wrote in message
news:4bdvalF10q3faU1@individual.net...
> "void * clvrmnky()" <clvrmnky.invalid@hotmail.com.invalid> wrote in
> message news:B6c4g.19741$43.5356@nnrp.ca.mci.com!nnrp1.uunet.ca...
<snip>[color=darkred]
> We use MicroFocus which I don't believe has a supplied beautifier unless
> anybody knows otherwise.
>
Should have added that is MF Server Express.
<snip>
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| Steve Rainbird 2006-04-28, 7:55 am |
| > And it looks like SlickEdit can beautify COBOL, as well. Might be hard to
> get a copy, but you could check eBay. Perhaps other editors also do this
> (i.e., that Swiss-army knife known as Emacs might be a start).
As far as I can see SlickEdit can only beautify
Ada
.. C#
.. C/C++
.. CFML
.. HTML
.. Java
.. JavaScript
.. Slick-C
.. XML and XSD
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| void * clvrmnky() 2006-04-28, 6:55 pm |
| Steve Rainbird wrote:
>
>
> As far as I can see SlickEdit can only beautify
>
> Ada
> . C#
> . C/C++
> . CFML
> . HTML
> . Java
> . JavaScript
> . Slick-C
> . XML and XSD
>
Ah. Well someone on the internets claimed that COBOL was a supported
language. Not the first time I've been mislead by the web.
As an aside, when I have to work with COBOL I use the Win32 editor that
comes with IBM VisualAge COBOL. I don't recall if it does
beautification out of the box, but it has a rudimentary extensions "API".
| |
| Michael Wojcik 2006-04-28, 6:55 pm |
|
In article <4bdvalF10q3faU1@individual.net>, "Steve Rainbird" <news.nospam@rainbird.me.nospam.uk> writes:
>
> We use MicroFocus which I don't believe has a supplied beautifier unless
> anybody knows otherwise.
I'm not an expert on our COBOL tools, but have you looked at the
COBOL Source Information (CSI) utility? It's not a beautifier,
but it can be helpful in analyzing source, since it will help you
locate where particular data-items or procedures are performed and
so forth.
A compiler listing might also be helpful; there are options to
produce a cross-reference, etc.
--
Michael Wojcik michael.wojcik@microfocus.com
Thus, the black lie, issuing from his base throat, becomes a boomerang to
his hand, and he is hoist by his own petard, and finds himself a marked man.
-- attributed to a "small-town newspaper editor in Wisconsin"
| |
| Steve Rainbird 2006-04-28, 6:55 pm |
| "Michael Wojcik" <mwojcik@newsguy.com> wrote in message
news:e2tgq602rmo@news3.newsguy.com...
>
> In article <4bdvalF10q3faU1@individual.net>, "Steve Rainbird"
> <news.nospam@rainbird.me.nospam.uk> writes:
>
> I'm not an expert on our COBOL tools, but have you looked at the
> COBOL Source Information (CSI) utility? It's not a beautifier,
> but it can be helpful in analyzing source, since it will help you
> locate where particular data-items or procedures are performed and
> so forth.
>
> A compiler listing might also be helpful; there are options to
> produce a cross-reference, etc.
>
> --
> Michael Wojcik michael.wojcik@microfocus.com
>
> Thus, the black lie, issuing from his base throat, becomes a boomerang to
> his hand, and he is hoist by his own petard, and finds himself a marked
> man.
> -- attributed to a "small-town newspaper editor in Wisconsin"
Thanks Michael I haven't but I will.
--
Steve
Remove "nospam" from email address to reply to me personally
| |
| Arnold Trembley 2006-05-07, 6:55 pm |
| 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/
| |
| Steve Rainbird 2006-05-07, 6:55 pm |
| "Arnold Trembley" <arnold.trembley@worldnet.att.net> wrote in message
news:445AC1AA.5080804@worldnet.att.net...
> Posted and emailed
>
> Steve Rainbird wrote:
>
>
> 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
|
|
|
|
|