I have a requirement like this:
I have two files of length 80.
First file conatins data 09-04-07
second file contains data 08-11-05
As an output I want the second file as 08-11-0509-04-07
I tried using DFSORT with overlay parameter
***********************************************************************************************
//SORTOUT DD DSN=FILE1,DISP=SHR
//SORTIN DD DSN=FILE2,
// DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(9:1,8)
END
//*
***************************************************************************************************
But the output I am gettin is 09-04-0709-04-07
Can anyone tell me how to arrive at the correct output using dfsort? It is urgent
Thanks in advance
Overlay: how to arrive at the correct output using dfsort
-
- Posts: 5
- Joined: Thu Sep 06, 2007 3:40 pm
- Skillset: COBOL, JCL, CICS, EZtrieve
- Referer: friends
-
- Posts: 5
- Joined: Thu Sep 06, 2007 3:40 pm
- Skillset: COBOL, JCL, CICS, EZtrieve
- Referer: friends
Re: overlay
Sorry!!! in my previous post sortin , sortout got swapped..
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,
// DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(9:1,8)
END
//*
//SORTIN DD DSN=FILE1,DISP=SHR
//SORTOUT DD DSN=FILE2,
// DISP=SHR
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(9:1,8)
END
//*
-
- Posts: 81
- Joined: Sat Jun 09, 2007 4:24 am
- Skillset: Some?
- Referer: mcmillan
- Location: Tucson AZ
Re: overlay
A straight copy is totally destroying your FILE1.......
The only thing that's going out to FILE1 is the contents of FILE2....
Is there some key where you are matching? Or is FILE1 an identical record for record copy of FILE2 except for the date?

Is there some key where you are matching? Or is FILE1 an identical record for record copy of FILE2 except for the date?
-
- Posts: 5
- Joined: Thu Sep 06, 2007 3:40 pm
- Skillset: COBOL, JCL, CICS, EZtrieve
- Referer: friends
Re: overlay
file1 is an identical layout of file2. there is no such key in any of the file
Re: Overlay: how to arrive at the correct output using dfsort
Well, you will have to use some sort of (splice?) logic to get both records side-by-side in the sort in order to put some of the info from the one into the other.....
-
- Posts: 5
- Joined: Thu Sep 06, 2007 3:40 pm
- Skillset: COBOL, JCL, CICS, EZtrieve
- Referer: friends
Re: Overlay: how to arrive at the correct output using dfsort
i want to achive it using sort rather than ICETOOL..........
Re: Overlay: how to arrive at the correct output using dfsort
No major difference, they are both part of the IBM Sort package.....Indranil28 wrote:i want to achive it using sort rather than ICETOOL..........
Why one over the other? Some "standard" or "requirement"? Or just practicing and learning new tricks?
"Create files with matching and non-matching records" in Smart DFSORT Tricks could be used, pick only the matching (since there is no non-matching) and use a sequence number on input to create a siimple key if needed......
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Overlay: how to arrive at the correct output using dfsort
indranil28,
Here's a DFSORT job that will do what you asked for:
Here's a DFSORT job that will do what you asked for:
Code: Select all
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... file2
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT symbol for file2 value as:
* F2,'08-11-05'
* Note: 08-11-05 is the first 8 bytes from file2 ... it could be any value.
INREC BUILD=(C'F2,''',1,8,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... file1
//SORTOUT DD DSN=... file2
//SYSIN DD *
OPTION COPY
* Use F2 symbol to build output record as:
* 08-11-0509-04-07
* Note: 08-11-05 is the first 8 bytes from file2 and 09-04-07 is the
* first 8 bytes from file1 ... these could be any values.
INREC BUILD=(F2,1,8,80:X)
/*
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
-
- Posts: 81
- Joined: Sat Jun 09, 2007 4:24 am
- Skillset: Some?
- Referer: mcmillan
- Location: Tucson AZ
Re: Overlay: how to arrive at the correct output using dfsort
Dang Frank, If I'd understood that it was a constant, I wouldn't been so far off base.... 

- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Overlay: how to arrive at the correct output using dfsort
I'm not sure what you mean by a "constant". I'm using the first 8 bytes from the first record in each file. Those values can change and the job would still work. I edited my post to make that clear.
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
-
-
How to overlay a constant value in PD format
by Shambu » Mon Jun 28, 2021 11:56 pm » in Syncsort/Synctool - 1
- 3498
-
by sergeyken
View the latest post
Tue Jun 29, 2021 1:18 am
-
-
- 5
- 3288
-
by knv09
View the latest post
Tue Jul 21, 2020 7:13 pm
-
- 3
- 2777
-
by willy jensen
View the latest post
Tue Jun 29, 2021 1:36 pm
-
- 0
- 5091
-
by mehi1353
View the latest post
Wed May 11, 2022 2:04 pm
-
- 11
- 3679
-
by willy jensen
View the latest post
Thu Oct 15, 2020 1:25 am