Just a question.
Once the records are sorted on the Value, would the REXX be more efficient
doing the following:
Rather than loop and create the file each time, why not queue the same
records, then allocate an execio Queue records and end. There appears the
input file could have 1 or more than 1 of the same VALUE1 record.
Would that be faster, better, more efficient? If the records are sorted
going into the rexx, then I would think one allocate and EXECIO to it would
be better.
Or am I missing something in the sample Rexx?
So, my thought:
Get records
Queue the input record
If VALUE1 is different then
Do
Allocate file
EXECIO QUEUE
Free file
End
Get next record.
Or am I way off base.
Lizette
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of TonyIcloud-OPERA
> Sent: Wednesday, August 20, 2014 8:21 AM
> To: [email protected]
> Subject: Re: DF/SORT question (challenge?)
>
> Looks good, I'll try it out. Thanks. I'd be curious about a UNIX (aka
"the dark side")
> solution. I need the practice.
>
> P.S. Sam, thanks for the response but we need to keep this out of the
development
> area due to change control constraints. REXX is viable because we can tap
dance
> around our bureaucracy.
>
>
>
>
>
> On Wed, 20 Aug 2014 09:58:13 -0500, John McKown
> <[email protected]> wrote:
>
> > On Wed, Aug 20, 2014 at 9:34 AM, TonyIcloud-OPERA
> > <[email protected]>
> > wrote:
> >
> >> I have a dataset that contains records with a field, by which I need
> >> to create a separate dataset that would contain all occurrences of
> >> that field.
> >> For example the file, FB100, looks like
> >>
> >> value1 other data.....
> >> value1 other data.....
> >> value1 other data.....
> >> value2 other data.....
> >> value2 other data.....
> >> value2 other data.....
> >> value3 other data.....
> >> value3 other data.....
> >> value3 other data.....
> >> value4 other data.....
> >> value4 other data.....
> >> value4 other data.....
> >>
> >> My final product must be a series of datasets:
> >>
> >> hlq.value1.records
> >> hlq.value2.records
> >> hlq.value3.records
> >> hlq.value4.records
> >>
> >> There may be hundreds/thousands of possible values, hence
> >> hundreds/thousands of datasets. I have accomplished this in 3
> >> phases, first pass reads the data, uses ICETOOL OCCUR to list the
> >> values, second phase reads the OUTPUT and formats DD statements and
> >> OUTFIL OUTREC statements, the third phase reads the original data to
> >> create the numerous output files. I used a newly created PDSE as the
> >> output file whereupon the third phase created several thousand
> >> members.
> >>
> >> It works, after a fashion, but I'd like a more simple solution.
> >>
> >>
> > Well, assuming that performance is not an overriding concern, I would
> > have two steps. The first would be a DFSORT which sorts the records in
> > order by the field in question. The second step would be a REXX
> > program which would look something like:
> >
> > /* REXX */
> > VALUE='';
> > DO FOREVER
> > "EXECIO DISKR 1 INPUT"
> > IF RC <> 0 THEN LEAVE /* LEAVE IF EOF */
> > PARSE PULL RECORD
> > NVALUE=WORD(RECORD,1) /* EXTRACT VALUE */
> > IF VALUE <> NVALUE THEN DO
> > "EXECIO 0 DISKW OUTPUT (FINIS"
> > ADDRESS TSO "FREE DDN(OUTPUT)"
> > ADDRESS TSO "ALLOC DDN(OUTPUT) DSN(hlq."VALUE".records) ",
> > "NEW CATALOG SPACE(a b) CYL RECFM(f) LRECL(lrecl)
> BLKSIZE(0)"
> > END
> > PUSH RECORD
> > "EXECIO DISKW 1 OUTPUT"
> > END
> >
> > Of course, you need to customize the ALLOC command. And in my JCL, I
> > would have a //OUTPUT DD DUMMY
> >
> > If you're really adventurous, I'll give you a UNIX solution. But most
> > people don't really want that.
>
>
> --
> Using Opera's mail client: http://www.opera.com/mail/
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions, send email
to
> [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN