View previous topic :: View next topic
|
Author |
Message |
sourav_dasgupta
New User
Joined: 26 Dec 2007 Posts: 18 Location: Chennai, India
|
|
|
|
Hi,
I am using DFSORT for merging two files file X and file Y and sorting. In case of duplicate I need to make sure the record from file X is written into the output file. I understand that it is the basic thing in ICETOOL splice but need to know if this is possible without using splice. (It seems my project does not want me to use ICETOOL, instead I have to manage with DFSORT).
The following is a sample JCL:
Code: |
//STEP0010 EXEC PGM=SORT
//SORTIN DD *
100FIELD1FILEX
102FIELD1FILEX
103FIELD1FILEX
106FIELD1FILEX
/*
// DD *
101FIELD1FILEY
100FIELD1FILEY
102FIELD1FILEY
104FIELD1FILEY
105FIELD1FILEY
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,3,ZD,A)
SUM FIELDS=NONE
/*
|
The output I am getting in spool is
Code: |
********************************* TOP OF DATA **********************************
100FIELD1FILEX
101FIELD1FILEY
102FIELD1FILEY
103FIELD1FILEX
104FIELD1FILEY
105FIELD1FILEY
106FIELD1FILEX
******************************** BOTTOM OF DATA ********************************
|
In this case the problem is record 102 is being written from file Y where as I need to write it from file X.
Can any one help? |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi Sourav,
Use like this,
Code: |
SORT FIELDS=(1,3,ZD,A),EQUALS
SUM FIELDS=NONE
|
The EQUALS condition will maintain the order of the records in the input file.
Regards,
Bipin Peter |
|
Back to top |
|
|
sourav_dasgupta
New User
Joined: 26 Dec 2007 Posts: 18 Location: Chennai, India
|
|
|
|
@Bipin
Thanks a lot. It worked as I wanted.
Thanks
Sourav |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Always Welcome.. |
|
Back to top |
|
|
|