Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Formatter/Beautifier for COBOL (reference format)?

Formatter/Beautifier for COBOL (reference format)?

Formatter/Beautifier for COBOL (reference format)?

Hi all,
does anybody know a formatter/beautifier for the IBM Enterprise COBOL?

www.semdesigns.com offers something like this but I would prefer to try it first (it seems to be not possible in case of www.semdesigns.com)
Thank you in advance.

RE: Formatter/Beautifier for COBOL (reference format)?

it would be very interesting to have one!
Perhaps we can make one together? Open software concept?

RE: Formatter/Beautifier for COBOL (reference format)?

Dosn't that version of COBOL have one built in?

RE: Formatter/Beautifier for COBOL (reference format)?

I'm sure I wrote a REXX to do this many years ago. If I can find it anywhere, I'll drag it out and post it.

RE: Formatter/Beautifier for COBOL (reference format)?

Great MarcLodge!

RE: Formatter/Beautifier for COBOL (reference format)?

Sorry Joe, can't find it anywhere

RE: Formatter/Beautifier for COBOL (reference format)?

And what should that formatter/beautifie do?
If only syntax highlithing you can download vim for free. It has syntax highlighting for dozen of languages. I use it for everything: COBOL, RPG, CL, REXX, Perl, Python, Tcl/Tk, HTML, ..., etc,...
In vim you can generate HTML from your COBOL source and post it here, like this example fragment:  


       PROGRAM-ID.                     READBSV.
       AUTHOR.                         ROMANAPS.
       DATE-WRITTEN.                   2008-07-09.

       SOURCE-COMPUTER.                IBM-ISERIES.
       OBJECT-COMPUTER.                IBM-ISERIES.
           CURRENCY SIGN IS '$'

               ASSIGN TO DATABASE-R000094L
                   ORGANIZATION IS INDEXED
                   ACCESS MODE IS DYNAMIC
                   WITH DUPLICATES
                   FILE STATUS IS DB-STAT, DB-OS4-RC.

       01 VERARB-SATZ                                  PIC X(132).
       FD  BSVFILE.
       01 R000094L-REC.
           COPY DDS-ALL-FORMATS OF R000094L.

      * Kopie des Bereiches SQLCA
           EXEC SQL
             INCLUDE SQLCA

      * Satz-Struktur R000090T fuer SQL-FETCH
       01 R000090V-REC.
           COPY DDS-ALL-FORMATS OF R000090V.

      * COBOL-Variablen
       01 WS-FELDER.
           05 WS-KORSPRACHE            PIC X(4).
      *         REPLACING ==R000090T==        BY ==WS-R000090V==
      *                   ==R000090V-RECORD== BY ==WS-R000090V-RECORD==.
      * Vorsicht: Dies funktioniert nicht mit SQL, weil bei
      *    EXEC SQL
      *      FETCH NEXT FROM CLOOP90 INTO :R000090T
      *    END-EXEC
      * der SQL-precompiler immer einen Fehler meldet, dass die Struktur
      * R000090T nicht eindeutig ist obwohl sie von COPY auf WS-R000090V
      * umbenannt wurde
           05 WS-BSSTAMMNR               PIC 9(7).
           05 WS-BSVNR                   PIC 9(2).
           05 WS-KONTOART                PIC 9(2).
           05 WS-TARIF                   PIC X(2).
           05 WS-SATZ-ANZAHL             PIC 9(8).
              88 KEIN-SATZ               VALUE 0.
           05 WS-OV003A-AUFRUF-ANZAHL    PIC 9(8).
           05 WS-R000090V-AUFRUF-ANZAHL  PIC 9(8).

       01 ZW-FELDER.
           05 J                        PIC 9(2).
           05 ZW-NUM08-DSP             PIC ZZZZZZZ9.
           05 ZW-NUM09-DSP             PIC ZZZZZZZZ9.
           05 ZW-STRING-IN             PIC X(80).
           05 ZW-STRING-OUT            PIC X(80).
           05 LEN-OF-STRING            PIC 9(2).
           05 ZW-DATE                  FORMAT DATE IS '@Y%m%d'.
           05 ZW-TIME                  FORMAT TIME IS '%H%M%S@Sh'.
           05 ZW-CURRENT-DATE         PIC X(21).
           05 ZW-DATE-X               PIC X(8).
           05 ZW-TIME-X               PIC X(8).
           05 ZW-TIMESTAMP-X          PIC X(26).
           05 ZW-DURATION             PIC 9(9).

       01 ZW-SQLCODES.
           05 ZW-SQLCODE90             PIC S9(9) BINARY.

       01 VER-ZEILE.
           05 VER-ZEILE-ALLG             PIC X(132).
           05 VER-KOPF-ZEILE             REDEFINES VER-ZEILE-ALLG.
              10 FILLER                 PIC X.
              10 VER-KOPF-TEXT          PIC X(131).
              10 FILLER                  PIC X(5).
              10 VER-STATISTIK-NAME      PIC X(40).
              10 FILLER                  PIC X(1).
              10 VER-STATISTIK-SEPARATOR PIC X(1).
              10 FILLER                  PIC X(1).
              10 VER-STATISTIK-WERT      PIC X(10).

       01 SCHALTER.
           05 FILLER                            PIC X.
           05 CLOOP-OPEN-FLAG         PIC X     VALUE SPACES.
               88 CLOOP-OPENED                  VALUE 'T'.
               88 CLOOP-CLOSED                  VALUE 'F'.
           05 WS-SQLSTATE             PIC X(5)  VALUE ZERO.
               88 SQL-NOT-FOUND                 VALUE '02000'.
               88 SQL-DUPLICATE                 VALUE '23505'.
               88 SQL-ALREADY-OPEN              VALUE '24502'.
               88 SQL-NOT-OPEN                  VALUE '24501'.
               88 SQL-OK                        VALUE ZERO.
           05 BSVFILE-OPEN-FLAG       PIC X     VALUE SPACES.
               88 BSVFILE-OPENED &n

RE: Formatter/Beautifier for COBOL (reference format)?

Personal Editor 32 also does this.

I seem to recall that a beautifier was built into the IBM Mainframe COBOL complie.  Don't remember how to invoke it.

RE: Formatter/Beautifier for COBOL (reference format)?

From the discussions, I think the desire is to have a program that will reformat COBOL to handle indenting, aligning things like the PIC's in record descriptions, etc.

Years ago in my Burroughs/UniSys mainframe days, I used a re-formatter for COBOL that worked well.  I can't remember the name of the software, but will try to do a little digging to see what I can find

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close