Tim Hare wrote on 06/04/2008 10:59:55 AM:
> Really two questions I guess.
>
> 1. We have variable length records with the data similar to COBOL 'OCCURS

> DEPENDING ON' clauses - a count of the number of segments to follow,
> followed by those segments.  Is there a way to handle these in
> INREC/OUTREC/OUTFILE ?  I already thought of using IFTHEN  - if the count
is
> at least 1, output data from 1st segment, if at least 2, output from
first 2
> segments, etc. but I don't see how to do that based on the count that's
in
> the record....

I don't know what you mean by "I don't see how to do that based on the
count
that's in the record".  The IFTHEN's WHEN=(logexp) can test the count vs a
constant.  For example, if the count is a 2-byte BI value in positions
21-22,
you could use:


  INREC IFTHEN=(WHEN=(21,2,BI,EQ,1),...)),
    IFTHEN=(WHEN=(21,2,BI,EQ,2),...)),
    ...

All you need to know is the starting position, length and format of the
count.
Maybe if you showed an example of the input records and what you're trying
get
for output, it would clarify things.

> 2.  Is there a way to describe such segments in DFSORT Symbols?
>
> I've been RTFM and PDFs but without enlightenment.  It seems to me that
it
> requires being able to specify the position field as a calculation
> rather than a
> constant (i.e. 'p' = base+
> (seg_number_starting_from_0*seg_length+offset_to_field_in_segment)?
>
> This would also be of use for some SMF records I'd imagine.

You would need to describe the segments in a linear fashion.  You could
use a different (but similar) name for the symbols for each subsequent
segment,  e.g. S01_name1, S01_name2, .... , S02_name1, S02_name2, ...

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