Page 1 of 1

Need DFSORT Solution, If Possible

PostPosted: Wed Nov 21, 2007 3:24 am
by BSvihraJr
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

Re: Need DFSORT Solution, If Possible

PostPosted: Wed Nov 21, 2007 3:49 am
by Frank Yaeger
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:

//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)
/*