View previous topic :: View next topic
|
Author |
Message |
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
Hi,
I have a requirement where I need to compare two records from a same file and if a match is found write it in an output file.I am new to working with sorts in JCL.Please let me know how can this be done.
eg : REC1
REC2
REC2
REC3
The output file should contain REC2.
TIA |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What is the sort product installed at your shop(DFSORT\SYNCSORT\CA-SORT.... ) ?
Also you need to define your problem precisely.
Show the output for below sample
Code: |
REC1
REC2
REC2
REC3
REC3
REC3
|
|
|
Back to top |
|
|
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
Sambhaji wrote: |
What is the sort product installed at your shop(DFSORT\SYNCSORT\CA-SORT.... ) ?
Also you need to define your problem precisely.
Show the output for below sample
Code: |
REC1
REC2
REC2
REC3
REC3
REC3
|
|
Either of DFSORT or SYNCSORT can be used.
For the above input,the output should be
Code: |
REC2
REC2
REC3
REC3
REC3
|
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Hang on a mo .............. we are getting nowhere fast with the information that you have bothered to tell us. What are the rules from getting from input to output, the RECFM and LRECL of the input, the position, length and format of the key fields.
As for either sort product, there are so very few sites with both installed, so .....
Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.
If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.
If the messages start with ICE then your product is DFSORT and your topic will be moved to the appropriate forum. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.
If the messages start with WER or SYT then the product is SYNCSORT. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.
Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.
Code: |
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABC
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY |
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Below DFSORT ICETOOL step will give you desired result.
Code: |
//STEP050 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
REC1
REC2
REC2
REC3
REC3
REC3
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,4,CH) ALLDUPS
/*
|
|
|
Back to top |
|
|
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
The syncsort version used is 1.3.2.1R.But we can use both DFSORT and SYNCSORT for our product.
The format for Input and Output is the same.
I think the above reply posted by Sambhaji should work fine.I need to check few more options like XSUM before I can proceed with the above mentioned sort.
Thanks for replies. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
The syncsort version used is 1.3.2.1R.But we can use both DFSORT and SYNCSORT for our product |
Did you mean that you have both the products installed there? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Please post the requested output from your sort product. |
|
Back to top |
|
|
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
Arun Raj wrote: |
Quote: |
The syncsort version used is 1.3.2.1R.But we can use both DFSORT and SYNCSORT for our product |
Did you mean that you have both the products installed there? |
yes both the products are installed.DFSORT V1R5 is also installed along with SYNCSORT |
|
Back to top |
|
|
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
expat wrote: |
Please post the requested output from your sort product. |
When i run the sort,it displays messages(start with WER) for SYNCSORT.......but I can confirm that we have both the products installed. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Code: |
but I can confirm that we have both the products installed |
Are you able to run a DFSORT job and generate ICE messages? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I need to check few more options like XSUM before I can proceed with the above mentioned sort. |
Why? I suspect the solution Sambhaji posted does what you need. . . |
|
Back to top |
|
|
sachinkl
New User
Joined: 30 Jan 2010 Posts: 6 Location: pune
|
|
|
|
dick scherrer wrote: |
Hello,
Quote: |
I need to check few more options like XSUM before I can proceed with the above mentioned sort. |
Why? I suspect the solution Sambhaji posted does what you need. . . |
yes.....it works as required......thanks Sambhaji |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|