View previous topic :: View next topic
|
Author |
Message |
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hi,
I am having two input file of LRECL - 80 and they are PS.
File-1
------------------------------
Col: 1-15 - Sub ID
Col: 16-8 - Start - Date
File-2
------------------------------
Col: 1-15 - Sub ID
Col: 16-8 - End - Date
But in the output, I want like -
File-3
------------------------------
Col: 1-15 - Sub ID
Col: 16-8 - Start - Date
Col: 25-8 - End Date
But here I want to mention that here I am not having any master file or so. In detail, a subscriber with no start date (so not present in File-1) but with end date (so present in File-2) should come into the output file-File-3. And also true for vice-versa! |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
amitava
1. Assuming that the field Sub ID is the KEY field, are there any duplicate records within FILE-1 and FILE-2?
2.
Quote: |
a subscriber with no start date (so not present in File-1) but with end date (so present in File-2) should come into the output file-File-3. |
So you want all the matching records from FILE-1 and FILE-2 and also the records that are present in FILE-2 only. Am i right? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Amitava,
Post some examples. And also how do you want this? Using util or prog. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
krisprems, in regard to ur Qs -
Quote: |
1. Assuming that the field Sub ID is the KEY field, are there any duplicate records within FILE-1 and FILE-2? |
- No no such duplicate Sub-ID is there!
Quote: |
So you want all the matching records from FILE-1 and FILE-2 and also the records that are present in FILE-2 only. |
- I tried to mean that matching records from File-1 and File-2, unique records from File-2 and unique records from File-1.
And murmohk1,
Quote: |
Post some examples. And also how do you want this? Using util or prog. |
- I am giving some example here -
File-1
------
Code: |
Sub-ID Start Dt
123232233 20071213
123232231 20071211
123232234 20071212
|
File-2
-------
Code: |
Sub-ID End Dt
123232230 20071214
123232231 20071215
123232232 20071216
123232235 20071218 |
File-3
-------
Code: |
Sub-ID Start Dt End Dt
123232230 20071214
123232231 20071211 20071215
123232232 20071216
123232233 20071213
123232234 20071212
123232235 20071218 |
Now obviously murmohk1, I am looking for some utility! If it is possible by utility, who wants to go for a program? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
amitava,
Quote: |
- I tried to mean that matching records from File-1 and File-2, unique records from File-2 and unique records from File-1. |
For matching records you can use SPLICE parameter of ICETOOL to get the reqd output.
Quote: |
unique records from File-2 and unique records from File-1. |
First remove the duplicates from both the input files and then reformat the first file as
Code: |
sub-id start-date spaces(end-date)
|
second file as
Code: |
sub-id spaces(start-date) end-date |
The output of SPLICE and the reformat outputs should be put in a single file. |
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
If possible, can u pls provide me some sample JCL? It will be helpful for me ... |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Here is the sample ICETOOL JCL. Change as per your requirment. This is a variation of the "Join fields from two files on a key" Smart DFSORT Trick at:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Also look at z/OS V1R8.0-V1R9.0 DFSORT Getting Started and other DFSORT materials here
Code: |
//*******************************************************
//STEP001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
123232233 20071213
123232231 20071211
123232234 20071212
/*
//IN2 DD *
123232230 20071214
123232231 20071215
123232232 20071216
----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
123232235 20071218
/*
//TMP1 DD DSN=&&TEMP1,DISP=(MOD,PASS),SPACE=(TRK,(5,5)),UNIT=SYSDA
//BOTH DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(TMP1)
COPY FROM(IN2) TO(TMP1) USING(NKK1)
SPLICE FROM(TMP1) TO(BOTH) ON(1,9,CH) WITH(21,8) -
KEEPNODUPS WITHALL
/*
//NKK1CNTL DD *
OUTREC BUILD=(1,10,21:12,8,80:X)
/*
|
|
|
Back to top |
|
|
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 186 Location: India
|
|
|
|
Hey krisprems! Its working man! Thanks a lot ... And obviously thanks for sharing the link. |
|
Back to top |
|
|
|