Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's not clear from your description what you're trying to do.
OVERLAY overlays just the fields you tell it to, but it copies the rest of the record as is. Your statement keeps the input record as is, but overlays output positions 271-279 with input positions 3-11, and overlays output positions 286-288 with input positions 52-54.
If you just want to include two fields from the input record to the output record, you would use BUILD, not OVERLAY.
I can't help you further unless you explain what you're actually trying to do. Do you want to copy just two fields from input to output or do something else? What is the starting position and length of the input fields? What do you want in the output record and where?
I want to overlay the 2 fields 3-11,52-54(new A/c num and code) from input file to fields 271-279,286-288(old A/C num and code) in output and the rest of the fields in output should remain as is.
I am just replacing the old A/C num and code in output file with new A/c num and code in input file.
My concern here is the code below does'nt overlay two fields instead it copies all i/p fields to o/p.
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
Hello,
Is there some reason you have not posted some sample input data and the output you want from the sample data? These do not need to be full-length records - just enough to demonstrate the requirement.
Also mention the recfm and lrecl of the files along with any "processing rules".
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
Quote:
I want to overlay the 2 fields 3-11,52-54(new A/c num and code) from input file to fields 271-279,286-288(old A/C num and code) in output and the rest of the fields in output should remain as is.
Is there any chance that you are processing 2 files? File-1 containing data in positions 3-11 and 52-54 that you want to use to overlay positions 271-279 and 286-288 in File-2?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Pavan,
Assuming you have two input files and want to create an output file by matching the records one-by-one, you would use JOINKEYS, not OVERLAY.
Here's an example of a JOINKEYS job with the input you showed and assuming your input file has RECFM=FB and LRECL=80. You can adapt it as necessary.