Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us