IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

count the number of records based on two fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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 Developer


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

PostPosted: Fri Jan 30, 2009 12:06 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top