|
|
| Author |
Message |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1252 Location: Mumbai, India
|
|
|
|
Hi,
Good, that's like My boy...
| Quote: |
| whether OCCUR clause has any issues with duplicate values in input. |
That depends on how many times "different ON field values" occur. Values that occur only once are called non-duplicate values and values that occur more than once are called duplicate values.
For the input:
| Code: |
1234 $$$$$
1234 $$$$$
3456 $$$$$
3456 $$$$$
3456 $$$$$ |
if You use
you would get
| Quote: |
| the output as expected though |
but if You change above ON as
You would get output "with duplicates", because when I 'count' on (6,5) I don't care about what is there in position 1 to 4 (no consideration for dupicatea, I'm just counting); however, for the length (1,10) the whole "OCCURence" is duplicate, and so a different output; try it...  |
|
| Back to top |
|
 |
References
|
Posted: Tue Apr 29, 2008 11:42 am Post subject: Re: |
 |
|
|
 |
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 18 Location: India
|
|
|
|
Hi Anuj to cite my control card again
| Code: |
OCCUR FROM(IN) LIST(OUT) NOHEADER BLANK -
ON(11,5,CH) ON(VALCNT,U02)
|
Thus I think what is happening here is I put in the 'OUT' file what is present in 11:5 and I also put the count of all records (i.e., VALCNT in the format U02) from the 'IN' file.
Now as I am counting all the records from say 1:15 there will be many occurances of there being duplicates.
Quoting from ur post
| Quote: |
ON(1,10,CH)
for the length (1,10) the whole "OCCURence" is duplicate, and so a different output |
this doesnt seem to be so. Any ideas  |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1252 Location: Mumbai, India
|
|
|
|
Hi,
Sorry, I did not get the 'message' of your previous post, please show input/ouput & the control cards. |
|
| Back to top |
|
 |
ramangouda patil
New User
Joined: 09 Apr 2008 Posts: 18 Location: India
|
|
|
|
Hi, the input(IN) is
300000000011899
300000000011899
300000000011899
300000000111899
300000000111899
300000000511899
300000000511899
Output(OUT) is
11899 7
And control card is as in my preceding post.
As you can see rec 1,2,3 are dups as well as 4&5 and 6&7. So OCCUR clause does seem to be working perfectly for duplicates as well. |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1252 Location: Mumbai, India
|
|
|
|
Well,
In the example shown above, values in position 11 to 5 are always same (11899), so for the control card
dulicates don't make any difference.
| Quote: |
| rec 1,2,3 are dups as well as 4&5 and 6&7. |
Records are duplicate only when you talk about "full length" of records, from the position 11 to 5 'point of view' nothing is duplicated; OCCUR was instructed to count the occurences for the values which 'falls' in position 11 to 5. And it did it (Output(OUT) is 11899 7 )
If you use
instead of previous control card, you would get
| Code: |
011899 3
111899 2
511899 2 |
which is same as this statement..
| Quote: |
| rec 1,2,3 are dups as well as 4&5 and 6&7. |
|
|
| Back to top |
|
 |
|
|
|