Conditionally hanging the length of variable length records.

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
Sayton
Member
Posts: 10
Joined: Tue May 05, 2009 6:52 pm

Conditionally hanging the length of variable length records.

Post by Sayton » Thu May 07, 2009 6:31 pm

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?
The only stupid question is the one you DON'T ask!

Alissa Margulies
Member
Posts: 25
Joined: Tue Apr 28, 2009 10:53 pm
Location: USA
Contact:

Post by Alissa Margulies » Thu May 07, 2009 8:07 pm

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.
Last edited by Alissa Margulies on Thu May 07, 2009 8:51 pm, edited 1 time in total.
Alissa Margulies
SyncSort Mainframe Product Services
zos_tech@syncsort.com
201-930-8260

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Thu May 07, 2009 8:37 pm

Sayton,

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

Sayton
Member
Posts: 10
Joined: Tue May 05, 2009 6:52 pm

Post by Sayton » Fri May 08, 2009 2:24 pm

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'),
:oops:
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!

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Fri May 08, 2009 8:09 pm

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

Post Reply

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



Other References
Mainframe Tools and others