tags:

views:

420

answers:

3

I'm new to Fujitsu COBOL 3.0 software. I tried executing a simple program. The code and errors are as follows. Everything in program appears to be correct. Can anyone help me out? Any prestandards are to be followed in this software?

The sample cobol program is:

IDENTIFICATION DIVISION.
PROGRAM-ID.  ShortestProgram.

PROCEDURE DIVISION.
DisplayPrompt.
    DISPLAY "I did it".
   STOP RUN. 
--------------------------------------------------------------------------------------
** DIAGNOSTIC MESSAGE ** (NOPRGMID)
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 0: JMN1102I-S  IDENTIFICATION DIVISION HEADER IS MISSING. HEADER ASSUMED TO BE CODED.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 1: JMN1019I-W  INDICATOR AREA MUST CONTAIN '-','*','/','D',OR BLANK. A BLANK IS ASSUMED TO BE SPECIFIED.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 1: JMN1005I-W  CHARACTER STRING 'DENTIFICATION' MUST START IN AREA B. ASSUMED TO START IN AREA B.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 1: JMN1356I-W  INVALID WORD 'DENTIFICATION' IS SPECIFIED IN IDENTIFICATION DIVISION. IGNORED UNTIL NEXT PARAGRAPH OR DIVISION.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 2: JMN1019I-W  INDICATOR AREA MUST CONTAIN '-','*','/','D',OR BLANK. A BLANK IS ASSUMED TO BE SPECIFIED.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 2: JMN1005I-W  CHARACTER STRING 'ROGRAM-ID' MUST START IN AREA B. ASSUMED TO START IN AREA B.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 4: JMN1019I-W  INDICATOR AREA MUST CONTAIN '-','*','/','D',OR BLANK. A BLANK IS ASSUMED TO BE SPECIFIED.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 4: JMN1005I-W  CHARACTER STRING 'ROCEDURE' MUST START IN AREA B. ASSUMED TO START IN AREA B.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 6: JMN1004I-W  RESERVED WORD 'DISPLAY' MUST START IN AREA B. ASSUMED TO START IN AREA B.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 7: JMN1104I-S  PROGRAM-ID PARAGRAPH IS MISSING. PROGRAM-NAME GENERATED BY SYSTEM.
C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 7: JMN1004I-W  RESERVED WORD 'STOP' MUST START IN AREA B. ASSUMED TO START IN AREA B.
STATISTICS: HIGHEST SEVERITY CODE=S, PROGRAM UNIT=1
A: 

Taking a WAG (wild-ass guess) here. Haven't cobol'd since my last year of college.

Your error message says, at the bottom,

STATISTICS: HIGHEST SEVERITY CODE=S, PROGRAM UNIT=1

Okay, so I figure you have some warnings (possibly CODE=W), and one or more errors that are actually causing your program to fail.

So, scanning the error message, I see lots of W-s, and one line with an S:

C:\FSC\PCOBOL32\samples\SAMPLE6\SAMPLE7.COB 7: JMN1104I-S PROGRAM-ID PARAGRAPH IS MISSING. PROGRAM-NAME GENERATED BY SYSTEM.

So it seems you're missing your Program-ID paragraph. Looking at your program, I do see a n identification division, which has a program-id.

I can conclude four things from this:
1) Your identification division paragraph is malformed
2) As Neil said, you aren't running your snippet, but a sample that does not have an ID paragraph. Open sample7.cob and see
3) Some other issue is causing the error, but it is being hidden or misinterpreted as an ID paragraph error

Will
+2  A: 

The warnings (referring to area B) seem to suggest your code should by starting in the second column of each line. Which is why it's finding e.g. "DENTIFICATION" instead of "IDENTIFICATION".

I've never developed in COBOL but I vaguely remember that the first column has to be blank, or * for a comment: the warning messages seem to indicate that / - and D are valid values too.

UPDATE: Google suggests that COBOL compiler ignores the first 6 columns and that column 7 has a special significance (D for debugging, * for comment, ...). Though maybe the behaviour is compiler-specific. So I suspect your problem is that your code is starting in col 7 where it should be col 8.

Joe
+1  A: 

Shift everything over 7 columns so that IDENTIFICATION DIVISION starts in column 8 and all subsequent lines began in column 8 or greater.

There's also a compiler switch (can't remember off the top of my head) that allows you to start in col 1

kloucks