IBM OS/390 User Manual

Page of 673
4.3.1.2 Data Driven Segmentation of Output
An artifact of this sequential processing in VSE is that the spooling system
extracts its control statements (JECL) from the input as it is being spooled. When
the input processing crosses the input stream position where the JECL statement
was located, the spooling system will take the action specified by the JECL
statement. The JECL statement can change the output destination of printed or
punched data, or other characteristics, such as special forms requirements.
VSE Example
* $$ JOB JNM=DJANDA,CLASS=A
* $$ LST CLASS=A,DEST=*
// JOB DJANDA
// EXEC MYPROG
INPUT DATA CARD 1
INPUT DATA CARD 2
INPUT DATA CARD 3
INPUT DATA CARD 4
INPUT DATA CARD 5
* $$ LST CLASS=J,DEST=DANJ,DISP=H
INPUT DATA CARD 6
INPUT DATA CARD 7
INPUT DATA CARD 8
INPUT DATA CARD 9
INPUT DATA CARD 10
INPUT DATA CARD 11
/*
/&
* $$ EOJ
The result would be that output printed by this job and program would be sent to
the default system printer, up to the point when the program read INPUT DATA
CARD 6. Output generated from that point forward (including that of cards 6
through 11) would be sent to a specific user ID, DANJ, rather than the default
printer, and it will be in the HOLD disposition state.
A second type of input segmentation appears when a given program will open
an instream data file, read some of its records and close the file. Later, it will
open the same instream data file and read additional records. In VSE, the
records read in the second group will follow the first group in the input stream. A
simple conversion to OS/390 will result in the second file open re-reading the
same records read by the first file!
A method to circumvent this problem is to change the program logic or to write
a subroutine which traps all the reads on the two input streams and which has
one single DCB, so there is only one DDNAME and then the behavior would be
similar to the VSE case.
4.3.1.3 JCL Parameter Handling
Another difference seen because of the philosophy and architecture changes
between VSE and OS/390 is the fact that VSE JCL parameters and JCL handling
can depend on values that are changed at execution time. VSE conditional JCL
can test return codes, as MVS JCL can, but in addition, VSE can test parameter
values as well.
Also, in VSE, procedure expansion and parameter substitution is done at
execution time, so the results of previous job step execution can affect the
Chapter 4. Job Control Language (JCL) Differences and Considerations
75