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
 
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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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