View previous topic :: View next topic
|
Author |
Message |
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Hi,
I have a file which is to be sorted on first 10 bytes (Charector). The output file should contain 1st 5 (5 or less but not more than 5) duplicate records. If there are only 1 record, then the output should contain only that record
Code: |
1234567890AAAAAAAAAAAAAA
1234567890BBBBBBBBBBBBBB
1234567890CCCCCCCCCCCCCC
1234567890DDDDDDDDDDDDDD
1234567890AAAAAAAAAAAAAA
1234567890EEEEEEEEEEEEEE
1234567890FFFFFFFFFFFFFF
5555567890ZZZZZZZZZZZZZZ
6666567890YYYYYYYYYYYYYY
6666567890VVVVVVVVVVVVVV
6666567890XXXXXXXXXXXXXX
|
The above file has to be sorted on the 1st 10 byte. There are 3 Unique Keys
1234567890 - Has 7 records
5555567890 - Has 1 record
6666567890 - Has 3 records.
So my Output file should contain 1st 5 records from 1234567890, 1 record from 5555567890 and 3 records from 6666567890 .
The Output file should look like below
Code: |
1234567890AAAAAAAAAAAAAA
1234567890BBBBBBBBBBBBBB
1234567890CCCCCCCCCCCCCC
1234567890DDDDDDDDDDDDDD
1234567890AAAAAAAAAAAAAA
5555567890ZZZZZZZZZZZZZZ
6666567890YYYYYYYYYYYYYY
6666567890VVVVVVVVVVVVVV
6666567890XXXXXXXXXXXXXX
|
Can you please help me in developing a Sort Card for the above requirement.
Thanks
Sikkandhar |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Please run the below piece of code and post the SYSOUT segment from the output so that we can see which product and release level you have installed.
Code: |
//SORTCOPY EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
/*
// |
|
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Assuming that you have Syncsort(since you have posted here in JCL forum), and if you are able to use SYNCTOOL, you can try with SELECT and FIRST. Something like:
Code: |
SELECT FROM(IN) TO(OUT) ON(1,10,CH) FIRST(5) |
|
|
Back to top |
|
|
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Hi Expat,
Due to Security reasons, am not allowed to paste the entire SYSOUT. Am pasting only the selected information
Code: |
1 SYNCSORT FOR Z/OS 1.4.0.1R (C) 2010 SYNCSORT INC. DATE=2013/232 TIME=02.42.17
z/OS 1.13.0
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.4 BATCH 0520 TPF LEVEL 0.1 |
Please let me know if you need more information.
Thanks
Sikkandhar |
|
Back to top |
|
|
Sikkandhar
New User
Joined: 03 Dec 2007 Posts: 61 Location: Bangalore
|
|
|
|
Thanks Mistah Kurtz. The control card works fine for my requirement
Sikkandhar |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
you're welcome |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Crossed 100 safely.. congrats :-) |
|
Back to top |
|
|
mistah kurtz
Active User
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
|
|
|
|
Quote: |
Crossed 100 safely.. congrats :-) |
Thanks |
|
Back to top |
|
|
|