Need DFSORT Solution, If Possible

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER
BSvihraJr
Posts: 15
Joined: Wed Nov 21, 2007 2:40 am
Skillset: COBOL/JCL/DB2/DFSORT
Referer: Google

Need DFSORT Solution, If Possible

Postby BSvihraJr » Wed Nov 21, 2007 3:24 am

Any help is appreciated.

Requirements:

Two input files, as shown:

File 1:

HEADER 2007-11-20
PARENT1
CHILD1
CHILD1
PARENT3
CHILD3
TRAILER00000002

File 2:

HEADER 2007-11-20
PARENT2
CHILD2
TRAILER00000001

Desired Output:

HEADER 2007-11-20
PARENT1
CHILD1
CHILD1
PARENT3
CHILD3
PARENT2
CHILD2
TRAILER00000003

Explaination:

1. Throw the two files together; sort is not important, one on top of the other is fine (as shown by the numbering).
2. Need to keep only one header record with date.
3. New trailer with trailer count of the parent records only.
4. OVERLAY method is not an option as the record length is the maximum already (don't ask, that's what I have to work with). I think it's 32756.
5. Adding the two record lengths together is an option, if DFSORT can do that.
6. Prefer one step versus using two cards with DFSORT commands.

I have ICEMAN and ICETOOL on the system this will run.

TIA.

Blair

User avatar
Frank Yaeger
Global moderator
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Skillset: DFSORT, ICETOOL, ICEGENER
Referer: Search
Contact:

Re: Need DFSORT Solution, If Possible

Postby Frank Yaeger » Wed Nov 21, 2007 3:49 am

Not having any room to add anything to the end of the record kind of limits our options.

Here's a DFSORT/ICETOOL job that will do what you asked for within your constraints:

Code: Select all

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1 (FB/32756)
//       DD DSN=...  input file2 (FB/32756)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(1,6,CH,EQ,C'PARENT')

  OUTFIL REMOVECC,NODETAIL,
   BUILD=(80X),
   TRAILER1=('CT,''',COUNT=(M11,LENGTH=8),C'''')
/*
//S2    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//IN1 DD DSN=&&I1,DISP=(OLD,PASS)
//IN2 DD DSN=&&I2,DISP=(OLD,PASS)
//*** Use MOD data set for OUT
//OUT DD DISP=MOD,DSN=...  output file (FB/32756)
//TOOLIN DD *
COPY FROM(IN1) TO(OUT) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
/*
//CTL1CNTL DD *
  OMIT COND=(1,7,CH,EQ,C'TRAILER')
/*
//CTL2CNTL DD *
  OMIT COND=(1,6,CH,EQ,C'HEADER',OR,1,7,CH,EQ,C'TRAILER')
  OUTFIL FNAMES=OUT,REMOVECC,
   TRAILER1=('TRAILER',CT)
/*
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


  • Similar Topics
    Replies
    Views
    Last post