Overlay: how to arrive at the correct output using dfsort



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Overlay: how to arrive at the correct output using dfsort

Postby Indranil28 » Thu Sep 06, 2007 3:56 pm

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
Indranil28
 
Posts: 5
Joined: Thu Sep 06, 2007 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: overlay

Postby Indranil28 » Thu Sep 06, 2007 4:00 pm

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
//*
Indranil28
 
Posts: 5
Joined: Thu Sep 06, 2007 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: overlay

Postby William Thompson » Thu Sep 06, 2007 4:32 pm

A straight copy is totally destroying your FILE1....... :o 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?
William Thompson
 
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Location: Tucson AZ
Has thanked: 0 time
Been thanked: 1 time

Re: overlay

Postby Indranil28 » Thu Sep 06, 2007 4:37 pm

file1 is an identical layout of file2. there is no such key in any of the file
Indranil28
 
Posts: 5
Joined: Thu Sep 06, 2007 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Overlay: how to arrive at the correct output using dfsort

Postby CICS Guy » Thu Sep 06, 2007 5:49 pm

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.....
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Overlay: how to arrive at the correct output using dfsort

Postby Indranil28 » Thu Sep 06, 2007 7:19 pm

i want to achive it using sort rather than ICETOOL..........
Indranil28
 
Posts: 5
Joined: Thu Sep 06, 2007 3:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Overlay: how to arrive at the correct output using dfsort

Postby CICS Guy » Thu Sep 06, 2007 7:59 pm

Indranil28 wrote:i want to achive it using sort rather than ICETOOL..........
No major difference, they are both part of the IBM Sort package.....
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......
CICS Guy
 
Posts: 246
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Overlay: how to arrive at the correct output using dfsort

Postby Frank Yaeger » Fri Sep 07, 2007 2:01 am

indranil28,

Here's a DFSORT job that will do what you asked for:

//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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Overlay: how to arrive at the correct output using dfsort

Postby William Thompson » Fri Sep 07, 2007 2:09 am

Dang Frank, If I'd understood that it was a constant, I wouldn't been so far off base.... :oops:
William Thompson
 
Posts: 81
Joined: Sat Jun 09, 2007 4:24 am
Location: Tucson AZ
Has thanked: 0 time
Been thanked: 1 time

Re: Overlay: how to arrive at the correct output using dfsort

Postby Frank Yaeger » Fri Sep 07, 2007 3:03 am

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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post