I am using Fujitsu Cobol 3.0. I am having trouble with file access. I think it has everything to do with the FILE-CONTROL section. The error message displayed during execution is as follows:
JMP0311I-U MISSING ALLOCATION. FILE=SYSOUT. PGM=SAMPLE1 ADR=004011D1
As far as I remember, the implementor name (SYSOUT) varies from one flavor of COBOL to another. Can someone please suggest a solution?
The source code:
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE1.
AUTHOR. ADITYA.
*
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT DATAFILE
ASSIGN TO SYSOUT
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD DATAFILE.
01 INPUT-RECORD.
05 PERSON-RECORD.
10 INPUTNAME PIC X(6).
10 PIC X.
10 INPUTAGE PIC 9(2).
10 PIC X.
WORKING-STORAGE SECTION.
01 WORD-INDEX PIC 9(3).
01 INPUT-PERSON.
05 INPUT-NAME PIC X(6).
05 PIC X VALUE SPACES.
05 INPUT-AGE PIC 9(2).
05 PIC X VALUE SPACES.
01 REQUEST-MESSAGE PIC X(42)
VALUE "ENTER YOUR NAME: ".
*
PROCEDURE DIVISION.
DATA-INPUT SECTION.
**(1)DISPLAY THE ABOVE MESSAGE
DISPLAY REQUEST-MESSAGE.
**(2)ACCEPT THE INPUT CHARACTER
ACCEPT INPUT-NAME.
DISPLAY "ENTER YOUR AGE: " WITH NO ADVANCING.
ACCEPT INPUT-AGE.
IF INPUT-AGE < 18 THEN
DISPLAY "UNDER 18".
OPEN OUTPUT DATAFILE.
* MOVE INPUT-PERSON TO INPUT-RECORD.
WRITE INPUT-RECORD.
CLOSE DATAFILE.
*
**(4) THE RESULTING WORD MATCH IS DISPLAYED
* DISPLAY "NAME: " & INPUT-NAME.
* DISPLAY "AGE: " & INPUT-AGE.
*
EXIT PROGRAM.
END PROGRAM SAMPLE1.
JMP0311I-U MISSING ALLOCATION. FILE=SYSOUT. PGM=SAMPLE1 ADR=004011D1
As far as I remember, the implementor name (SYSOUT) varies from one flavor of COBOL to another. Can someone please suggest a solution?
The source code:
IDENTIFICATION DIVISION.
PROGRAM-ID. SAMPLE1.
AUTHOR. ADITYA.
*
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT DATAFILE
ASSIGN TO SYSOUT
ORGANIZATION IS LINE SEQUENTIAL.
DATA DIVISION.
FILE SECTION.
FD DATAFILE.
01 INPUT-RECORD.
05 PERSON-RECORD.
10 INPUTNAME PIC X(6).
10 PIC X.
10 INPUTAGE PIC 9(2).
10 PIC X.
WORKING-STORAGE SECTION.
01 WORD-INDEX PIC 9(3).
01 INPUT-PERSON.
05 INPUT-NAME PIC X(6).
05 PIC X VALUE SPACES.
05 INPUT-AGE PIC 9(2).
05 PIC X VALUE SPACES.
01 REQUEST-MESSAGE PIC X(42)
VALUE "ENTER YOUR NAME: ".
*
PROCEDURE DIVISION.
DATA-INPUT SECTION.
**(1)DISPLAY THE ABOVE MESSAGE
DISPLAY REQUEST-MESSAGE.
**(2)ACCEPT THE INPUT CHARACTER
ACCEPT INPUT-NAME.
DISPLAY "ENTER YOUR AGE: " WITH NO ADVANCING.
ACCEPT INPUT-AGE.
IF INPUT-AGE < 18 THEN
DISPLAY "UNDER 18".
OPEN OUTPUT DATAFILE.
* MOVE INPUT-PERSON TO INPUT-RECORD.
WRITE INPUT-RECORD.
CLOSE DATAFILE.
*
**(4) THE RESULTING WORD MATCH IS DISPLAYED
* DISPLAY "NAME: " & INPUT-NAME.
* DISPLAY "AGE: " & INPUT-AGE.
*
EXIT PROGRAM.
END PROGRAM SAMPLE1.