I want to add below requirement to the above. Pls help.
When the keys match I am reformatting the output file. In the file F1 I have a field at position 12 of length 4. For only specific values of this fleld, I want to append the fields from F2 in reformatting otherwise put spaces from 50 till 91.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Include the match-marker (as the last field), a question-mark (?), in the REFORMAT statement.
When that position has a value of "B", you have a match. You can use IFTHEN=(WHEN=(logicalexpression, where your logicalexpression contains AND and OR (if necessary) and squish your fields with OVERLAY=(50:41X) or whatever the exact thing is. use IFOUTLEN=91 to get rid of the match-marker on the output.
With OVERLAY what I mean is to fill spaces in output file from 50 till 42 whereever F1 has 'A' or 'B' at 12th position. And would also like to know what happens for other values at position 12.
I have used below code and my intention is to overlay with spaces in output file starting at 50th position and lenght of 48 whereever there is no 'A' or 'B' at 12th position in file F1 for all matched records. But its overlaying every record with spaces. Pls help.