View previous topic :: View next topic
|
Author |
Message |
sachina2z
New User
Joined: 03 May 2006 Posts: 8 Location: Pune, India
|
|
|
|
Hi,
I have two datasets. First dataset contains many records:-
A102121SACHIN2013-01-12
A103524DEEPAK2013-02-01
A107458NAVEEN2013-05-28
A108965SATISH2013-03-18
...
...
Here, first 7 characters are account number.
I have second dataset containing only Account numbers:-
A102121
A108526
A107584
A108965
Now, I want to use SORT, to extract the records of the first dataset whose account number is found in the second dataset.
Is it possible with sort. Please provide solution.
Thanks,
Sachin |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
And there are many examples here in the forum. |
|
Back to top |
|
|
trushant.w
New User
Joined: 22 Sep 2013 Posts: 81 Location: pune india
|
|
|
|
Try this
//SORTJNF1 DD DSN=File1,DISP=SHR
//SORTJNF2 DD DSN=File2,DISP=SHR
//SORTOUT DD DSN=Ooutputfile,
// DISP=(NEW,CATLG,DELETE),
//*
//SYSIN DD *
SORT FIELDS=COPY
JOINKEYS FILES=F1,FIELDS=(1,7,A)
JOINKEYS FILES=F2,FIELDS=(1,7,A)
REFORMAT FIELDS=(F1:1,080)
Both input files should be sorted |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
trushant.w wrote: |
Both input files should be sorted |
what do you mean both files should be sorted. Joinkeys Automatically SORTS the files based on the fields specified on the Joinkeys statement. A Copy/Merge is ONLY done when you specify SORTED keyword on the joinkeys statement. |
|
Back to top |
|
|
|