Re: File conversion
- From: Colin Campbell <cmcampb@xxxxxxxxxxxx>
- Date: Mon, 25 Apr 2005 22:30:06 -0700
Robert Jones wrote:
MOVE CORR is not hard to debug, in my opinion. I would suggest just compiling with the XREF option (each elementary field will have an entry in the XREF) and generating an Assembler expansion of the code for that verb.As this newsgroup isn't yet subscribed to by computers instead of people, a simple "please" would seem to be in order for common courtesy.
To answer your question
this seems to be a good case for MOVE CORRESPONDING, many organisations don't like this construct as a general rule, but this situation appears to be an obvious candidate. You will have to first check that all fields fully correspond in respect of data names and convertibility of formats, I haven't done a detailed check on the two record layouts myself.
It would also be a good idea to initialise the destination record by moving spaces to it, so the filler always contains spaces, alternately, rename the filler such that the same name is used in both layouts.
A disadvantage of using MOVE CORRESPONDING is that it is harder to debug.
Also, programmers making future amendments to the program may not make the appropriate changes to both record layouts, but then even if they used lots of independent MOVEs, they still might not do that correctly either.
Regards
Robert
You would then have to do a detailed comparison of what fields the compiler found to correspond. Once you have done that, and proven that your COPY members are defined correctly, you're home free! Of course, future changes to the COPY members could blow you right out of the water....
Writing a series of MOVEs is, as you say, both tedious and error prone. The same sort of detailed comparison will be required, to ensure that no MOVEs were left out, and that the from and to fields in each MOVE were named correctly. And, future changes to the COPY members could blow you right out of the water....
So why not use the power of the compiler (MOVE CORR) to do part of your coding for you? It has always seemed like a good idea to me.
.
- Follow-Ups:
- Re: File conversion
- From: jce
- Re: File conversion
- References:
- File conversion
- From: gcotterl
- Re: File conversion
- From: Robert Jones
- File conversion
- Prev by Date: Re: Performance problem with a VSAM files
- Next by Date: Re: OT - "lie" vs "error"
- Previous by thread: Re: File conversion
- Next by thread: Re: File conversion
- Index(es):
Relevant Pages
|