EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
Hi
this can be done by cobol program & sort utility
in cobol program
1. open 2 files
perform read-file until file-status = '10'
2. read the 1st file ,& get the data of ist record into the copy book
3.perform file2-read until ws-eor='y'
set 'n' to ws-eor( working storage of picx(1))
read the 2nd file
if regno of 1st file Not = reg-no of 2nd file
set 'y' to ws-eor
else
Nric1 of 1st file = nric of 2nd file or
Nric2 of 1st file = nric of 2nd file or
Nric3 of 1st file = nric of 2nd file or
Nric4 of 1st file = nric of 2nd file
if Satisfied populate the data to 3rd ile as of like this
1 123 aaaa xxxxxxx
cccc xxxxxxx
eeee xxxxxxx
ffff xxxxxxx
else populate
bbbb xxxxxxx
dddd xxxxxxx
4 close both the files
*************************************************************
But the logic has an issue , how should we handle the records of 2nd file
that ie
file 1
111 aaaa
222 bbbb
333 cccc
file2
111 aaaa ppppp
555 bbbb ttttttt
666 gggg ddddd
if the input of the files area like above, then we are not taking care of
file2 ( 555, 666 )
************************************************************
i am not sure how to do with sort, if i get to know i will post it
Thanks
prasad |
|