John McKown wrote on 06/11/2007 01:46:55 PM:
> I think that I know the answer to this, but I'll ask here. Suppose that
> I have an input file with variable length records. I use OPTION VLSHRT.
> I then have a couple of OUTFIL statements, similar to:
>
>  SORT FIELDS=COPY
>  OPTION VLSHRT
>  OUTFIL FNAMES=FILE1,INCLUDE=(27,1,CH,EQ,C'A',OR,50,2,CH,EQ,C'BC')
>  OUTFIL FNAMES=FILE2,INCLUDE=(99,2,CH,EQ,C'ZD')
>
> Suppose that I have a record which is 90 bytes long. It contains an "A"
> in column 27 and a "BC" in column 50 (Yes, I know about the +4 for VB
> records, that's been taken into account).
>
> For some reason, the person thinks that because the second OUTFIL "goes
> beyond" the length of the record, that the first OUTFIL will fail as
> well. So he ran two separate SORT steps which did the equivalent of the
> above.

The statement about "beyond the length of the record" is false.  But, if
you substitute "beyond the length of the LRECL" for "beyond the length of
the record", then that's true.

To explain:

To use 99,2 the LRECL of the input file must be at least 100 bytes.
Otherwise, DFSORT will terminate with:

ICE027A 9 END OF FILE2    FIELD BEYOND MAXIMUM RECORD LENGTH

To use 50,2 the LRECL of the input file must be at least 51 bytes.

So depending on the LRECL of the input file, it may be that the second
OUTFIL statement causes the job to fail because it requires an LRECL of
100 whereas the first OUTFIL statement alone wouldn't because it requires
an LRECL of 51.  But that's a consequence of the input LRECL, not VLSHRT.

If the input LRECL is at least 100 bytes, then the 90 byte record will not
cause the first OUTFIL to fail based on the second OUTFIL.  The OUTFIL
conditions are independent of each other with respect to the record length.

Frank Yaeger - DFSORT Development Team (IBM) - [EMAIL PROTECTED]
Specialties: PARSE, JFY, SQZ, ICETOOL, IFTHEN, OVERLAY, Symbols, Migration

 => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort/

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to