View previous topic :: View next topic
|
Author |
Message |
ayansau
New User
Joined: 22 Jun 2007 Posts: 42 Location: Chennai
|
|
|
|
I have 1 file having 40 records.
File is like this:
Field1 Field2 Field3
:
:
:
I want the output that contains those records having same value of Field2 repeats maximum 30 times.
If Field2 = 1122 for 35 records and 3333 for rest 5 then the output file will contain 30 records containing Field2 = 1122 and 5 rest records. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
ayansau,
Say you have a situation where key A, B, C & D has 10 records (4* 10 =40) each. Then how do you expect your O/P. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ayansau,
If I understand what you want correctly (and I may not), you can use a DFSORT job like the following. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
SORT FIELDS=(8,6,CH,A)
OUTREC OVERLAY=(81:SEQNUM,8,ZD,RESTART=(8,6))
OUTFIL OMIT=(81,8,ZD,GT,+30),BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
ayansau
New User
Joined: 22 Jun 2007 Posts: 42 Location: Chennai
|
|
|
|
murmohk1 wrote: |
ayansau,
Say you have a situation where key A, B, C & D has 10 records (4* 10 =40) each. Then how do you expect your O/P. |
In this case all record should retain |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
ayansau,
Did the DFSORT job I supplied do what you wanted? |
|
Back to top |
|
|
ayansau
New User
Joined: 22 Jun 2007 Posts: 42 Location: Chennai
|
|
|
|
is that iceman tool client specific?
Its giving "PARAMETER 'OVERLAY' IS UNIDENTIFIED"
Earlier I have used "INREC OVERLAY=(..." but not "OUTREC OVERLAY=(" in ICETOOL, It was working fine. But in ICEMAN its not passing in syntax check. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
ayansau,
Quote: |
Its giving "PARAMETER 'OVERLAY' IS UNIDENTIFIED" |
Could you post your spool messages? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
"PARAMETER 'OVERLAY' IS UNIDENTIFIED" |
This is NOT a DFSORT message. You must be using some other product (perhaps it checks the syntax before it calls the sort product).
OVERLAY has been available with DFSORT since Dec, 2004.
Quote: |
Earlier I have used "INREC OVERLAY=(..." but not "OUTREC OVERLAY=(" in ICETOOL, It was working fine. But in ICEMAN its not passing in syntax check. |
OVERLAY is a parameter available with DFSORT's INREC, OUTREC and OUTFIL statements. You can use these statements with DFSORT's ICETOOL in xxxxCNTL data sets. I assume that's what you mean when you say it was working fine with ICETOOL. But it doesn't make sense that you could use OVERLAY with DFSORT's ICETOOL and not with DFSORT itself. It appears that when you specify PGM=ICEMAN, you get some other program, not DFSORT whereas when you specify PGM=ICETOOL, you get DFSORT's ICETOOL. I can't really figure this out for you since I don't know how your shop has things set up. |
|
Back to top |
|
|
|