View previous topic :: View next topic
|
Author |
Message |
rockish
Active User
Joined: 05 Jun 2009 Posts: 185 Location: Planet Earth
|
|
|
|
If you dont know the algorithm by which you are going to separate fields from each other, not just COBOL, nothing can help u..
All that Enrico tries to ask from you is, what seperates the fields ? When do you say that a field has ended and the next field has started ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
any reason that You do not want to answer that simple question
what is the logic to separate fields ?
I proposed one, ( word concept ) is it the right approach ? |
|
Back to top |
|
|
MARINA JOSEPH
New User
Joined: 11 Jun 2009 Posts: 61 Location: chennai
|
|
|
|
The delimiter is a comma, and i need to know how to retrieve the position of the mismatching byte.
That byte at the varying positon needs to be compared with the copybook positon in order to retrieve the exact field. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have to agree that, this is beyond my capability as of now. |
Yours, and everyone else. . . Unless they are very lucky (or happen to be psychic).
Quote: |
Key fields will be same in both the files. (For the time being forget about inserted and deleted records). |
No. The complete requirement including proper sample input and output should be posted. Why should people waste time providing multiple solutions for scope creep. Often, the additional requirement definition causes the original working solution to need changes (or be completely re-written) - wasting more time.
The sample data should be posted using the "Code" tag to preserve alignment and improve readability. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
The delimiter is a comma, and i need to know how to retrieve the position of the mismatching byte.
That byte at the varying positon needs to be compared with the copybook positon in order to retrieve the exact field. |
why suddenly a change inn the whole environment description...
You start showing blank delimited <fields>, now You go dow a completely different path of utterly darkness
do You realize that You made people lose time on your unwillingness to post a proper description of Your problem/requirement from the beginning
and You did not even care to answer the qustions You were asked..
since You are asking for help, You should not post what You think,
but what people trying to help You want to know, which means reply to thyr question |
|
Back to top |
|
|
MARINA JOSEPH
New User
Joined: 11 Jun 2009 Posts: 61 Location: chennai
|
|
|
|
Hi,
I am sorry about wasting peoples time.
I assumed the delimiters which actually created the confusion.
The requirement was not very clear.
I will avoid such instances in future.
Apologies once again. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Apologies once again. |
Not to worry - sometimes it takes a bit of a struggle to get clarification Being clear will greatly reduce the time taken to deal with a requirement.
Do you have a working solution? If you used cobol, you could unstring bots sets of data into indivudual fields and compare these individual fields to get what you want. . . |
|
Back to top |
|
|
donevin
New User
Joined: 07 Jun 2005 Posts: 70 Location: South Africa
|
|
|
|
I have to commend all and sunder with the patience you demonstrated throughout this post. I read the thread with increasing disbelief and I have to say I am really impressed by how you kept your cool.
In any case Marina, I think I did a similar thing in the past as what you are trying to do here, if my deduction is correct that you want to display the key of mismatching records as well as the field name(s) that doesn't match for that key. I used a cobol program with a little help from INSYNC, which I accept not all installations might have, to solve this problem. The first issue I had was that my copybook had more than 900 fields in it and I was NOT looking forward to typing 900 plus field names in the COBOL program.
The steps I followed were.
(1). INSYNC has got the functionality to create output for you from a copybook in the format : Fieldnames, Fieldlength, Fieldoffset. I read this output into a Working-Storage Table and sorted it by Fieldoffset.
(2). I then compared the two input records from the two input files byte by byte through a perform loop and if/when I got a mismatch, the counter i used to step through the records I then also used to do a search in the WS Table, I then extracted the field name from the WS-Table.
(3). I then wrote the keys of both records as well as the field names and the field values to output.
This saved me a lot of time and is easily adaptable to accommodate other files and in fact has been requested by other development teams besides my own in our company. |
|
Back to top |
|
|
|