GnuCOBOL not handling my legacy COBOL code with the options I pass

93 views Asked by At

I'm trying to feed my legacy IBM mainframe code to GnuCOBOL and it's just giving tons of syntax errors. Any ideas how to fix? I tried using each of -std=cobol85, -std=ibm and -std=mf but none of that changes the errors. Here is part of the code:

00001  IDENTIFICATION DIVISION.                                         08/21/03
00002  PROGRAM-ID. DH06D41J.                                            DH06D41J
00003  AUTHOR. XXXX XXXXX-ORIGINAL,XXXXXX XXXXXX,AND XXXXX XXXX.           LV022
00004 **********************************************************        DH06D41J
00005 *REMARKS. THIS PROCEDURE FORMATS THE NAME FIELD.                  DH06D41J
00006 *         INPUT FIELD LENGTH AND NAME FIELD.                      DH06D41J
00007 ************************************************************      DH06D41J
00008 *                                                          *      DH06D41J
00009 *                                                          *      DH06D41J
00010 *                                                          *      DH06D41J
00011 * -----------+-------------+------------------------------ *      DH06D41J
00012 *            |             |                               *      DH06D41J
00013 * 08/25/2003 | XXXX XXXXXXX| CHANGE BACKSLASH (\) TO SPACE *      DH06D41J
00014 *            |             | IN LN DATA (DE892)            *      DH06D41J
00015 *            |             |                               *      DH06D41J
00016 * 07/31/2003 | XXXX XXXXXXX| ADD 'ZCCL' TO VALID-DATA4     *      DH06D41J
00017 *            |             | (RE: DEFECT DE880)            *      DH06D41J
00018 *            |             |                               *      DH06D41J
00019 * 02/09/2001 | XXXXX XXXXX | RECOMPILE                     *      DH06D41J
00020 *            |             |                               *      DH06D41J
00021 * 05/09/2000 | XXXXX XXXXX | WR E911-00-05 STOP FORMATING  *      DH06D41J
00022 *            |             | THE NAME WHEN '--' IS FOUND.  *      DH06D41J
00023 *            |             |                               *      DH06D41J
00024 *            |             |                               *      DH06D41J
00025 *                                                          *      DH06D41J
00026 ************************************************************      DH06D41J
00027  ENVIRONMENT DIVISION.                                            DH06D41J
00028  DATA DIVISION.                                                   DH06D41J
00029  WORKING-STORAGE SECTION.                                         DH06D41J

Here are the errors:

DH06D41J.cbl:1: warning: PROGRAM-ID header missing - assumed
DH06D41J.cbl:1: warning: PROCEDURE DIVISION header missing - assumed
DH06D41J.cbl:1: error: syntax error, unexpected Literal
DH06D41J.cbl:1: error: unknown statement '08'
DH06D41J.cbl:2: error: syntax error, unexpected Literal
DH06D41J.cbl:2: error: unknown statement 'DH06D41J'
DH06D41J.cbl:3: error: 'AUTHOR' is a reserved word, but isn't supported
DH06D41J.cbl:3: error: unknown statement 'XXXX'
DH06D41J.cbl:3: error: unknown statement 'LV022'
DH06D41J.cbl:5: error: unknown statement 'THIS'
DH06D41J.cbl:5: error: unknown statement 'DH06D41J'
DH06D41J.cbl:6: error: unknown statement 'DH06D41J'
DH06D41J.cbl:12: error: invalid symbol '|' - skipping word
DH06D41J.cbl:12: error: invalid symbol '|' - skipping word
DH06D41J.cbl:13: error: invalid symbol '|' - skipping word
DH06D41J.cbl:13: error: invalid symbol '|' - skipping word
DH06D41J.cbl:13: error: invalid symbol '\' - skipping word
DH06D41J.cbl:14: error: invalid symbol '|' - skipping word
DH06D41J.cbl:14: error: invalid symbol '|' - skipping word
DH06D41J.cbl:15: error: invalid symbol '|' - skipping word
DH06D41J.cbl:15: error: invalid symbol '|' - skipping word
DH06D41J.cbl:16: error: invalid symbol '|' - skipping word
DH06D41J.cbl:16: error: invalid symbol '|' - skipping word
DH06D41J.cbl:16: error: 'VALID-DATA4' is not defined
DH06D41J.cbl:16: error: '"ZCCL"' is not a numeric value
DH06D41J.cbl:16: error: syntax error, unexpected *
1

There are 1 answers

1
snoopyjc On

I figured it out - I was passing the -free option, which can't be used for fixed-formatted input lines!