Peter Hunkeler wrote on 04/28/2006 03:14:45 AM:

It's hard to tell what's going on based on just the information you've
given below, but I'll take some guesses.

> Need some help with ICETOOL. Is it possible to do a 1:1
> copy of a data set and at the same pass through the input
> count the number of record which match a certain criterion?
> RC=12 shall be set if a certain number is exceeded.
>
> Here is what I've tried:
>
> //TOOLIN   DD *
>     COPY FROM(INP01) TO(OUT01)
>     COUNT FROM(INP01) USING(DD01) HIGHER(1000)
> /*
> //DD01CNTL DD *
>   INCLUDE COND=(5,3,CH,EQ,C'@#H')
> /*
>
> ICETOOL calls DFSORT twice, so the input is read twice.

The 9.3 million records will be read for the COPY operator and written to
OUT01.  But the COUNT operator will stop reading records as soon as 1001
records have been included and will not write any records.  So the actual
number of records read twice could be much smaller than 9.3 million
depending on where the included records are.

> Another way I've found is using a intermediate data set
> containing the records to be counted:
>
> //TOOLIN   DD *
>     COPY FROM(INP01) USING(DD01)
>     COUNT FROM(TEMP) HIGHER(1000)
> /*
> //DD01CNTL DD *
>   OUTFIL FNAMES=OUT01,INCLUDE=ALL
>   OUTFIL FNAMES=TEMP,INCLUDE=(5,3,CH,EQ,C'@#H')
> /*
>

In this case COPY reads the 9.3 million records once, writes all of them to
OUT01, and writes all of the included records to TEMP.  COUNT reads a
maximum of 1001 records and doesn't write any output records.

> Q1: Is there a better was to do this?

I can't think of one.  I thought I could do something with a SEQNUM and the
NULLOFL=RC16 option, but it only works for LOWER(1000), not HIGHER(1000)
and it's not clear it would be better than COPY/COUNT anyway.  I would
guess that the COPY/COUNT method is probably the best way.

>
> We get some EXCP count in the JESYSMSG data set. I'm a bit
> astonished to see that it takes some 560+ EXCPs to read the
> INP01 data set in the first case and some 800+ EXCPs in the
> second case. The data set contains some 9.3 million records.
>
> Q2: Why is it that OUTFIL needs so many more EXCPs than the
>     simple COPY?

If the attributes of INP01 and OUT01 are the same, then in the first case
we would probably be using our "fast copy" path.  In the second case,
OUTFIL prevents the use of the "fast copy" path.  The "fast copy" path can
use some special tricks to do the copy more efficiently.  Also, the buffers
needed for the two OUTFIL data sets may leave less storage for the SORTIN
data set which could result in more EXCPs for the SORTIN data set.

>
> Also, filling the output data set requires a much different
> number of EXCPs in the two cases (using the same data set
> instance in both runs): Some 550+ in the first case and
> some 1600+ in the second case.
>
> Q3: Again, how can the big difference be explained?

In the first case, you're writing one output data set.  In the second case,
you're writing two output data sets.  And again, the use of two OUTFIL data
sets could mean less buffer storage for each one.
----------------------------------------------------------------------
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