View previous topic :: View next topic
|
Author |
Message |
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
I have a file of lrecl 400.
I need to split that into two files where one file should contain all the unique records and the other should contains the rest. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
What constitutes a duplicate, specific fields or the whole record. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
The following code will help u, and i assumed the key field as (1,9). You can change as ur requirement.
Code: |
//GETMATCH EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
242293732 001 836
433679765 004 836
/*
//OUTDUP DD SYSOUT=*
//OUTNODUP DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUTNODUP) ON(1,9,CH) NODUPS
SELECT FROM(IN) TO(OUTDUP) ON(1,9,CH) ALLDUPS
/*
|
OUTNODUP: Unique records
OUTDUP: Rest
Regards
R KARTHIK |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
The following output i got,
OUTNODUP:
Code: |
242293732 001 836
433679765 004 836
|
OUTDUP:
Code: |
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
310789954 004 836
|
Regards
R KARTHIK |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Karthik,
You can avoid an additional pass of data by using the DISCARD option in SELECT.
Code: |
SELECT FROM(IN) TO(OUTNODUP) ON(5,4,CH) NODUPS DISCARD(OUTDUP) |
Thanks,
Arun |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi Arun,
Ya. U are correct. Thanks for sharing that option.
Regards
R KARTHIK |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
hiii all,
Thanks for ur reply. |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi,
I have used the card that u have mentioned here....
But i a,m getting RC = 20 errror thr....
Code: |
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A)
NODUPS DISCARD(SORTXSUM)
|
I am still not able to get my result. could any body please help me out.
EXAMPLE :-
INPUT
a
a
b
c
d
OUT1
b
c
d
OUT2
a
a
Thanks in advance . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Please clarify which sort product that you are using, DFSORT or SYNCSORT as the solution to your problem may vary depending on the product being used.
Also you have not yet answered my original question in this thread regarding the fields that constitue a duplicate or if we are comparing the whole record.
Please post the JCL that you are using including the control statements.
Unless you help us, we can not help you. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
ON - a field to be used for this operation. From 1 to 10 ON fields can be specified.
– (p,m,f) gives the position, length and format of a numeric or character field.
Change
Code: |
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A)
NODUPS DISCARD(SORTXSUM)
|
To,
Code: |
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH)
NODUPS DISCARD(SORTXSUM)
|
Regards
R KARTHIK |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
HI,
To continue the control statement to next line use '-'.
For example,
Code: |
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH,A,122,278,CH,A) -
NODUPS DISCARD(SORTXSUM)
|
Regards
R. KARTHIK
[/code] |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi,
I dont know exactly but it is SYNCSORT. More over in this thread we are comparing the whole record.
The JCL I m using is
Code: |
//SORTIN DD DSN=file1
// DISP=SHR
//SYSOUT DD SYSOUT=*
//SORTOUT DD DSN=Out1
// DISP=(OLD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=*.SORTIN
//SORTXSUM DD DSN=Out2
// DISP=(OLD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=(1,99,CH,A,122,278,CH,A)
SUM FIELDS=NONE,XSUM
/*
|
Please let me know if u need any more information for my issue. |
|
Back to top |
|
|
karthikr44
Active User
Joined: 25 Aug 2007 Posts: 235 Location: Chennai
|
|
|
|
Hi,
In last post i misused the on fields. Actual code is as follows
Code: |
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH) -
NODUPS DISCARD(SORTXSUM)
|
Regards
R KARTHIK |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi Karthik,
Thanks for ur reply...
But still i am getting the same RC = 20.
I am not able to find out the reason for the error also.
Do u have any idea for this ??? wt may be the wrong in the JCL ?? |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi,
I have tried with EXEC PGM=ICETOOL, Got RC = 20
PGM=SYNCTOOL , Got RC = 20
and when i tried using EXEC PGM=SYNCSORT , I got the below error
Code: |
DSS11043E NO SORT OR MERGE CONTROL STATEMENT WAS FOUND
DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'SELECT'.
DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'NODUPS'. |
Really thanks for your concern regarding this.
Do u have any other technique to achieve my required output. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Siva,
Quote: |
wt may be the wrong in the JCL ?? |
Already the solution for your problem has been posted in this thread. i.e, separating records with duplicates into one file and those without duplicates into another file. you just need to understand that and modify it as per your requirement.
If you are still getting errors, post the run jcl and sysout messages.
Thanks,
Arun |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
siva102 wrote: |
Code: |
DSS11043E NO SORT OR MERGE CONTROL STATEMENT WAS FOUND
DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'SELECT'.
DSS11051E UNRECOGNIZED 'SORT' KEYWORD 'NODUPS'. |
|
Are you sure you have SyncSort installed at your site? These do not appear to be SyncSort messages. SyncSort messages are typically WERnnnn and SYNCTOOL messages are SYTnnnn. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi Alissa,
I dont know exactly wt type of sort we are having.
Actully i just did QW SORT AND there it shows like SYNCSORT. So i suppose it was a syncsort one.
Thanks for ur concern |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi Arun,
I had already posted my run JCL here.
I ve posted the error message too there.
Apart from that i could not find anything in my spool.
Arun i ve tried with the SORT card that has been provided to me in this forum, but as per my previous thread i m getting an RC = 20.
As per frank, the error is a PROJCL Scan one.
Could anyone please tell me how to overcome this issue.
Thanks in advance. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I have tried with EXEC PGM=ICETOOL, Got RC = 20 |
In case it helps, for DFSORT's ICETOOL, RC=20 is issued if you do not have the //TOOLMSG DD.
If that's not the problem, then i suggest you show your complete JCL for the SELECT job. I'm guessing you set it up wrong. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
siva102 wrote: |
I dont know exactly wt type of sort we are having. |
Check the SYSOUT of some SORT JOB, if the messages appear there are of type ICExxxx then your shop make use of DFSORT & if messages are of type WERxxxx it's SyncSort. Both of these are competitive products and on this portal they are discussed under different forums. Syncsort falls under JCL forum & DFSORT question are discussed in DFSORT & ICETOOL forum.
Quote: |
Actully i just did QW SORT AND there it shows like SYNCSORT. |
MVS/QuickRef product is like "tutorial" it would contain a general information, it's not the right place to get such information. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If this is still not working, please post all of the jcl and sort control statements for this step as well as the all of the information created by the step (including the message ids) when the step was executed.
Use copy/paste and the "Code" tag to post this info. Do not post the messages from JJ or some other jcl-check tool. |
|
Back to top |
|
|
siva102
New User
Joined: 28 Nov 2007 Posts: 63 Location: Chennai
|
|
|
|
Hi all,
Thanks to Dick and Frank. The RC = 20 error has been resolved.
Now the JCL runned successfully but the output remains the same. Please chk the JC that i runned,
Code: |
//******* JOB ('TEST'),MSGCLASS=O,CLASS=T,NOTIFY=&SYSUID
//*STEP1 EXEC PGM=SORT
//STEP1 EXEC PGM=ICETOOL
//SORTIN DD DSN=Input File,
// DISP=SHR
//SYSOUT DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTOUT DD DSN=Out1
// DISP=(OLD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=*.SORTIN
//SORTXSUM DD DSN=out2,
// DISP=(OLD,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(15,15),RLSE),
// DCB=*.SORTIN
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,99,CH) ON(122,278,CH) -
NODUPS DISCARD(SORTXSUM)
/*
If my file is having 3 duplicate records then one record is going to OUT1 and the other two to OUT2.
But i need aal the 3 records need to goto OUT2.
Please help me regarding this.
|
|
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
instead of NODUPS, try ALLDUPS except all dups will be written to SORTOUT
Gerry |
|
Back to top |
|
|
|