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: 7311 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.
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.