|
View previous topic :: View next topic
|
| Author |
Message |
madishpa
New User
Joined: 18 May 2007 Posts: 28 Location: Hyderabad
|
|
|
|
Hi,
Could you please help merge 2 files horizontally based on the key.
Following is the example
File1 : Key is first 18 numbers(No duplicates and LRECL is 55 and FB) and file is sorted
File2 : Key is first 18 numbers(Duplicates present and LRECL is 150 and FB) and file is sorted
If records present on both files, merge horizontally as FILE2||FILE1
If records present in file2 only,write the entire contents of file2 only.
If records present in file1 only,nothing to be written to output
Example:
File1:(Key first 18 numbers)
111111111111111111...........(55 lrecl)
222222222222222222...........(55 lrecl)
333333333333333333...........(55 lrecl)
444444444444444444...........(55 lrecl)
666666666666666666...........(55 lrecl)
File2:(Key first 18 numbers)
111111111111111111...........(150 lrecl)
222222222222222222...........(150 lrecl)
222222222222222222...........(150 lrecl)
222222222222222222...........(150 lrecl)
222222222222222222...........(150 lrecl)
333333333333333333...........(150 lrecl)
555555555555555555...........(150 lrecl)
666666666666666666...........(150 lrecl)
Output:
111111111111111111...........(150 lrecl)111111111111111111...........(55 lrecl)
222222222222222222...........(150 lrecl)222222222222222222...........(55 lrecl)
222222222222222222...........(150 lrecl)222222222222222222...........(55 lrecl)
222222222222222222...........(150 lrecl)222222222222222222...........(55 lrecl)
222222222222222222...........(150 lrecl)222222222222222222...........(55 lrecl)
333333333333333333...........(150 lrecl)333333333333333333...........(55 lrecl)
555555555555555555...........(150 lrecl)
666666666666666666...........(150 lrecl)666666666666666666...........(55 lrecl)
Please advise at the earliest.
Thanks in advance.
Regards,
Madishpa. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
madishpa,
The following DFSORT JCL will give you the desired results.
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//FB055 DD DSN=Your 55 byte input file,DISP=SHR
//FB150 DD DSN=Your 150 byte input file,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=FB055,FIELDS=(1,18,A),SORTED,NOSEQCK
JOINKEYS F2=FB150,FIELDS=(1,18,A),SORTED,NOSEQCK
JOIN UNPAIRED
REFORMAT FIELDS=(?,F2:1,150,F1:1,55)
OUTFIL OMIT=(1,1,ZD,EQ,1),BUILD=(2,205)
//* |
|
|
| Back to top |
|
 |
madishpa
New User
Joined: 18 May 2007 Posts: 28 Location: Hyderabad
|
|
|
|
Hi Kolusu,
Thank you so much.It has worked.
Could you please let me know, how to find a character in position 25 and replace it with a number. The record length in 223 and is FB.
Replace { with 0 at position 25.
Replace A with 1 at position 25.
Replace B with 2 at position 25.
Replace C with 3 at position 25.
Replace D with 4 at position 25.
Replace E with 5 at position 25.
Replace F with 6 at position 25.
Replace G with 7 at position 25.
Replace H with 8 at position 25.
Replace I with 9 at position 25.
Appreciate your help.
Thanks,
Madishpa. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| madishpa wrote: |
Hi Kolusu,
Thank you so much.It has worked.
Could you please let me know, how to find a character in position 25 and replace it with a number. The record length in 223 and is FB.
|
It sounds like you have sign overpunch Zoned decimal data and you want to see the readable format of them. Is that true? What would you do if the the 25th byte had }JKLMNOPQR which denotes negative numbers?
This is the representation of the ZD numbers . The number on top represents the sign over punch and the lower number represents the readable decimal number
| Code: |
{ABCDEFGHI}JKLMNOPQR
CCCCCCCCCCDDDDDDDDDD
01234567890123456789
|
Hex C0 thru C9 are positive numbers and D0 thru D9 are negative numbers. Try to understand your data before you decide to change them. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|