i try to use cobol read a ps file and write all the records to a VSAM indexed file. the cobol code compile is ok ,but when i use jcl to run it ,it cause abendu4038,as follow:
"IGZ0020S A logic error occurred. Neither FILE STATUS nor a declarative was spe FILE STATUS nor a declarative was specified for file OUTFILE in program
TEST012 at relative location X'05BE'. The status code was 48."
and my jcl is : (2 files already exits)
STER1 EXEC PGM=TEST012
STEPLIB DD DSN=userid.LIB.LOAD,DISP=SHR
OUTFILE DD DSN=userid.NEWFILE.KSDS,DISP=SHR
INFILE DD DSN=userid.NEWFILE,DISP=SHR
FILE-CONTROL.
SELECT INFILE ASSIGN TO INFILE.
SELECT OUTFILE ASSIGN TO OUTFILE
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS ID-NUM.
*
DATA DIVISION.
FILE SECTION.
*
FD INFILE.
01 IN-FILE PIC X(80).
*
FD OUTFILE.
01 OUT-FILE.
05 ID-NUM PIC X(3).
05 FILLER PIC X(77).
*
WORKING-STORAGE SECTION.
01 FILE-EOF-SWITCH PIC X VALUE "N".
88 FILE-EOF VALUE "Y".
01 FILE-RECORDS PIC X(80).
*
PROCEDURE DIVISION.
*
000-CREATE-KSDS.
OPEN INPUT INFILE
OUTPUT OUTFILE.
PERFORM 100-READ-RECORDS
UNTIL FILE-EOF.
CLOSE INFILE
OUTFILE.
STOP RUN.
100-READ-RECORDS.
READ INFILE INTO FILE-RECORDS
AT END
SET FILE-EOF TO TRUE.
IF NOT FILE-EOF
WRITE OUT-FILE FROM FILE-RECORDS.
SELECT INFILE ASSIGN TO INFILE.
SELECT OUTFILE ASSIGN TO OUTFILE
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY IS ID-NUM.
*
DATA DIVISION.
FILE SECTION.
*
FD INFILE.
01 IN-FILE PIC X(80).
*
FD OUTFILE.
01 OUT-FILE.
05 ID-NUM PIC X(3).
05 FILLER PIC X(77).
*
WORKING-STORAGE SECTION.
01 FILE-EOF-SWITCH PIC X VALUE "N".
88 FILE-EOF VALUE "Y".
01 FILE-RECORDS PIC X(80).
*
PROCEDURE DIVISION.
*
000-CREATE-KSDS.
OPEN INPUT INFILE
OUTPUT OUTFILE.
PERFORM 100-READ-RECORDS
UNTIL FILE-EOF.
CLOSE INFILE
OUTFILE.
STOP RUN.
100-READ-RECORDS.
READ INFILE INTO FILE-RECORDS
AT END
SET FILE-EOF TO TRUE.
IF NOT FILE-EOF
WRITE OUT-FILE FROM FILE-RECORDS.