Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
count the number of records based on two fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Bhuvaneswari K

New User


Joined: 15 Sep 2008
Posts: 17
Location: Chennai

PostPosted: Thu Jan 29, 2009 11:38 pm    Post subject: count the number of records based on two fields
Reply with quote

My requierment is:
Field1 Field2
12345 H
99999 H
12345 S
12345 H
87689 H
99999 H

The field 1 is numeric data type and the field 2 is character

My output should be:

12345 H 2
12345 S 1
87689 H 1
99999 H 2

Will the below statements do?

Code:

//STEP1  EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD DSN=...  input file
//OUT DD SYSOUT = *
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) BLANK -
 HEADER('Number') ON(1,5,CH,A) -
 HEADER('Flag') ON(7,1,CH) -
 HEADER('Count') ON(VALCNT,N05)
/*


Please reply at the earliest
Regards
Bhuvana
Back to top
View user's profile Send private message

Bhuvaneswari K

New User


Joined: 15 Sep 2008
Posts: 17
Location: Chennai

PostPosted: Thu Jan 29, 2009 11:51 pm    Post subject: count the number of records based on two fields
Reply with quote

Is it possible to use occur in icetool without header definitions?
I mean..

Code:

OCCUR FROM(INPUT) LIST(OUTPUT) BLANK -
  ON(1,5,CH) ON(7,1,CH) ON(VALCNT,N05)


Regards
Bhuvana
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jan 29, 2009 11:51 pm    Post subject: Reply to: count the number of records based on two fields
Reply with quote

bhuvaneswari,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL           
//TOOLMSG  DD SYSOUT=*                 
//DFSMSG   DD SYSOUT=*                 
//IN       DD *                       
12345 H                               
99999 H                               
12345 S                               
12345 H                               
87689 H                               
99999 H                               
//OUT      DD SYSOUT=*                 
//TOOLIN   DD *                       
 OCCUR FROM(IN) LIST(OUT) BLANK -     
 HEADER('NUMBER') ON(1,5,CH)    -     
 HEADER('FLAG') ON(7,1,CH)      -     
 HEADER('COUNT') ON(VALCNT,N05)       
/*                                     
Back to top
View user's profile Send private message
Bhuvaneswari K

New User


Joined: 15 Sep 2008
Posts: 17
Location: Chennai

PostPosted: Thu Jan 29, 2009 11:54 pm    Post subject:
Reply with quote

Thanks Kolusu..
Bhuvana
Back to top
View user's profile Send private message
Bhuvaneswari K

New User


Joined: 15 Sep 2008
Posts: 17
Location: Chennai

PostPosted: Fri Jan 30, 2009 12:03 am    Post subject: count the number of records based on two fields
Reply with quote

Is it possible to use occur in icetool without header definitions?
I mean..

Code:

OCCUR FROM(INPUT) LIST(OUTPUT) BLANK -
  ON(1,5,CH) ON(7,1,CH) ON(VALCNT,N05)


Regards
Bhuvana
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 30, 2009 12:06 am    Post subject:
Reply with quote

Quote:
Is it possible to use occur in icetool without header definitions?
I mean..

OCCUR FROM(INPUT) LIST(OUTPUT) BLANK -
ON(1,5,CH) ON(7,1,CH) ON(VALCNT,N05)


Yes. That would give you default headers:

Code:

(1,5,CH)   (7,1,CH)   VALUE COUNT   
12345      H                    2   
12345      S                    1   
87689      H                    1   
99999      H                    2   


If you don't want any headers, you can specify the NOHEADER operand. That would give you:

Code:

12345   H        2   
12345   S        1   
87689   H        1   
99999   H        2   
Back to top
View user's profile Send private message
Bhuvaneswari K

New User


Joined: 15 Sep 2008
Posts: 17
Location: Chennai

PostPosted: Fri Jan 30, 2009 12:10 am    Post subject:
Reply with quote

thanks alot Frank
Bhuvana
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us