Page 1 of 1

JOINKEYS though SORT FIELDS=COPY

PostPosted: Sat Sep 19, 2009 1:41 am
by ranga_subham
Hi,

The JOINKEYS is causing the output files in the sorted order though SORT FIELDS=COPY is mentioned. I don't want the SORT to happen but copy the records as they are from input to output.

How to achieve it?

TIA.

Re: JOINKEYS

PostPosted: Sat Sep 19, 2009 1:56 am
by dick scherrer
Hello,

Is there some reason you did not post the jcl and sort control statements (use the Code tag)?

I don't want the SORT to happen but copy the recoreds as they are from input to output.
Confusing :?

JOINKEYS implies the data will be insequence. . .

Re: JOINKEYS

PostPosted: Sat Sep 19, 2009 2:11 am
by ranga_subham
Dick, my JCL and SORT card everything is working and am getting output but the only problem is data is appearing in sorted order. I don't want this to happen.

Actually, I am picking unique values from a file and trying to extract those values from some other huge file.

Thx.

Re: JOINKEYS

PostPosted: Sat Sep 19, 2009 2:45 am
by dick scherrer
Hello,

And the jcl/sort control has still not been posted. . . :?

To repeat - JOINKEYS must have data in sorted order. . . It does not provide a random file search.

my JCL and SORT card everything is working and am getting output but the only problem is data is appearing in sorted order
Which means it is not really working. . . ;)

Re: JOINKEYS

PostPosted: Sat Sep 19, 2009 8:21 am
by arcvns
dick scherrer wrote:To repeat - JOINKEYS must have data in sorted order. . . It does not provide a random file search.
Hi Dick,

May be I misunderstood your comment here. But JOINKEYS does n't need the input data to be in sorted order of the key. But the JOIN operation does sort both the input files on the key mentioned in the JOINKEYS statement before doing a file-match.

dick scherrer wrote:Actually, I am picking unique values from a file and trying to extract those values from some other huge file
ranga_subham,

Is your 'huge file' sorted on any field? Please provide the details requested here.

Re: JOINKEYS

PostPosted: Mon Sep 21, 2009 2:29 am
by dick scherrer
Hi Arun,

Thanks for the correction. Dain Brammage. . . :oops:

I have no idea why, but i was thinking of a merge operation :?

Keep me in line :)


Thanks again,
d

Re: JOINKEYS

PostPosted: Tue Sep 22, 2009 7:59 pm
by arcvns
Hi Dick,

You're welcome. :D

Re: JOINKEYS

PostPosted: Thu Oct 15, 2009 8:18 pm
by Alissa Margulies
If the original input files are "random" with no particular sequence, and the requirement is to maintain this random order in the output, you can pre-process the datasets to include a sequence number. Sort on that SEQNUM after JOIN processing, and then use OUTREC to strip off the SEQNUM.