Gilbert Saint-Flour wrote on 11/22/2005 12:28:41 PM:

> I'm trying to figure out what the OUTREC statement below does, in
> particular what the length of the output record will be.
>
> As you can see, the FIELDS consist of five "position,length" pairs which
> add up to 67 bytes (4+1+20+22+20=67), then there's "68", all by itself.
> What does "68" mean?  I looked in half-a-dozen DFSORT, SYNCSORT or
> CA-SORT manuals that I have but find no clue as to how a single
> "position" operand (w/o length) would be interpreted.  Any idea?
> Thanks.
>
>  SORT FIELDS=COPY,STOPAFT=1
>  OUTREC FIELDS=(1,4,67,1,5,20,45,22,25,20,68)
>  RECORD TYPE=V,LENGTH=(4096,,,,205)

For variable-length records, a position without a length can be specified
to indicate "to the end of the record".  For the statement above, the bytes
in the input record from position 68 to the end of the record will be
included in the output record.  So the fixed part of the output record will
be 67 bytes and the variable part will be the number of bytes from 68 to
the end of the record.  Since the variable bytes start at 68, the  output
record will have the same number of bytes as the input record in this case.

p without m is documented in "z/OS DFSORT Application Programming Guide"
under the INREC, OUTREC and OUTFIL statements.  Here's an excerpt:

For variable-length records, the first item in the BUILD or OUTREC
parameter must specify or include the unedited 4-byte record descriptor
word (RDW), that is, you must start with 1,m with m equal to or greater
than 4. If you want to include the bytes from a specific position to the
end of each input record at the end of each reformatted output record, you
can specify that starting position (p) as the last item in the BUILD or
OUTREC parameter. For example:

    OUTFIL OUTREC=(1,4,         unedited RDW
       1,2,BI,TO=ZD,LENGTH=5,   display RDW length in decimal
       C'|',                    | separator
       5)                       display input positions 5 to end

Frank Yaeger - DFSORT Team (IBM)
 Specialties: 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