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
 

 

Jcl to get the total counts of different set records.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Bijeshch

New User


Joined: 23 Apr 2010
Posts: 3
Location: USA

PostPosted: Fri Apr 23, 2010 3:31 am    Post subject: Jcl to get the total counts of different set records.
Reply with quote

Hi,

My input file is

1111 A
2222 B
1112 A
2223 B
3333 C
4444 A

I need out put as,

A 3
B 2
C 1

count of records for each A B & C fields
Is there any way to handle it through JCl ?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 23, 2010 5:50 am    Post subject:
Reply with quote

Hello and welcome to the forum,

No it cannot be done with "JCL". . . Nothing can be done "with JCL". . .

Things like this can be done with a utility or custom program. One such utility might be the sort.

Do you have a particular utility in mind?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Apr 23, 2010 6:18 am    Post subject:
Reply with quote

dick scherrer wrote:
No it cannot be done with "JCL". . . Nothing can be done "with JCL". . .
Oh Dick, you (and I) know that their reference to 'JCL' means a non-programing language such as COBOL, but a utility such as sort or one of the various others available from IBM and/or other providers.
The OP's question looks like a very simple sum on a single byte key.....
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Apr 23, 2010 6:46 am    Post subject:
Reply with quote

Hello,

Yes, we do. But many do not. . . JCL to more than just a few is this magic stuff that makes all sorts of work just "go away".

And whatever the meaning, the using of really poor terminology just shows how little the person has understood. More than one interviewee has been bypassed simply because they did not use proper terms.

In addition to helping with technical issues, we should insist on proper terminology and not just let incorrect terminology pass unnoted even if many are using the incorrect terms. . .

IMHO. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Apr 23, 2010 12:02 pm    Post subject:
Reply with quote

and he posted in this forum first, then went to another and posted at 12:23 asking the same question.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Apr 23, 2010 12:24 pm    Post subject:
Reply with quote

Hello There,

You can use below dfsort job. Am assuming that record length is 80 and FB
Code:
//STEP0100 EXEC PGM=SORT             
//SYSOUT   DD SYSOUT=*               
//SORTIN   DD *                       
1111 A                               
2222 B                               
1112 A                               
2223 B                               
3333 C                               
4444 A                               
/*                                   
//SORTOUT  DD SYSOUT=*               
//SYSIN    DD *                       
  SORT FIELDS=(6,1,CH,A)             
  INREC OVERLAY=(81:C'001')           
  SUM FIELDS=(81,3,ZD)               
  OUTREC FIELDS=(6,1,X,81,3,76X)     
/*                         
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 Apr 23, 2010 10:12 pm    Post subject:
Reply with quote

Here's another way to it using DFSORT/ICETOOL:

Code:

//S1    EXEC  PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//IN DD *                                                 
1111 A                                                   
2222 B                                                   
1112 A                                                   
2223 B                                                   
3333 C                                                   
4444 A                                                   
//OUT DD SYSOUT=*                                         
//TOOLIN DD *                                             
OCCUR FROM(IN) LIST(OUT) ON(6,1,CH) ON(VALCNT,U05) -     
  NOHEADER NOCC                                           
/*
Back to top
View user's profile Send private message
Bijeshch

New User


Joined: 23 Apr 2010
Posts: 3
Location: USA

PostPosted: Tue May 11, 2010 5:30 am    Post subject:
Reply with quote

Thanks.
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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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