I have a few records in a dataset which is the result of a jcl run prior :
FILE1 9002 000000010
FILE2 9003 000000020
FILE3 9004 000000030
FILE4 9005 000000040
FILE5 9006 000000050
FILE6 9007 000000010
-------------------------------------------------------
I want JCL for the above data to be converted as below into a ds :
NAME SEQ NO OF REC
FILE1 9002 000000010
FILE2 9003 000000020
FILE3 9004 000000030
FILE4 9005 000000040
FILE5 9006 000000050
FILE6 9007 000000010
TOTAL REC 000000160
any advises ?
sorting using jcl
Moderators: Frank Yaeger, DikDude, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use a DFSORT job like the following to do what you asked for:
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:
http://www.ibm.com/support/docview.wss? ... g3T7000080
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
FILE1 9002 000000010
FILE2 9003 000000020
FILE3 9004 000000030
FILE4 9005 000000040
FILE5 9006 000000050
FILE6 9007 000000010
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,
TRAILER1=('TOTAL REC',16:TOT=(18,8,ZD,M11,LENGTH=8))
/*
http://www.ibm.com/support/docview.wss? ... g3T7000080
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
-
- Member
- Posts: 18
- Joined: Wed Sep 21, 2011 9:47 am
********************************* Top of Data **********************************
NAME OF THE FILE SEQ COUNT
FILE1 9002 000123449 ............................
FILE2 9003 000971349 ............................
FILE3 9004 000999949 ............................
FILE4 9005 000976543 ............................
FILE5 9006 000765989 ............................
FILE6 9007 000764533 ............................
TOTAL NO OF RECORDS 004601812
******************************** Bottom of Data ********************************
Thanks Franks.
but how can i eliminate those lines in the output ..
Note :
to get individual files , i have in the beginning used :
OUTREC FIELDS=(C'File1 ',26:18,6,36:12,4,44:35,9)
the above i have used 6 times to get 6 files and then IEBGENER into one DS. then with your help got the sum.
Please help me to improve on this , and eliminate those unwanted lines
NAME OF THE FILE SEQ COUNT
FILE1 9002 000123449 ............................
FILE2 9003 000971349 ............................
FILE3 9004 000999949 ............................
FILE4 9005 000976543 ............................
FILE5 9006 000765989 ............................
FILE6 9007 000764533 ............................
TOTAL NO OF RECORDS 004601812
******************************** Bottom of Data ********************************
Thanks Franks.
but how can i eliminate those lines in the output ..
Note :
to get individual files , i have in the beginning used :
OUTREC FIELDS=(C'File1 ',26:18,6,36:12,4,44:35,9)
the above i have used 6 times to get 6 files and then IEBGENER into one DS. then with your help got the sum.
Please help me to improve on this , and eliminate those unwanted lines
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
I don't know which lines you're talking about. I see a header and trailer record, but I don't know if those are in the original input file or not. And I don't know if you want them in the output file or not. Please clarify what exactly is in the original input file (or files) and what exactly you want in the output file.but how can i eliminate those lines in the output ..
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
-
- Member
- Posts: 18
- Joined: Wed Sep 21, 2011 9:47 am
I receive 6 files daily . Each having around few records .
The trailer of each file has the seq number and record count in different position .
example :
in File 1 :
The Trailer record consists of :
FTAXENCRCM1898520110915093313001000084137560000
from this reocrd in file1 i have to extract and display like the format i have already specified :(the same for all 6 files)
NAME OF THE FILE SEQ COUNT
FILE1 9002 000123449
FILE2 9003 000971349
FILE3 9004 000999949
FILE4 9005 000976543
FILE5 9006 000765989
FILE6 9007 000764533
TOTAL NO OF RECORDS 004601812
can you give me a simple JCL to do the above .
i got to know how to calculate the total record count from your help.
but can you give me a simple JCL to extract all the 6 files as i have mentioned above.
The trailer of each file has the seq number and record count in different position .
example :
in File 1 :
The Trailer record consists of :
FTAXENCRCM1898520110915093313001000084137560000
from this reocrd in file1 i have to extract and display like the format i have already specified :(the same for all 6 files)
NAME OF THE FILE SEQ COUNT
FILE1 9002 000123449
FILE2 9003 000971349
FILE3 9004 000999949
FILE4 9005 000976543
FILE5 9006 000765989
FILE6 9007 000764533
TOTAL NO OF RECORDS 004601812
can you give me a simple JCL to do the above .
i got to know how to calculate the total record count from your help.
but can you give me a simple JCL to extract all the 6 files as i have mentioned above.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
This is too vague!The trailer of each file has the seq number and record count in different position .
example :
in File 1 :
Show me an example of each of the 6 input files and what you expect for output.
Also, tell me the RECFM and LRECL of each input file.
I'm happy to help, but you have to give me the details I need.
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
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