I have a VB input file where all of the records start with a fixed identifier in RDW + 0 (the first data portion of the record - the "record type").
I am happily modifying the input data records based on the "record type", except for one particular record type - the "3B900".
For this type, I happen to know that it's a 20 byte record (including the RDW). My problem is that I need to add a 7 byte field containing character zeroes to the end of the record, and increase its size to 27 bytes.
The following sort of explains what I'm trying to do, but doesn't work!
OPTION COPY
OUTFIL FILES=OUT,
IFTHEN(WHEN=(05,5,CH,EQ,C'3B300',AND,
13,4,CH,EQ,C'04'),
OVERLAY=(30:C'01500',
57:C'0225',
65:C'0120')),
IFTHEN(WHEN=(05,5,CH,EQ,C'3B900'),
OVERLAY=(21:C'0000000'),
IFOUTLEN=27)
The "IFOUTLEN" clause gets errored in the above example, but I've tried a few similar combinations, all to no avail. It looks like IFOUTLEN works on ALL records.
Has anyone got any ideas on how to just change the record length for specific records only, without affecting the length of the other records in the file?
Conditionally hanging the length of variable length records.
Moderators: Frank Yaeger, Moderator Group
Conditionally hanging the length of variable length records.
The only stupid question is the one you DON'T ask!
-
- Member
- Posts: 25
- Joined: Tue Apr 28, 2009 10:53 pm
- Location: USA
- Contact:
Sayton,
Have you tried just removing the IFOUTLEN statement? If you are still not getting the desired results after making this change, please identify which SORT utility and the release you are running.
Have you tried just removing the IFOUTLEN statement? If you are still not getting the desired results after making this change, please identify which SORT utility and the release you are running.
Last edited by Alissa Margulies on Thu May 07, 2009 8:51 pm, edited 1 time in total.
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Sayton,
You can use a DFSORT job like this:
You can use a DFSORT job like this:
Code: Select all
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//SORTOUT DD DSN=... output file (VB)
//SYSIN DD *
OPTION COPY
OUTFIL FILES=OUT,
IFTHEN=(WHEN=(5,5,CH,EQ,C'3B300',AND,
13,4,CH,EQ,C'04'),
OVERLAY=(30:C'01500',
57:C'0225',
65:C'0120')),
IFTHEN=(WHEN=(5,5,CH,EQ,C'3B900'),
OVERLAY=(21:7C'0'))
/*
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
Alissa & Frank....
Thanks for your efforts, but the problem was a lot simpler than I thought it was.
The real problem is that I'm an idiot!
The clue is in the parameter
WHEN=(05,5,CH,EQ,C'3B300',AND,
13,4,CH,EQ,C'04'),
which should have read
WHEN=(05,5,CH,EQ,C'3B300',AND,
13,2,CH,EQ,C'04'),
With that correction made, several of my aborted attempts started working!
Another of the "I'll just re-use this code" perils!
Nonetheless, thanks to all you guys out there who took the issue seriously, and offered assistance.
Thanks for your efforts, but the problem was a lot simpler than I thought it was.
The real problem is that I'm an idiot!
The clue is in the parameter
WHEN=(05,5,CH,EQ,C'3B300',AND,
13,4,CH,EQ,C'04'),
which should have read
WHEN=(05,5,CH,EQ,C'3B300',AND,
13,2,CH,EQ,C'04'),
With that correction made, several of my aborted attempts started working!
Another of the "I'll just re-use this code" perils!
Nonetheless, thanks to all you guys out there who took the issue seriously, and offered assistance.
The only stupid question is the one you DON'T ask!
- Frank Yaeger
- Moderator
- Posts: 812
- Joined: Sat Feb 18, 2006 5:45 am
- Location: San Jose, CA
- Contact:
Oh, I thought you wanted to compare against '04 ' with two trailing blanks which is what your original statement would have done.
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