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
 

 

Record count grouped by state

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Record count grouped by state
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 10, 2009 6:33 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Tue Mar 10, 2009 8:50 pm    Post subject:
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    Post subject: Re: Record count grouped by state
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: 500
Location: USA

PostPosted: Thu Mar 12, 2009 1:30 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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