Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Need to count Records and also display one field in output
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL
Author Message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1708
Location: Phoenix, AZ

PostPosted: Tue Apr 29, 2008 11:42 am    Post subject:
Reply with quote

Hi,
Quote:
clear now
Good, that's like My boy... icon_smile.gif

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
Code:
ON(6,5,CH)
you would get
Quote:
the output as expected though

but if You change above ON as
Code:
ON(1,10,CH)

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... icon_smile.gif
Back to top
View user's profile Send private message
References
PostPosted: Tue Apr 29, 2008 11:42 am    Post subject: Re: Reply with quote

ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 20
Location: India

PostPosted: Tue Apr 29, 2008 12:51 pm    Post subject:
Reply with quote

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 icon_idea.gif
Back to top
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1708
Location: Phoenix, AZ

PostPosted: Tue Apr 29, 2008 1:59 pm    Post subject:
Reply with quote

Hi,

Sorry, I did not get the 'message' of your previous post, please show input/ouput & the control cards.
Back to top
View user's profile Send private message
ramangouda patil

New User


Joined: 09 Apr 2008
Posts: 20
Location: India

PostPosted: Tue Apr 29, 2008 2:10 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1708
Location: Phoenix, AZ

PostPosted: Tue Apr 29, 2008 11:40 pm    Post subject:
Reply with quote

Well,

In the example shown above, values in position 11 to 5 are always same (11899), so for the control card
Code:
ON(11,5,CH)
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
Code:
ON(10,6,CH)

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2