Hi All,
Can anyone help me with my requirement.
My output file contains some incorrect / invalid character I know its HEX values. But I need to replace these HEX values in 2 different ranges.
1) Input file (Sortin) is LRECL 128
2) RECFM = fb
3) First range is from 10-26
4) Second Range is from 70-86
If I find these hex values only between these 2 ranges I need to replace with spaces.
Invalid HEX are X'D5', X'4B', X'2B'. I need to replace this with X'40'
I know we can use FINDREP to change these one / more HEX values to spaces, I tried it and it worked, but found that I have these invalid values in other ranges and those also got replaced, since I dont want to change those values. I want to change only the values between 10-16 and 70-86.
Any help would be great.
Best Regards,
Harikrishnan
Find and Replace @ Diff positions.
Moderators: Frank Yaeger, Moderator Group
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
You can use STARTPOS=x and ENDPOS=y with FINDREP to limit the columns it searches. Something like:
Code: Select all
OPTION COPY
INREC IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=10,ENDPOS=16,
IN=(X'D5',X'4B',X'2B'),OUT=X'40'),HIT=NEXT),
IFTHEN=(WHEN=INIT,FINDREP=(STARTPOS=70,ENDPOS=86,
IN=(X'D5',X'4B',X'2B'),OUT=X'40'))
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