look 3rd record in positions 50 to 57 in expected output file.
If WITH field in overlay record is spaces, then WITH field from base record is written into output file. I want WITH field from overlay record to be written.
I want all the fields from overlay records (DEVF1 records) except ON fields
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You need to do a better job of explaining what you want to do.
When do you want a field from the base record and when do you want a field from the overlay record. What about these cases:
1) field in base record and overlay record are nonblank
2) field in base record is blank and field in overlay record is nonblank
3) field in base record is nonblank and field in overlay record is blank
Which cases apply to which fields? Is it just the field in 50-57 that you want to handle in a special way or all of the WITH fields?
Please show a better example of input and expected output with all of the possible cases you want to handle. Explain the rules for getting from input to output.
Joined: 12 Feb 2009 Posts: 33 Location: Chennai, India
Hi Frank,
I want only the fields from Overlay record irrespective of blanks or nonblanks in Base record as well as Overlay record.
This applies to all the WITH fields except ON fields.
Below is the sample input and expexted output.
Code:
Input file
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
PROD1 FIGARO FIG0 PPS745 COBOLFIG P COBOLACD 01 08
PROD1 FIGARO FIG0 PPS746 COBOLFIG P COBOLACD G974650 01 05
DEVF1 FIGARO FIG1 PSS745 COBOLFIG E COBOLOCD G974606 01 04
DEVF1 FIGARO FIG1 PSS746 COBOLFIG E COBOLOCD 01 02
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
want only the fields from Overlay record irrespective of blanks or nonblanks in Base record as well as Overlay record.
This applies to all the WITH fields except ON fields.
But in your output example you show 61-62 containing the field from the base record rather than from the overlay record. Was this a mistake? Would you really want blanks in 61-62 (as in the overlay record)? If not, what is the rule for that?
Also, for ON(19,10,CH), you have PPS fields in one case and PSS fields in the other case, so they won't match.
So I'm not sure what you really want, but try removing WITHANY and see if that does it. If not, explain more carefully what you want to do with an example that makes sense.