The NEXTREC keyword prevents any keywords after the NEXTREC command from being executed. Processing continues from the beginning of the command with the next IMS database record (root segment). This keyword is only valid as a subordinate to a conditional keyword.
Syntax:
NEXTREC
Parameters:
None.
Example
This example writes the STUDENT segments to different sequential files, depending on the value of the STUDENT segments' STUDENT-GRADE-LEVEL value. For each valid STUDENT-GRADE-LEVEL, a record is written to the appropriate file. The NEXTREC keywords are used to prevent writing the good STUDENT segments to the error file.
READ,
DBD(DBDIVP),
MOVE(CLEAR),
IF(STUDENT,STUDENT-CURR-GRADE-LEVEL,EQ,C'09'),
MOVE(1,STUDENT,0,1),
WRITE(FRESHDD),
NEXTREC,
IF(STUDENT,STUDENT-CURR-GRADE-LEVEL,EQ,C'10'),
MOVE(1,STUDENT,0,1),
WRITE(SOPHDD),
NEXTREC,
IF(STUDENT,STUDENT-CURR-GRADE-LEVEL,EQ,C'11'),
MOVE(1,STUDENT,0,1),
WRITE(JRDD),
NEXTREC,
IF(STUDENT,STUDENT-CURR-GRADE-LEVEL,EQ,C'12'),
MOVE(1,STUDENT,0,1),
WRITE(SRDD),
NEXTREC,
IF(STUDENT),
MOVE(1,STUDENT,0,1),
WRITE(ERRDD)
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|