View previous topic :: View next topic
|
Author |
Message |
Prasanya
New User
Joined: 04 Jun 2007 Posts: 34 Location: Chennai
|
|
|
|
Hi,
I have a job in which I need to Sort & count the number of times a certain combination occurs in the input file & write the count to the O/P.
The Input will look like this:
Excp-code Brand
13.11.10 abc
12.12.10 def
11.13.10 def
11.13.10 ghi
11.13.10 ghi
The Exception Code is at 1:10,CH & the Brand is at 24:3,CH
I need the Count to be taken on a unique combination of Excp-Code & Brand, & I need the O/P to be in a formatted manner like this:
Excp-code Brand Count
11.13.10 ghi 2
11.13.10 def 1
12.12.10 def 1
13.11.10 abc 1
It is possible by using the SORT Utility. Actually, there is already a job similar to this requirement specified here(http://ibmmainframes.com/about28482.html), posted by Frank Yaeger. I just need to modify the Control Cards to include the second parameter for Sort function, as well as display it.
Can someone help me with this please? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Actually, your requirement is simpler than that other one. You can use a DFSORT/ICETOOL job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
13.11.10 abc
12.12.10 def
11.13.10 def
11.13.10 ghi
11.13.10 ghi
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) ON(1,10,CH) ON(24,3,CH) ON(VALCNT) -
NOHEADER BLANK
/*
|
OUT will have:
Code: |
11.13.10 def 1
11.13.10 ghi 2
12.12.10 def 1
13.11.10 abc 1
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Prasanya
New User
Joined: 04 Jun 2007 Posts: 34 Location: Chennai
|
|
|
|
Thanks a Million Frank. The Job Works perfectly now. |
|
Back to top |
|
|
nagarajan.dharani
New User
Joined: 27 Dec 2006 Posts: 36 Location: Chennai
|
|
|
|
I have another requirement similar to this.
Instead of two key fields I have 9 key fields for which I need to find a count.
Can you please advise if that is possible.
Thanks,
Dharani |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Show an example of the records in your input file and what you expect for output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field. |
|
Back to top |
|
|
|