View previous topic :: View next topic |
Author |
Message |
bade_miya Beginner

Joined: 10 Dec 2003 Posts: 110 Topics: 38
|
Posted: Fri Oct 12, 2007 1:56 am Post subject: Stopafter in ICETOOL |
|
|
Hi All,
I have a requirement in which i am trying to create a sample extract of duplicates. That is i dont want all the duplicates but only the first 100 or so. I am using the below control card for extracting all the dups.
Code: |
SELECT FROM(IN) TO(OUT) ON(13,18,CH) ALLDUPS
|
What should i do if i have to select only the first 100 dups? I usually use STOPAFT if i have to just copy the first 100 records. But in this case, i dont know how to do.
I searched the help board before posting but could not find any threads suiting my need.
Can anyone help?
Thanks & Regards
bade_miya
[/code] |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Oct 12, 2007 2:12 am Post subject: |
|
|
bade_miya,
My suggestion:
1. U can assign seqnum at the end of the input record in the first pass.
2. U can filter records based on (seq_num field < n) where n is the number of records u need.
Check kolusu's ICETOOL solution to assign sqnums and filter only the first n records in the link:
http://www.mvsforums.com/helpboards/viewtopic.php?t=3570&highlight=icetool+record+count
I am sure there may be some other easiest way to do that but then !! _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
bade_miya Beginner

Joined: 10 Dec 2003 Posts: 110 Topics: 38
|
Posted: Fri Oct 12, 2007 2:16 am Post subject: |
|
|
Hi Vivek,
Thanks for the suggestion. But is it possible to accomplish this in one pass?
The problem is my input file is very huge and for two passes, it will take considerable time to execute.
Regards
bade_miya |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 12, 2007 3:10 am Post subject: |
|
|
bade_miya
Can you show a sample of i/p and o/p that you require.  _________________ cHEERs
krisprems |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 12, 2007 4:19 am Post subject: |
|
|
bade_miya
Take this example and modify as per your requirement
Code: | //GETMATCH EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
123456
423534
423534
423534
123456
423534
423534
423534
563456
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,6,CH) ALLDUPS USING(CP01)
/*
//CP01CNTL DD *
OUTREC OVERLAY=(81:SEQNUM,4,ZD,RESTART=(1,6))
OUTFIL REMOVECC,INCLUDE=(81,4,ZD,LT,10),BUILD=(1,80)
//*
|
Need any help, get back with example _________________ cHEERs
krisprems |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Oct 12, 2007 11:22 am Post subject: |
|
|
Krisprems,
Your job will not work with DFSORT/ICETOOL. You can't use OUTREC with SELECT. You will get:
Code: |
SELECT FROM(IN) TO(OUT) ON(1,6,CH) ALLDUPS USING(CTL1)
ICE652A 0 OUTREC STATEMENT FOUND BUT NOT ALLOWED - USE OUTFIL STATEMENT INSTEAD
ICE602I 0 OPERATION RETURN CODE: 12
|
INREC can be used with SELECT, but that won't help in this case because the seqnums must be added after the file is sorted and INREC is processed before the file is sorted. That's probably why you tried to use OUTREC. We could use OUTFIL to assign the seqnums with SELECT but since OUTFIL INCLUDE is processed after OUTFIL OVERLAY, we would still need two passes.
I think we need more information about what the OP is trying to do in order to solve this. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Fri Oct 12, 2007 11:30 am; edited 1 time in total |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Oct 12, 2007 11:27 am Post subject: |
|
|
bade,
STOPAFT only applies to the input side, not the output side. You want the records after they're sorted so STOPAFT doesn't apply. And STOPAFT only applies to one set of input records, not to multiple sets of duplicate output records.
Do you want up to 100 duplicates for each key value or is there only one key value?
What is the RECFM and LRECL of your input file? What is the starting position, length and format of your key?
Quote: | The problem is my input file is very huge |
How large is it actually? _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Last edited by Frank Yaeger on Sat Oct 13, 2007 12:17 pm; edited 1 time in total |
|
Back to top |
|
 |
krisprems Beginner

Joined: 13 Dec 2006 Posts: 101 Topics: 4 Location: india
|
Posted: Fri Oct 12, 2007 10:26 pm Post subject: |
|
|
Quote: | Krisprems,
Your job will not work with DFSORT/ICETOOL. You can't use OUTREC with SELECT. You will get:
|
Ok frank, will keep this in mind. _________________ cHEERs
krisprems |
|
Back to top |
|
 |
bade_miya Beginner

Joined: 10 Dec 2003 Posts: 110 Topics: 38
|
Posted: Mon Oct 15, 2007 1:51 pm Post subject: |
|
|
Hi Frank,
Thanks for the reply. Here are the answers to your questions.
1) There is only one key value.
2) The record format is FB. LRECL is 80. FIELD is starting from 13th position,18 bytes long and is character field.
3) My file has around 18 million records.
Code: |
Sample input
----------------
aaa
bbb
bbb
bbb
ccc
ddd
ddd
ddd
eee
eee
fff
fff
ggg
ggg
hhh
iii
iii
jjj
jjj |
If i want the first 3 duplicates only, then, my output file will look like below
Code: | Sample Output
-----------------
bbb
ddd
eee |
Is it possible to accomplish this in one pass?
Thanks for your help
Regards
bade_miya |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Oct 15, 2007 2:39 pm Post subject: |
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
aaa
bbb
bbb
bbb
ccc
ddd
ddd
ddd
eee
eee
fff
fff
ggg
ggg
hhh
iii
iii
jjj
jjj
//OUT DD DSN=... output file (FB/80)
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(13,18,CH) FIRSTDUP USING(CTL1)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,ENDREC=3
/*
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
|
|