View previous topic :: View next topic
|
Author |
Message |
Bijeshch
New User
Joined: 23 Apr 2010 Posts: 3 Location: USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
and he posted in this forum first, then went to another and posted at 12:23 asking the same question. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
Bijeshch
New User
Joined: 23 Apr 2010 Posts: 3 Location: USA
|
|
|
|
Thanks. |
|
Back to top |
|
|
|