View previous topic :: View next topic
|
Author |
Message |
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Hi,
I have 2flat files
File One contains some ids(1-7)
File Two contains some records in which char 15-21 are the Ids,
I need to eliminate the records which are present in the File 1.
Is there any option using SORT/File Manager.
Appreciate and Thanks in Advance.
Regards,
Gaurav Kudesiya |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Which sort product is used on your system? |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
DFSORT..
But FILE MANAGER is more prefered...
What you suggest??
Regards |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you prefer File Manager, suggest you look in their documentation.
If you want to do this using the sort, your topic can be relocated to the dfsort part of the forum. There are many existing topics on matching files and processing accordingly. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Thanks.. I'll go through the FileManager.. else DFSORT..
Will Post if stuck up further.
Appreciate your quick response as always.
Regards, |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
I was trying using Include cond()
But not able to figure out what condition to use.
------------------------------------------
File1
-------
ABCDEF1
ABCDEF2
ABCDEF3
ABCDEF4
----
---
--
-
ABCDEFN
File2
----------------------------
DATA ABCDEFD SOME DATA
DATA ABCDEF2 SOME DATA
DATA ABCDEF4 SOME DATA
DATA ABCDEF3 SOME DATA
DATA ABCDEFL SOME DATA
DATA ABCDEF1 SOME DATA
DATA ABCDEFM SOME DATA
DATA ABCDEFH SOME DATA
Output File3
-------------
DATA ABCDEFD SOME DATA
DATA ABCDEFL SOME DATA
DATA ABCDEFM SOME DATA
DATA ABCDEFH SOME DATA
I need to exclude the Whole record of File2 where the ID is present in File1 as above
Confused in what condition is to be used in INCLUDE.
Please help.
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you are comparing "keys" from 2 different files, INCLUDE is probably not what you'll use.
Suggest you search the DFSORT part of the forum for JOINKEYS.
I'll also move this to the DFSORT part of the forum. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for. I assumed your output records could be in sorted order. If they need to be in the original file2 order, let me know, and I'll show you how to do that. I also assumed your files are FB with positions as shown.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
ABCDEF1
ABCDEF2
ABCDEF3
ABCDEF4
//IN2 DD *
DATA ABCDEFD SOME DATA
DATA ABCDEF2 SOME DATA
DATA ABCDEF4 SOME DATA
DATA ABCDEF3 SOME DATA
DATA ABCDEFL SOME DATA
DATA ABCDEF1 SOME DATA
DATA ABCDEFM SOME DATA
DATA ABCDEFH SOME DATA
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,7,A)
JOINKEYS F2=IN2,FIELDS=(20,7,A)
JOIN UNPAIRED,F2,ONLY
OPTION COPY
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
@FY and DS : Trying the same thing...
Will update this in some time..
Thanks
Regards, |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
Tried the below
Code: |
//STEP05 EXEC PGM=SORT
//IN1 DD DSN=T0199RK.T0084GK.TESTING.INPUT1,DISP=SHR
//IN2 DD DSN=T0199RK.T0084GK.TESTING.INPUT2,DISP=SHR
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,7,A)
JOINKEYS F2=IN2,FIELDS=(24,7,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=* |
Getting the below error.
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1F464, MODEL 2097 603
SYSIN :
JOINKEYS F1=IN1,FIELDS=(1,7,A)
*
JOINKEYS F2=IN2,FIELDS=(24,7,A)
*
JOIN UNPAIRED,F2,ONLY
*
SORT FIELDS=COPY
*
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Tried everything, if i missed some syntex.. but gettting the same error
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Originally you said you use DFSORT. This output is from Syncsort . . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
I tried with the SORT.
But now its working
@Frank Yaeger:
I was missing teh DD names.
We can not use IN1 and IN2
It should be
Quote: |
//STEP05 EXEC PGM=SORT
//SORTJNF1 DD DSN=T0199RK.T0084GK.TESTING.INPUT1.NEW,DISP=SHR
//SORTJNF2 DD DSN=T0199RK.T0084GK.TESTING.INPUT2.NEW,DISP=SHR
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(24,7,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
//* |
Anyways, Thanks for the approach..
Its working now..
Thanks againg
Regards,
Gaurav |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for posting your solution
d |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I tried with the SORT. |
There's no such thing as "the SORT". There's DFSORT, Syncsort and CA-Sort.
The job I posted works fine with DFSORT.
However, although you said you are using DFSORT, you are actually using Syncsort. |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
I didnt try it with DFSORT, but with SORT, it was not taking those DD Names. BUt it worked with below code:
Code: |
//STEP05 EXEC PGM=SORT
//SORTJNF1 DD DSN=T0199RK.T0084GK.TESTING.INPUT1.NEW,DISP=SHR
//SORTJNF2 DD DSN=T0199RK.T0084GK.TESTING.INPUT2.NEW,DISP=SHR
//SORTOUT DD DSN=T0199RK.T0084GK.TESTING.OUTPUT,DISP=SHR
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,7,A)
JOINKEYS FILE=F2,FIELDS=(24,7,A)
JOIN UNPAIRED,F2,ONLY
SORT FIELDS=COPY
//SYSOUT DD SYSOUT=*
//* |
Rest all looks gud
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
It matters very little what you believe you execute. . . Many/most places can execute "SORT" for whichever sort product is being used. That is no reason to be unaware of which product is actually in use.
The informational output from the sort shows which sort product (and which release or ptf level) is being used.
One big reason this is important is that if one does not understand which product is in use, it makes it impossible to know which documentation to use to find specifics. While the sort products have many similarities, there are also quite a few differences (as you have just discovered ). |
|
Back to top |
|
|
GauravKudesiya Warnings : 1 New User
Joined: 11 Oct 2008 Posts: 74 Location: Chicago, IL
|
|
|
|
I Agree.... |
|
Back to top |
|
|
|