JCL to get only selected records from a ds --- without key
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 18
- Joined: Wed Sep 21, 2011 9:47 am
JCL to get only selected records from a ds --- without key
I have a file in which there are 20 records.
I want to extract only the 7th, 11th and 16th record.
Is it possible to get these records without any key characters in those records.
Can anyone please suggest me a JCL to do the above.
I want to extract only the 7th, 11th and 16th record.
Is it possible to get these records without any key characters in those records.
Can anyone please suggest me a JCL to do the above.
Suggest you simply copy the file and delete what you don't want. . .
What happens when some records are added or deleted and the "record number" changes?
No jcl can do what you want - some utility probably can. But if there are no rules, a utility will not be of much use.
What business requirement might this help with? Or is this just a curiosity?
If you more clearly explain why hard-coded record numbers exist, someone may have a more useful suggestion.
What happens when some records are added or deleted and the "record number" changes?
No jcl can do what you want - some utility probably can. But if there are no rules, a utility will not be of much use.
What business requirement might this help with? Or is this just a curiosity?
If you more clearly explain why hard-coded record numbers exist, someone may have a more useful suggestion.
Have a good one
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
bhargavi_ns,
You can use the SUBSET operator of DFSORT's ICETOOL to do that:
You can use the SUBSET operator of DFSORT's ICETOOL to do that:
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(7) RRN(11) RRN(16)
/*
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
There is a sequential file with record length 80.Now i want to extract first 40 characters of the record.how can i do thatFrank Yaeger wrote:bhargavi_ns,
You can use the SUBSET operator of DFSORT's ICETOOL to do that:
Code: Select all
//S1 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD DSN=... input file //OUT DD DSN=... output file //TOOLIN DD * SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(7) RRN(11) RRN(16) /*
syed wasim
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Please follow what DikDude has suggested. Unfortunately, I can't split this post; on the other hand to get you going - when you ask such a question, please more details such as - if your input file FB or VB?
If it's FB, use:
If it's VB, use:
If it's FB, use:
Code: Select all
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1,40)
Code: Select all
//SYSIN DD *
OPTION COPY
INREC FIELDS=(1,44)
Regards,
Anuj
Anuj
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
syed wasim,
If this does actually have something to do with the job you quoted, and you want to extract the first 40 bytes of each selected FB record, you can use a DFSORT/ICETOOL job like the following:
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
If this does actually have something to do with the job you quoted, and you want to extract the first 40 bytes of each selected FB record, you can use a DFSORT/ICETOOL job like the following:
Code: Select all
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(7) RRN(11) RRN(16) USING(CTL1)
/*
//CTL1CNTL DD *
INREC BUILD=(1,40)
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
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