Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatter/Beautifier for COBOL (reference format)?

Status
Not open for further replies.
it would be very interesting to have one!
Perhaps we can make one together? Open software concept?
 
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.
 
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:
Code:
       [COLOR=#804040][b]IDENTIFICATION[/b][/color][COLOR=#804040][b] DIVISION[/b][/color].
       [COLOR=#804040][b]PROGRAM-ID[/b][/color].                     READBSV.
       [COLOR=#804040][b]AUTHOR[/b][/color].                         ROMANAPS.
       [COLOR=#804040][b]DATE-WRITTEN[/b][/color].                   2008-07-09.


       [COLOR=#804040][b]ENVIRONMENT[/b][/color][COLOR=#804040][b] DIVISION[/b][/color].
       [COLOR=#804040][b]CONFIGURATION[/b][/color][COLOR=#804040][b] SECTION[/b][/color].
       [COLOR=#804040][b]SOURCE-COMPUTER[/b][/color].                IBM-ISERIES.
       [COLOR=#804040][b]OBJECT-COMPUTER[/b][/color].                IBM-ISERIES.
       [COLOR=#804040][b]SPECIAL-NAMES[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]CURRENCY[/b][/color] [COLOR=#804040][b]SIGN[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#ff00ff]'$'[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]DECIMAL-POINT[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#804040][b]COMMA[/b][/color]
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]INPUT-OUTPUT[/b][/color][COLOR=#804040][b] SECTION[/b][/color].
       [COLOR=#804040][b]FILE-CONTROL[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]SELECT[/b][/color] VERARB-PROTOKOLL   [COLOR=#804040][b]ASSIGN[/b][/color] [COLOR=#804040][b]TO[/b][/color] PRINTER-READBSVP.
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]SELECT[/b][/color] BSVFILE
      [COLOR=#6a5acd]         [/color][COLOR=#804040][b]ASSIGN[/b][/color] [COLOR=#804040][b]TO[/b][/color] DATABASE-R000094L
      [COLOR=#6a5acd]             [/color][COLOR=#804040][b]ORGANIZATION[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#804040][b]INDEXED[/b][/color]
      [COLOR=#6a5acd]             [/color][COLOR=#804040][b]ACCESS[/b][/color] [COLOR=#804040][b]MODE[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#804040][b]DYNAMIC[/b][/color]
      [COLOR=#6a5acd]             [/color][COLOR=#804040][b]RECORD[/b][/color] [COLOR=#804040][b]KEY[/b][/color] [COLOR=#804040][b]IS[/b][/color] EXTERNALLY-DESCRIBED-KEY
      [COLOR=#6a5acd]             [/color][COLOR=#804040][b]WITH[/b][/color] [COLOR=#804040][b]DUPLICATES[/b][/color]
      [COLOR=#6a5acd]             [/color]FILE [COLOR=#804040][b]STATUS[/b][/color] [COLOR=#804040][b]IS[/b][/color] DB-STAT, DB-OS4-RC.

       [COLOR=#804040][b]DATA[/b][/color][COLOR=#804040][b] DIVISION[/b][/color].
       [COLOR=#804040][b]FILE[/b][/color][COLOR=#804040][b] SECTION[/b][/color].
       [COLOR=#804040][b]FD[/b][/color]  VERARB-PROTOKOLL.
       [COLOR=#2e8b57][b]01 [/b][/color] VERARB-SATZ                                  [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]132[/color]).
       [COLOR=#804040][b]FD[/b][/color]  BSVFILE.
       [COLOR=#2e8b57][b]01 [/b][/color] R000094L-REC.
      [COLOR=#6a5acd]     [/color][COLOR=#a020f0]COPY[/color] DDS-ALL-FORMATS [COLOR=#804040][b]OF[/b][/color] R000094L.

       [COLOR=#804040][b]WORKING-STORAGE[/b][/color][COLOR=#804040][b] SECTION[/b][/color].
      [COLOR=#0000ff]* Kopie des Bereiches SQLCA[/color]
      [COLOR=#6a5acd]     [/color]EXEC SQL
      [COLOR=#6a5acd]       [/color]INCLUDE SQLCA
      [COLOR=#6a5acd]     [/color]END-EXEC.

      [COLOR=#0000ff]* Satz-Struktur R000090T fuer SQL-FETCH[/color]
       [COLOR=#2e8b57][b]01 [/b][/color] R000090V-REC.
      [COLOR=#6a5acd]     [/color][COLOR=#a020f0]COPY[/color] DDS-ALL-FORMATS [COLOR=#804040][b]OF[/b][/color] R000090V.

      [COLOR=#0000ff]* COBOL-Variablen[/color]
       [COLOR=#2e8b57][b]01 [/b][/color] WS-FELDER.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-KORSPRACHE            [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]4[/color]).
      [COLOR=#0000ff]*[/color]
      [COLOR=#0000ff]*    COPY DDS-ALL-FORMATS OF R000090V PREFIX BY 'WS-'[/color]
      [COLOR=#0000ff]*         REPLACING ==R000090T==        BY ==WS-R000090V==[/color]
      [COLOR=#0000ff]*                   ==R000090V-RECORD== BY ==WS-R000090V-RECORD==.[/color]
      [COLOR=#0000ff]*[/color]
      [COLOR=#0000ff]* Vorsicht: Dies funktioniert nicht mit SQL, weil bei[/color]
      [COLOR=#0000ff]*    EXEC SQL[/color]
      [COLOR=#0000ff]*      FETCH NEXT FROM CLOOP90 INTO :R000090T[/color]
      [COLOR=#0000ff]*    END-EXEC[/color]
      [COLOR=#0000ff]* der SQL-precompiler immer einen Fehler meldet, dass die Struktur[/color]
      [COLOR=#0000ff]* R000090T nicht eindeutig ist obwohl sie von COPY auf WS-R000090V[/color]
      [COLOR=#0000ff]* umbenannt wurde[/color]
      [COLOR=#0000ff]*[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-BSSTAMMNR               [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]7[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-BSVNR                   [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]2[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-KONTOART                [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]2[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-TARIF                   [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]2[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-SATZ-ANZAHL             [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]8[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#6a5acd]88 [/color]KEIN-SATZ               [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]0[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-OV003A-AUFRUF-ANZAHL    [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]8[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]WS-R000090V-AUFRUF-ANZAHL  [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]8[/color]).

       [COLOR=#2e8b57][b]01 [/b][/color] ZW-FELDER.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]J                        [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]2[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-NUM08-DSP             [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]ZZZZZZZ9[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-NUM09-DSP             [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]ZZZZZZZZ9[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-STRING-IN             [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]80[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-STRING-OUT            [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]80[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]LEN-OF-STRING            [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]2[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-DATE                  FORMAT [COLOR=#804040][b]DATE[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#ff00ff]'@Y%m%d'[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-TIME                  FORMAT [COLOR=#804040][b]TIME[/b][/color] [COLOR=#804040][b]IS[/b][/color] [COLOR=#ff00ff]'%H%M%S@Sh'[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-CURRENT-DATE         [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]21[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-DATE-X               [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]8[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-TIME-X               [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]8[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-TIMESTAMP-X          [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]26[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-TIMESTAMP-START      FORMAT TIMESTAMP.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-TIMESTAMP-END        FORMAT TIMESTAMP.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] ZW-DURATION             [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]9[/color]).

       [COLOR=#2e8b57][b]01 [/b][/color] ZW-SQLCODES.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]ZW-SQLCODE90             [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]S9[/color]([COLOR=#ff00ff]9[/color]) [COLOR=#6a5acd]BINARY[/color].

       [COLOR=#2e8b57][b]01 [/b][/color] VER-ZEILE.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]VER-ZEILE-ALLG             [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]132[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]VER-KOPF-ZEILE             [COLOR=#6a5acd]REDEFINES[/color] VER-ZEILE-ALLG.
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color] [COLOR=#804040][b]FILLER[/b][/color]                 [COLOR=#804040][b]PIC[/b][/color] X.
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color] VER-KOPF-TEXT          [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]131[/color]).
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color]VER-STATISTIK-ZEILE        [COLOR=#6a5acd]REDEFINES[/color] VER-ZEILE-ALLG.
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color][COLOR=#804040][b]FILLER[/b][/color]                  [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]5[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color]VER-STATISTIK-NAME      [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]40[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color][COLOR=#804040][b]FILLER[/b][/color]                  [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]1[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color]VER-STATISTIK-SEPARATOR [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]1[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color][COLOR=#804040][b]FILLER[/b][/color]                  [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]1[/color]).
      [COLOR=#6a5acd]        [/color][COLOR=#2e8b57][b]10 [/b][/color]VER-STATISTIK-WERT      [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]10[/color]).

       [COLOR=#2e8b57][b]01 [/b][/color] SCHALTER.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] [COLOR=#804040][b]FILLER[/b][/color]                            [COLOR=#804040][b]PIC[/b][/color] X.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] CLOOP-OPEN-FLAG         [COLOR=#804040][b]PIC[/b][/color] X     [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]SPACES[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] CLOOP-OPENED                  [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'T'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] CLOOP-CLOSED                  [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'F'[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] WS-SQLSTATE             [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]5[/color])  [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]ZERO[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] SQL-NOT-FOUND                 [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'02000'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] SQL-DUPLICATE                 [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'23505'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] SQL-ALREADY-OPEN              [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'24502'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] SQL-NOT-OPEN                  [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'24501'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] SQL-OK                        [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]ZERO[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] BSVFILE-OPEN-FLAG       [COLOR=#804040][b]PIC[/b][/color] X     [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]SPACES[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] BSVFILE-OPENED                [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'T'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] BSVFILE-CLOSED                [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'F'[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] END-OF-FILE             [COLOR=#804040][b]PIC[/b][/color] X     [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]SPACES[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color]EOF                            [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'T'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color]NOT-EOF                        [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'F'[/color].


       [COLOR=#2e8b57][b]01 [/b][/color] OS4-WORKING-STORAGE.
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] DB-STAT                    [COLOR=#804040][b]PIC[/b][/color] X([COLOR=#ff00ff]02[/color]) [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]SPACES[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] OK-ON-REC              [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'00'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] DUP-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'02'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] END-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'10'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] INV-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'20'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'21'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'22'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'23'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'24'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] IVD-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'22'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] NTF-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'23'[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] IRQ-ON-REC             [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'  '[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#6a5acd]88 [/color] AB-ON-REC              [COLOR=#804040][b]VALUE[/b][/color] [COLOR=#ff00ff]'30'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'34'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'35'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'37'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'38'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'39'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'41'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'42'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'43'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'44'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'46'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'47'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'48'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'49'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'90'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'91'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'92'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'93'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'94'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'95'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'96'[/color]
      [COLOR=#6a5acd]                                             [/color][COLOR=#ff00ff]'97'[/color].
      [COLOR=#6a5acd]     [/color][COLOR=#2e8b57][b]05 [/b][/color] DB-OS4-RC.
      [COLOR=#6a5acd]         [/color][COLOR=#2e8b57][b]10 [/b][/color] DB-OS4-RETURN-CODE    [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]02[/color]) [COLOR=#6a5acd]COMP[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#2e8b57][b]10 [/b][/color] DB-OS4-FUNCTION-CODE  [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]02[/color]) [COLOR=#6a5acd]COMP[/color].
      [COLOR=#6a5acd]         [/color][COLOR=#2e8b57][b]10 [/b][/color] DB-OS4-FEEDBACK-CODE  [COLOR=#804040][b]PIC[/b][/color] [COLOR=#ff00ff]9[/color]([COLOR=#ff00ff]02[/color]) [COLOR=#6a5acd]COMP[/color].


       [COLOR=#804040][b]PROCEDURE[/b][/color][COLOR=#804040][b] DIVISION[/b][/color].
       [COLOR=#804040][b]STEUER[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] VORLAUF
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] VERARBEITUNG-NATIVE
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] VERARBEITUNG-RMODUL
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] VERARBEITUNG-SQL
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] VERARBEITUNG-OV003A
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] NACHLAUF
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]VORLAUF[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] FELDER-INIT
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] LISTEN-OEFFNEN
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]NACHLAUF[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] LISTEN-SCHLIESSEN
      [COLOR=#0000ff]*    Koniec programu[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]GOBACK[/color]
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]FELDER-INIT[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]INITIALIZE[/b][/color] ZW-FELDER
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]INITIALIZE[/b][/color] WS-FELDER
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]'CS S'[/color]   [COLOR=#804040][b]TO[/b][/color] WS-KORSPRACHE
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]LISTEN-OEFFNEN[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]OPEN[/b][/color] [COLOR=#804040][b]OUTPUT[/b][/color] VERARB-PROTOKOLL
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]LISTEN-SCHLIESSEN[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]CLOSE[/b][/color] VERARB-PROTOKOLL
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]VERARBEITUNG-SQL[/b][/color].
      [COLOR=#0000ff]*    Timestamp am Anfang[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] ERMITTLE-AKT-ZEIT
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] ZW-TIMESTAMP-X [COLOR=#804040][b]TO[/b][/color] ZW-TIMESTAMP-START
      [COLOR=#0000ff]*[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]IF[/b][/color] CLOOP-OPEN-FLAG  = [COLOR=#ff00ff]SPACES[/color]
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]SET[/b][/color] CLOOP-CLOSED [COLOR=#804040][b]TO[/b][/color] [COLOR=#804040][b]TRUE[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] OPEN-CURSOR-R000090V
      [COLOR=#0000ff]*    Verarbeitung in einer SQL-Cursor-FETCH-Schleife[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] SQLCODE [COLOR=#804040][b]TO[/b][/color] ZW-SQLCODE90
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]INITIALIZE[/b][/color] WS-SATZ-ANZAHL
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] [COLOR=#804040][b]UNTIL[/b][/color] ZW-SQLCODE90 [COLOR=#804040][b]NOT[/b][/color] = [COLOR=#ff00ff]ZERO[/color]
      [COLOR=#6a5acd]       [/color][COLOR=#008080]PERFORM[/color] FETCH-NEXT-R000090V
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]MOVE[/b][/color] SQLCODE [COLOR=#804040][b]TO[/b][/color] ZW-SQLCODE90
      [COLOR=#0000ff]*      Wenn es weiteren Satz gibt, d.h. wenn FETCH erfolgreich war[/color]
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]IF[/b][/color] ZW-SQLCODE90 = [COLOR=#ff00ff]ZERO[/color]
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]ADD[/b][/color] [COLOR=#ff00ff]1[/color] [COLOR=#804040][b]TO[/b][/color] WS-SATZ-ANZAHL
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]MOVE[/b][/color] BSSTAMMNR  [COLOR=#804040][b]OF[/b][/color] R000090T [COLOR=#804040][b]TO[/b][/color] WS-BSSTAMMNR
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]MOVE[/b][/color] BSVNR      [COLOR=#804040][b]OF[/b][/color] R000090T [COLOR=#804040][b]TO[/b][/color] WS-BSVNR
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]MOVE[/b][/color] KONTOART   [COLOR=#804040][b]OF[/b][/color] R000090T [COLOR=#804040][b]TO[/b][/color] WS-KONTOART
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]MOVE[/b][/color] TARIF      [COLOR=#804040][b]OF[/b][/color] R000090T [COLOR=#804040][b]TO[/b][/color] WS-TARIF
      [COLOR=#0000ff]*         *[/color]
      [COLOR=#6a5acd]          [/color][COLOR=#008080]PERFORM[/color] VERARBEITE-SATZ-R000090V
      [COLOR=#6a5acd]             [/color][COLOR=#804040][b]THRU[/b][/color] VERARBEITE-SATZ-R000090V-EXIT
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]END-PERFORM[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] CLOSE-CURSOR-R000090V
      [COLOR=#0000ff]*    Timestamp am Ende[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] ERMITTLE-AKT-ZEIT
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] ZW-TIMESTAMP-X [COLOR=#804040][b]TO[/b][/color] ZW-TIMESTAMP-END
      [COLOR=#0000ff]*    Dauer berechnen[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] COMPUTE-DURATION
      [COLOR=#0000ff]*    Statistik drucken[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] STATISTIK-SQL
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]OPEN-CURSOR-R000090V[/b][/color].
      [COLOR=#0000ff]*    Einen Cursor fuer geg. SELECT deklarieren[/color]
      [COLOR=#6a5acd]     [/color]EXEC SQL
      [COLOR=#6a5acd]       [/color]DECLARE CLOOP90 CURSOR [COLOR=#804040][b]FOR[/b][/color]
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]SELECT[/b][/color] *
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]FROM[/b][/color] R000090V
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]ORDER[/b][/color] [COLOR=#804040][b]BY[/b][/color] BSSTAMMNR, BSVNR
      [COLOR=#6a5acd]     [/color]END-EXEC

      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]IF[/b][/color] CLOOP-CLOSED
      [COLOR=#0000ff]*       Cursor oeffnen[/color]
      [COLOR=#6a5acd]        [/color]EXEC SQL
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]OPEN[/b][/color] CLOOP90
      [COLOR=#6a5acd]        [/color]END-EXEC
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]MOVE[/b][/color] SQLSTATE [COLOR=#804040][b]TO[/b][/color] WS-SQLSTATE
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]IF[/b][/color] SQL-OK
      [COLOR=#6a5acd]           [/color][COLOR=#804040][b]SET[/b][/color] CLOOP-OPENED [COLOR=#804040][b]TO[/b][/color] [COLOR=#804040][b]TRUE[/b][/color]
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]FETCH-NEXT-R000090V[/b][/color].
      [COLOR=#6a5acd]     [/color]EXEC SQL
      [COLOR=#6a5acd]       [/color]FETCH [COLOR=#804040][b]NEXT[/b][/color] [COLOR=#804040][b]FROM[/b][/color] CLOOP90 [COLOR=#804040][b]INTO[/b][/color] :R000090T
      [COLOR=#6a5acd]     [/color]END-EXEC
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]CLOSE-CURSOR-R000090V[/b][/color].
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]IF[/b][/color] CLOOP-OPENED
      [COLOR=#0000ff]*       Cursor schliessen[/color]
      [COLOR=#6a5acd]        [/color]EXEC SQL
      [COLOR=#6a5acd]          [/color][COLOR=#804040][b]CLOSE[/b][/color] CLOOP90
      [COLOR=#6a5acd]        [/color]END-EXEC
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]MOVE[/b][/color] SQLSTATE [COLOR=#804040][b]TO[/b][/color] WS-SQLSTATE
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]IF[/b][/color] SQL-OK [COLOR=#804040][b]OR[/b][/color] SQL-NOT-OPEN
      [COLOR=#6a5acd]           [/color][COLOR=#804040][b]SET[/b][/color] CLOOP-CLOSED [COLOR=#804040][b]TO[/b][/color] [COLOR=#804040][b]TRUE[/b][/color]
      [COLOR=#6a5acd]        [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color].

       [COLOR=#804040][b]VERARBEITUNG-OV003A[/b][/color].
      [COLOR=#0000ff]*    Timestamp am Anfang[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] ERMITTLE-AKT-ZEIT
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] ZW-TIMESTAMP-X [COLOR=#804040][b]TO[/b][/color] ZW-TIMESTAMP-START
      [COLOR=#0000ff]*[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]'A'[/color] [COLOR=#804040][b]TO[/b][/color] BB-JAHR
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]'V'[/color] [COLOR=#804040][b]TO[/b][/color] BB-RICHTUNG
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]15[/color]  [COLOR=#804040][b]TO[/b][/color] BB-LIMIT
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]'N'[/color] [COLOR=#804040][b]TO[/b][/color] BB-BSSTAMMNRPRUEF
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] [COLOR=#ff00ff]'N'[/color] [COLOR=#804040][b]TO[/b][/color] BB-BSVNRPRUEF
      [COLOR=#0000ff]*[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]INITIALIZE[/b][/color] OV003A-BB-E-REFERENZ
      [COLOR=#0000ff]*[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]INITIALIZE[/b][/color] WS-SATZ-ANZAHL
      [COLOR=#0000ff]*    OV003A wiederholend aufrufen[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] [COLOR=#804040][b]WITH[/b][/color] [COLOR=#804040][b]TEST[/b][/color] [COLOR=#804040][b]AFTER[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]UNTIL[/b][/color] OV003A-BB-E-WEITERE [COLOR=#804040][b]NOT[/b][/color] = [COLOR=#ff00ff]'Y'[/color] [COLOR=#804040][b]OR[/b][/color] OV003A-NOT-SUCCESSFULL
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]ADD[/b][/color] [COLOR=#ff00ff]1[/color] [COLOR=#804040][b]TO[/b][/color] WS-OV003A-AUFRUF-ANZAHL
      [COLOR=#6a5acd]       [/color][COLOR=#008080]PERFORM[/color] OV003A-HOLE-BSV-BESTAND
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]IF[/b][/color] OV003A-SUCCESSFULL
      [COLOR=#0000ff]*         Alle Saetze verarbeiten[/color]
      [COLOR=#6a5acd]          [/color][COLOR=#008080]PERFORM[/color]
      [COLOR=#6a5acd]          [/color][COLOR=#6a5acd]VARYING[/color] J [COLOR=#804040][b]FROM[/b][/color] [COLOR=#ff00ff]1[/color] [COLOR=#804040][b]BY[/b][/color] [COLOR=#ff00ff]1[/color] [COLOR=#804040][b]UNTIL[/b][/color] J > OV003A-BB-E-MAXANZAHL
      [COLOR=#6a5acd]            [/color][COLOR=#804040][b]ADD[/b][/color] [COLOR=#ff00ff]1[/color] [COLOR=#804040][b]TO[/b][/color] WS-SATZ-ANZAHL
      [COLOR=#6a5acd]            [/color][COLOR=#804040][b]MOVE[/b][/color] OV003A-BB-A-BSSTAMMNR  (J) [COLOR=#804040][b]TO[/b][/color] WS-BSSTAMMNR
      [COLOR=#6a5acd]            [/color][COLOR=#804040][b]MOVE[/b][/color] OV003A-BB-A-BSVNR      (J) [COLOR=#804040][b]TO[/b][/color] WS-BSVNR
      [COLOR=#6a5acd]            [/color][COLOR=#804040][b]MOVE[/b][/color] OV003A-BB-A-KONTOART   (J) [COLOR=#804040][b]TO[/b][/color] WS-KONTOART
      [COLOR=#6a5acd]            [/color][COLOR=#804040][b]MOVE[/b][/color] OV003A-BB-A-TARIF      (J) [COLOR=#804040][b]TO[/b][/color] WS-TARIF
      [COLOR=#0000ff]*           *[/color]
      [COLOR=#6a5acd]            [/color][COLOR=#008080]PERFORM[/color] VERARBEITE-SATZ-R000090V
      [COLOR=#6a5acd]               [/color][COLOR=#804040][b]THRU[/b][/color] VERARBEITE-SATZ-R000090V-EXIT
      [COLOR=#6a5acd]          [/color][COLOR=#008080]END-PERFORM[/color]
      [COLOR=#6a5acd]       [/color][COLOR=#804040][b]END-IF[/b][/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]END-PERFORM[/color]
      [COLOR=#0000ff]*    Timestamp am Ende[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] ERMITTLE-AKT-ZEIT
      [COLOR=#6a5acd]     [/color][COLOR=#804040][b]MOVE[/b][/color] ZW-TIMESTAMP-X [COLOR=#804040][b]TO[/b][/color] ZW-TIMESTAMP-END
      [COLOR=#0000ff]*    Dauer berechnen[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] COMPUTE-DURATION
      [COLOR=#0000ff]*    Statistik drucken[/color]
      [COLOR=#6a5acd]     [/color][COLOR=#008080]PERFORM[/color] STATISTIK-OV003A
      [COLOR=#6a5acd]     [/color].

       ... continues ....
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top