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

Record count grouped by state


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Tue Mar 10, 2009 6:18 pm
Reply with quote

Hi All,

I have the following input file.

Code:


42501131383 ap
42501131457 ap
42501131644 ap
42501133172 tn
42501133248 tn
42501135032 tn
42501135333 wb
42501137367 wb
42501137835 wb
42501138553 wb



first 11 bytes is a unique#,1byte space, 2byte state code(14 byte file).
i need the count per state. i.e.

count for ap=3
count for tn=3
count for wb=4

can anyone tell me how to get this count.

thanks,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 10, 2009 6:33 pm
Reply with quote

This may help,
Code:

//ICETOOL1 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//INFILE   DD DSN=                                               
//OUFILE   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2CH) ON(VALCNT)
/*                                                               
Back to top
View user's profile Send private message
arvind.m

Active User


Joined: 28 Aug 2008
Posts: 205
Location: Hyderabad

PostPosted: Tue Mar 10, 2009 7:28 pm
Reply with quote

I got the below error msg:

Quote:

SYT215E "ON" LENGTH IS NOT 1 TO 1500
SYT030I OPERATION COMPLETED WITH RETURN CODE 12

SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE

Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Mar 10, 2009 8:50 pm
Reply with quote

Sorry, typo
Code:
 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2CH) ON(VALCNT)

Should be
Code:
 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(13,2,CH) ON(VALCNT)
Back to top
View user's profile Send private message
Sachinrethin

New User


Joined: 12 Oct 2007
Posts: 21
Location: Chennai

PostPosted: Wed Mar 11, 2009 2:26 pm
Reply with quote

Hi,

Another way to do this... just a try..

INREC OVERLAY=(81:C'000000001')
SORT FIELDS=(13,2,CH,A)
SUM FIELDS=(81,9,ZD)
OUTREC BUILD=(13,2,81,9,ZD,EDIT=(IIIIIIIIT),69X)

and got the output as,

ap 3
tn 3
wb 4
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Thu Mar 12, 2009 1:30 am
Reply with quote

Arvind,

Here is another alternative:
Code:

//SORT1 EXEC PGM=SORT                                   
//SORTOUT DD SYSOUT=*                                   
//SYSOUT  DD SYSOUT=*                                   
//SORTIN  DD *                             
42501131383 AP                             
42501131457 AP                             
42501131644 AP                             
42501133172 TN                             
42501133248 TN                             
42501135032 TN                             
42501135333 WB                             
42501137367 WB                             
42501137835 WB                             
42501138553 WB                             
//SYSIN   DD *                             
   SORT FIELDS=(13,2,CH,A)                 
   OUTFIL FILES=OUT,SECTIONS=(13,2,       
       TRAILER3=(C'COUNT FOR ',13,2,C'=', 
       COUNT=(EDIT=(IIIT)))),             
       REMOVECC,NODETAIL                   
/*


The output produced is as follows:
Code:
COUNT FOR AP=   3
COUNT FOR TN=   3
COUNT FOR WB=   4
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top