View previous topic :: View next topic
|
Author |
Message |
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
Hi,
I have an input fiel from diffrent dates .
File 1: Day 1
Code: |
AAA RP
BBB SE
CCC XY
DDD RP
TTT RP |
File 2: Day 2
Code: |
FFF RP
CCC RP
MMM RP
QQQ SE |
I need to combine all teh files and remove the records that are having 'RP' in 4th byte. I can do this uisng Omit in sort. But i would also need to remove the records that was earlier with some other status like SE,XY but in future days have changed to 'RP. Form teh above files i need to remvoe the record "CCC XY" as well. Since on Day 1 it has "xy" but on days two it had "RP" so i need to remove those type of records as well. How can i achieve this.
Code'd |
|
Back to top |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
Code: |
File 1:
----+----1----+----2--
1111111111111111 PR
2222222222222222 RP
3333333333333333 ST
1243423433453453 PR
File 2:
----+----1----+----2--
1145353453454354 PR
2666666666666666 RP
3333333333333333 RP |
this is the sample of how it looks. This is how my input fiels will be.and each day i will get one file. I will need to remvoe all the records from all teh files having the statsu as "RP" i will do this by omit cond eq "RP" but my question i should also be able to delte the reocrd that has record with status say "ST" or "PR" in day one but when on second or any other day if it is present in the file with Status "RP" then i should exclude them as well.
I now have idea to split them into two file one with recrods having "RP" status and file 2 with "ST","PR" and others. I should compare file 2 take the reocrd and see if it is in file 1 then i should drop them elase i shaoudl write them to output. but how to achieve that. |
|
Back to top |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
The output file should be
File 1:
Code: |
----+----1----+----2--
1111111111111111 PR
1243423433453453 PR
1145353453454354 PR |
Code'd - I know you know how to do it |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
vidyaa,
Please answer the following questions.
1. What is the LRECL and RECFM of File1?
2. What is the LRECL and RECFM of File2?
3. What is the position and format of the key to be matched in file1?
4. What is the position and format of the key to be matched in file2?
5. Where is the String 'RP' found in file1?
6. Where is the String 'RP' found in file2?
7. Run the sample job listed in this topic and show us the sysout which helps us to determine the level of DFSORT you running
ibmmainframes.com/viewtopic.php?t=33389 |
|
Back to top |
|
|
vidyaa
New User
Joined: 02 May 2008 Posts: 77 Location: chennai
|
|
|
|
It is the same file of length 400....Except that file 1 has only RP and other fiel ahs all other statsu other than RP.and key is the first 16 bytes in both the files...
Th statsu RP,PR,ST are all in the postion 20 to 2 bytes.... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So, to put it another way, for every record on FILE 1, which exclusively contains RPs, you want to remove all the keys from FILE 2 giving you FILE 3 with the remainder?
If this is so, it is very easy.
Use JOINKEYS, with UNPAIRED,F2,ONLY. Have a look in the manuals, look for examples of JOINKEYS here. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
vidyaa wrote: |
It is the same file of length 400....Except that file 1 has only RP and other fiel ahs all other statsu other than RP.and key is the first 16 bytes in both the files...
Th statsu RP,PR,ST are all in the postion 20 to 2 bytes.... |
Your earlier sample data shows that file1 has other data too apart from RP records. You need to be consistent with your requirements. |
|
Back to top |
|
|
|