HP RPG/XL Programmer's Guide (30318-90001)

8-: 15
The next three figures illustrate how to use a User-Defined JCW. The
first figure shows a UDC that runs program, SIZER. It then creates a
BATCHOUT file based on the record count of an input BATCHIN file computed
by SIZER. Then the UDC executes the program, UPDATE. UPDATE uses the
maximum record count for BATCHOUT to ensure that it does not write beyond
the file's limits.
Two JCWs are used; JCWEOF and JCWLIM. JCWEOF contains the record count of
the BATCHIN file. JCWLIM contains the maximum number of records that can
be written to the output batch file, BATCHOUT.
Figure 8-11. Setting a User-Defined JCW - UDC
Figure 8-12 lists segments of the program, SIZER. SIZER updates the
User-Defined JCWs, JCWEOF and JCWLIM with the values placed in the LIMITS
file (LIMITS is created by the UDC in Figure 8-11.)