What can cause a S002 abend in VISION:Results when writing to a DYLIOU variable file?

Document ID : KB000030816
Last Modified Date : 14/02/2018
Show Technical Document Details

The user had no problem logically splitting a dataset into 8 datasets writing to 8 output files which is the normal VISION:Results limit.
But when he tried more than 8 and added DYLIOU he encountered a S002 abend.

The first 8 files used standard processing, then DYLIOU was invoked.
All the files had the same DCB parameter values in the JCL.

Note from page 113 of the Reference Guide regarding Record Size
..... Exception: If exit DYLIOU is used, then the 4 bytes for the RDW 
should be included in the maximum record size.

This differs from a standard output variable file, where you do not include the RDW so the LRECL is 4 bytes shorter than what is specified in the JCL.
With a standard output variable file you can use the entire LENGTH parameter for the move into the record.

With DYLIOU the solution is to modify the FILE statement in the program for the DYLIOU files by matching the LRECL in the JCL. Because it is an output file, the first 4 bytes need to be reserved for the RDW and built, and the data is only written to the data portion of the record using the LENGTH parameter.

So if the JCL has something like this: 

 //DYLIOUF1 DD DSN=DYLIOU.FILE1,DISP=(,CATLG,CATLG),                                       
 //            RECFM=VB,LRECL=4253,                                  
 //   etc         

 The corresponding code for DYLIOU would look similar to this:

  FILE DYLIOUF1 OUTPUT FROM DYLIOUF1 VB 4253 27998  
              EXIT DYLIOU                                               
         DYLRDW       2 1     BI
         DYLDATA 4249 5 

If the input file looks like this 

      FILE TRANSLOG INPUT VB 4249 STATUS TLOG_EOF                            
                        COUNT INCOUNT LENGTH INLEN                            
                                             ===== 

 Use INLEN to build the RDW before the MOVE which only addresses the data portion:

       DYLRDW = INLEN + 4
      MOVE TRANSLOG LENGTH INLEN TO DYLDATA