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

Jcl to get the total counts of different set records.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Fri Apr 23, 2010 5:50 am
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: 2146
Location: At my coffee table

PostPosted: Fri Apr 23, 2010 6:18 am
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

Moderator Emeritus


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

PostPosted: Fri Apr 23, 2010 6:46 am
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
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: 1208
Location: Bangalore,India

PostPosted: Fri Apr 23, 2010 12:24 pm
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 Developer


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

PostPosted: Fri Apr 23, 2010 10:12 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top