View previous topic :: View next topic |
Author |
Message |
tarandeep_singh Beginner
Joined: 07 Mar 2005 Posts: 6 Topics: 3
|
Posted: Mon Dec 10, 2007 4:46 am Post subject: Vertical Merge |
|
|
Here goes the requirement
Input File
//FILEA |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Mon Dec 10, 2007 5:47 am Post subject: |
|
|
tarandeep_singh,
You can also see the "Join fields from two files on a key" trick in the following link:
http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
tarandeep_singh Beginner
Joined: 07 Mar 2005 Posts: 6 Topics: 3
|
Posted: Mon Dec 10, 2007 6:11 am Post subject: |
|
|
Hi vivek,
The links given by you point to two input files.
I have data in one file only.
Do you mean i need to split it into 2 files and then use the Splice/Join to merge again.
I expect a better logic. |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Dec 10, 2007 11:11 am Post subject: |
|
|
Jaggu,
You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
11111 AAAAAAAA
11111 BBBBBBBB
22222 CCCCCCCC
33333 XXXXXXXXX
33333 YYYYYYYY
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SPLICE FROM(IN) TO(OUT) ON(1,5,CH) KEEPNODUPS -
WITHEACH WITH(21,10) USING(CTL1)
/*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,5))),
IFTHEN=(WHEN=(81,8,ZD,EQ,+2),OVERLAY=(21:11,10))
OUTFIL FNAMES=OUT,BUILD=(1,80)
/*
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
tarandeep_singh Beginner
Joined: 07 Mar 2005 Posts: 6 Topics: 3
|
Posted: Tue Dec 11, 2007 2:15 am Post subject: |
|
|
Thanks Frank,
Its working |
|
Back to top |
|
 |
|
|