Display Filed value with counts.
Moderators: Frank Yaeger, Moderator Group
Display Filed value with counts.
Hi,
I have a file in which the data is as follows:
20000
30000
20000
40000
20000
30000
40000
20000
40000
30000
20000
20000
40000
40000
30000
40000
40000
Can we sort the above file through which i can get a o/p file as below:
30000 4 (i.e. No. of occurence of 30000)
20000 6 (i.e. No. of occurence of 30000)
40000 7 (i.e. No. of occurence of 30000)
I have a file in which the data is as follows:
20000
30000
20000
40000
20000
30000
40000
20000
40000
30000
20000
20000
40000
40000
30000
40000
40000
Can we sort the above file through which i can get a o/p file as below:
30000 4 (i.e. No. of occurence of 30000)
20000 6 (i.e. No. of occurence of 30000)
40000 7 (i.e. No. of occurence of 30000)
Thanks & Regards
M Pawan
M Pawan
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
I have a input file which has a redundant data. The field description is as follows:
Event No. Description
And the records in the file are as follows:
20000 ABC
30000 DEF
20000 GHI
40000 IJK
20000 LMN
30000 OPQ
Now i need a sort parameter by which we can count all the occurence of all events, neglecting other fields.
For above input records my output file should be having the following data
20000 3
30000 2
40000 1
i.e. first field will give the event no. and second will give count of the occurance of the event.
Event No. Description
And the records in the file are as follows:
20000 ABC
30000 DEF
20000 GHI
40000 IJK
20000 LMN
30000 OPQ
Now i need a sort parameter by which we can count all the occurence of all events, neglecting other fields.
For above input records my output file should be having the following data
20000 3
30000 2
40000 1
i.e. first field will give the event no. and second will give count of the occurance of the event.
Thanks & Regards
M Pawan
M Pawan
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use the OCCUR operator of DFSORT's ICETOOL to do this quite easily. For example:
You can format the output the way you want.
For complete details, see:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0630155256
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) ON(1,5,CH) ON(VALCNT,U03)
/*
For complete details, see:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0630155256
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Hi Frank,
I have coded my jcl as:
But i am getting error as:
am i missing anything.
I have coded my jcl as:
Code: Select all
//STEP EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//FILEIN DD DSN=TEST.FILEIP,
// DISP=SHR
//REPORT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(FILEIN) LIST(REPORT) ON(1,5,CH) ON(VALCNT,U03)
/*
Code: Select all
********************************* TOP OF DATA **********************************
SYT000I SYNCTOOL RELEASE 1.6.2 - COPYRIGHT 2007 SYNCSORT INC.
SYT001I INITIAL PROCESSING MODE IS "STOP"
SYT002I "TOOLIN" INTERFACE BEING USED
OCCUR FROM(FILEIN) LIST(REPORT) ON(1,5,CH) ON(VALCNT,U03)
SYT050E INVALID OPERAND ON "OCCUR" STATEMENT
SYT030I OPERATION COMPLETED WITH RETURN CODE 12
SYT015I PROCESSING MODE CHANGED FROM "STOP" TO "SCAN" DUE TO OPERATION FAILURE
SYT004I SYNCTOOL PROCESSING COMPLETED WITH RETURN CODE 12
******************************** BOTTOM OF DATA ********************************
Thanks & Regards
M Pawan
M Pawan
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
My job works fine with DFSORT's ICETOOL, but as you now know you're using Syncsort, not DFSORT.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
okay, I see the problem - do you leave any space between any of the "ON" operator - if yes, that's not an acceptable syntax:
Code: Select all
ON(1,5,CH) ON(VALCNT,U03)
Regards,
Anuj
Anuj
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page