View previous topic :: View next topic
|
Author |
Message |
ashok4u_it
New User
Joined: 12 Mar 2008 Posts: 53 Location: Chennai
|
|
|
|
Hi Guys,
Is there a solution for the scenario given below. I want it to be tried in DFSORT not with ICETOOL.
For Example,
File1
A
001
002
003
004
005
File2
A B
001 20
002 30
003 40
110 50
120 60
130 70
I want to merge both files based upon Field A. The output should contain all the records from File1. IF match found, the new field(B) should be populated from file2. If not, the new field should be populated as BLANK.
The resulting output should be,
Output
A B
001 20
002 30
003 40
004
005
Thanks
Ashok Kumar.K |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ICETOOL is part of DFSORT |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
ashok4u_it,
Assuming both files have same dcb properties and the keys being unique, the following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
001 20
002 30
003 40
110 50
120 60
130 70
// DD *
001
002
003
004
005
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'00')),
IFTHEN=(WHEN=(5,1,CH,EQ,C' '),OVERLAY=(81:C'01'))
SORT FIELDS=(1,3,CH,A),EQUALS
SUM FIELDS=(81,2,ZD)
OUTFIL INCLUDE=(81,2,ZD,EQ,1),BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
Ashok,
Quote: |
I want it to be tried in DFSORT not with ICETOOL
|
May I ask you why ICETOOL should not be used? If you don't know the reason, can you ask the person who told you not to use ICETOOL.
as Expat said ICETOOL is a part of DFSORT |
|
Back to top |
|
|
|