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
Need DFSORT Solution, If Possible
- 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
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:
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
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
-
- 5
- 3302
-
by knv09
View the latest post
Tue Jul 21, 2020 7:13 pm
-
- 0
- 5109
-
by mehi1353
View the latest post
Wed May 11, 2022 2:04 pm
-
-
How to use ASCII condition in DFSORT
by Prasanna G » Tue Sep 20, 2022 10:15 pm » in DFSORT/ICETOOL/ICEGENER - 10
- 2606
-
by prino
View the latest post
Thu Sep 22, 2022 12:53 am
-
-
- 2
- 1091
-
by sergeyken
View the latest post
Fri Jul 14, 2023 7:13 pm