searching for a special character through sort
Moderators: Frank Yaeger, Moderator Group
searching for a special character through sort
hi,
I have a requirement where in my jcl sort needs to search for a special character like *.
the sample data would be like this
1234545*
1*32345
1234*11
1234555
2343566
My sort jcl needs to pick only the first three records which contains *
thanks in advance
I have a requirement where in my jcl sort needs to search for a special character like *.
the sample data would be like this
1234545*
1*32345
1234*11
1234555
2343566
My sort jcl needs to pick only the first three records which contains *
thanks in advance
thanks
Bobby
Bobby
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
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 *
1234545*
1*32345
1234*11
1234555
2343566
9234*11
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY,STOPAFT=3
INCLUDE COND=(1,80,SS,EQ,C'*')
/*
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
Hi frank,
I have two input files and require a output format based on the following conditions.
input file 1 lrecl 80
****************
1234 test data
2345 sample
3456 test sample
input file 2 lrecl 80
***************
1234 bobby
1234 frank
2345 adam
3456 john
my output file should look like
output file
********
1234 test data bobby
2345 sample adam
3456 test sample john
the key in both the input files is first 4 bytes. If the key field is present in both the files i want the complete record from the first file and one field from the second file. input file 1 has no duplicates. Input file 2 has duplicates i want to consider the first occurance in that case.
could you please help me with this..
I have two input files and require a output format based on the following conditions.
input file 1 lrecl 80
****************
1234 test data
2345 sample
3456 test sample
input file 2 lrecl 80
***************
1234 bobby
1234 frank
2345 adam
3456 john
my output file should look like
output file
********
1234 test data bobby
2345 sample adam
3456 test sample john
the key in both the input files is first 4 bytes. If the key field is present in both the files i want the complete record from the first file and one field from the second file. input file 1 has no duplicates. Input file 2 has duplicates i want to consider the first occurance in that case.
could you please help me with this..
thanks
Bobby
Bobby
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Are you using DFSORT (ICExxxs messages?).
If so, do you have the Nov, 2009 DFSORT PTF? To find out, look at the ICE201I message from a DFSORT run - if it has
ICE201I G
then you have the Nov, 2009 PTF installed. Otherwise, you don't. Let me know.
In the future, please start a New Topic for a new question rather than appending it to an old, unrelated one. Also, please use ubb code tags around your examples.
If so, do you have the Nov, 2009 DFSORT PTF? To find out, look at the ICE201I message from a DFSORT run - if it has
ICE201I G
then you have the Nov, 2009 PTF installed. Otherwise, you don't. Let me know.
In the future, please start a New Topic for a new question rather than appending it to an old, unrelated one. Also, please use ubb code tags around your examples.
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
dfsort icetool
Hi,
My shop as Dfsort icettol however frank was asking for some specific message ice201I G which i don't find in the icetool messages..
My shop as Dfsort icettol however frank was asking for some specific message ice201I G which i don't find in the icetool messages..
thanks
Bobby
Bobby
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Hmmm ... I can't figure out the positions of the fields in the input or output records.
Please tell me the starting position, length and format of each field in each input file and in the output file.
Please tell me the starting position, length and format of each field in each input file and in the output file.
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
input file 1 lrecl 80
****************
1234 test
2345 host
3456 also
input file 2 lrecl 80
***************
1234 bobby
1234 frank
2345 adam
3456 john
my output file should look like
output file
********
1234 test bobby
2345 host adam
3456 also john
if input file-1 first four bytes matches with the first four bytes of input file-2. Then copy the record from input file and the second field in the second file 5 bytes that is from 6th position.
in the above example 1234 is present in both the files in this case
i want the following data in output file.
1234 test data bobby
Please let me know if you have questions in my question
****************
1234 test
2345 host
3456 also
input file 2 lrecl 80
***************
1234 bobby
1234 frank
2345 adam
3456 john
my output file should look like
output file
********
1234 test bobby
2345 host adam
3456 also john
if input file-1 first four bytes matches with the first four bytes of input file-2. Then copy the record from input file and the second field in the second file 5 bytes that is from 6th position.
in the above example 1234 is present in both the files in this case
i want the following data in output file.
1234 test data bobby
Please let me know if you have questions in my question
thanks
Bobby
Bobby
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
In your example, every key in file1 has a match in file2. Is that always the case or can there be a key in file1 that is not in file2 and/or a key in file2 that is not in file1? If so, please expand your input/output example to show the other possible cases, and explain what you want to do in those cases.Please let me know if you have questions
Also, you show the records already sorted by the key in file1 and in file2. Is that always true or can the records be in unsorted order in file1 and/or file2?
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