when i read variable length records QSA file, if i add the line "RECORD CONTAINS 0 CHARACTERS" in the prog, this prog will enter loop status. if i comment it, i get my result.
why?
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. READVQ1.
000300 AUTHOR. HCQ.
000400
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SPECIAL-NAMES.
000800 CONSOLE IS CNSL.
000900 INPUT-OUTPUT SECTION.
001000 FILE-CONTROL.
001100 SELECT VQFILE ASSIGN TO VQF1
001200 FILE STATUS IS F-STA
001300 ORGANIZATION IS SEQUENTIAL
001400 ACCESS MODE IS SEQUENTIAL.
001500
001600 DATA DIVISION.
001700 FILE SECTION.
001800 FD VQFILE
001900 LABEL RECORDS ARE STANDARD
002000* RECORD CONTAINS 0 CHARACTERS
002100 RECORD IS VARYING IN SIZE
002200 FROM 1
002201 DEPENDING ON VQF-LEN
002202 RECORDING MODE IS V.
002203 01 VQF-REC.
002400 05 VQF-DATA PIC X(80).
003400 WORKING-STORAGE SECTION.
003410 77 VQF-LEN PIC 9(8) BINARY.
003500 77 F-STA PIC X(2).
003700 01 E-O-F PIC X.
003800 88 EOF-N VALUE 'N'.
003900 88 EOF-Y VALUE 'Y'.
004000*01 VQF-REC-DISP.
004100* 05 REC-LEN PIC 9(2).
004200* 05 FILLER PIC X.
004300* 05 REC-DATA PIC X(78).
004400* 05 FILLER PIC X VALUE ';'.
004500
006200 PROCEDURE DIVISION.
006300 MAIN-ROUTINE.
006400 PERFORM 1000-OPEN-FILE THRU 1000-EXIT.
006500 PERFORM 2000-PROCESS THRU 2000-EXIT.
006600 PERFORM 3000-CLOSE-FILE THRU 3000-EXIT.
006700 STOP RUN.
006800
006900 1000-OPEN-FILE.
007000 OPEN INPUT VQFILE.
007100 1000-EXIT.
007200 EXIT.
007300
007400 2000-PROCESS.
007500 READ VQFILE AT END SET EOF-Y TO TRUE
007600 DISPLAY 'VQFILE: END OF FILE' UPON CNSL.
007700 PERFORM 2100-READ-FILE THRU 2100-EXIT UNTIL EOF-Y.
007800 2000-EXIT.
007900 EXIT.
008000
008100
008200 2100-READ-FILE.
008400 DISPLAY VQF-LEN ' ' VQF-DATA UPON CNSL.
009800 READ VQFILE AT END SET EOF-Y TO TRUE
009900 DISPLAY 'VQFILE: END OF FILE' UPON CNSL.
010000 2100-EXIT.
010100 EXIT.
010200
010300 3000-CLOSE-FILE.
010400 CLOSE VQFILE.
010500 3000-EXIT.
010600 EXIT.
this is my jcl.
//IGYWCL JOB 123,HCQ,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1)
//COBPROC JCLLIB ORDER=(COBOL.V2R1M0.SIGYPROC)
//STEP1 EXEC IGYWCLG
//COBOL.SYSIN DD DSN=DSZDV2.SAMPLE.SRC(READVQ1),DISP=SHR
//GO.VQF1 DD DSN=DSZDV2.SAMPLE.VFILE,DISP=SHR,
//
why?
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. READVQ1.
000300 AUTHOR. HCQ.
000400
000500 ENVIRONMENT DIVISION.
000600 CONFIGURATION SECTION.
000700 SPECIAL-NAMES.
000800 CONSOLE IS CNSL.
000900 INPUT-OUTPUT SECTION.
001000 FILE-CONTROL.
001100 SELECT VQFILE ASSIGN TO VQF1
001200 FILE STATUS IS F-STA
001300 ORGANIZATION IS SEQUENTIAL
001400 ACCESS MODE IS SEQUENTIAL.
001500
001600 DATA DIVISION.
001700 FILE SECTION.
001800 FD VQFILE
001900 LABEL RECORDS ARE STANDARD
002000* RECORD CONTAINS 0 CHARACTERS
002100 RECORD IS VARYING IN SIZE
002200 FROM 1
002201 DEPENDING ON VQF-LEN
002202 RECORDING MODE IS V.
002203 01 VQF-REC.
002400 05 VQF-DATA PIC X(80).
003400 WORKING-STORAGE SECTION.
003410 77 VQF-LEN PIC 9(8) BINARY.
003500 77 F-STA PIC X(2).
003700 01 E-O-F PIC X.
003800 88 EOF-N VALUE 'N'.
003900 88 EOF-Y VALUE 'Y'.
004000*01 VQF-REC-DISP.
004100* 05 REC-LEN PIC 9(2).
004200* 05 FILLER PIC X.
004300* 05 REC-DATA PIC X(78).
004400* 05 FILLER PIC X VALUE ';'.
004500
006200 PROCEDURE DIVISION.
006300 MAIN-ROUTINE.
006400 PERFORM 1000-OPEN-FILE THRU 1000-EXIT.
006500 PERFORM 2000-PROCESS THRU 2000-EXIT.
006600 PERFORM 3000-CLOSE-FILE THRU 3000-EXIT.
006700 STOP RUN.
006800
006900 1000-OPEN-FILE.
007000 OPEN INPUT VQFILE.
007100 1000-EXIT.
007200 EXIT.
007300
007400 2000-PROCESS.
007500 READ VQFILE AT END SET EOF-Y TO TRUE
007600 DISPLAY 'VQFILE: END OF FILE' UPON CNSL.
007700 PERFORM 2100-READ-FILE THRU 2100-EXIT UNTIL EOF-Y.
007800 2000-EXIT.
007900 EXIT.
008000
008100
008200 2100-READ-FILE.
008400 DISPLAY VQF-LEN ' ' VQF-DATA UPON CNSL.
009800 READ VQFILE AT END SET EOF-Y TO TRUE
009900 DISPLAY 'VQFILE: END OF FILE' UPON CNSL.
010000 2100-EXIT.
010100 EXIT.
010200
010300 3000-CLOSE-FILE.
010400 CLOSE VQFILE.
010500 3000-EXIT.
010600 EXIT.
this is my jcl.
//IGYWCL JOB 123,HCQ,CLASS=A,MSGCLASS=A,MSGLEVEL=(1,1)
//COBPROC JCLLIB ORDER=(COBOL.V2R1M0.SIGYPROC)
//STEP1 EXEC IGYWCLG
//COBOL.SYSIN DD DSN=DSZDV2.SAMPLE.SRC(READVQ1),DISP=SHR
//GO.VQF1 DD DSN=DSZDV2.SAMPLE.VFILE,DISP=SHR,
//