When you execute your macro with the increased-diagnostics OPTIONS statement suggested in your other post, it will become clear that the macro invocation is going to generate a separate DATA step execution -- and even if it works correctly, that will in turn generate one EMAIL per attachment -- but your intended EMAIL BODY will not get generated as you have coded it. Instead, possibly your %DO / %END loop is more appropriate for generating the data-string that encompasses the ATTACH=(.....) and no more. Again, suggest/recommend serious self-initiated desk-checking which will help reveal what is actually happening here -- multiple DATA step executions, one per item. Also, you have too many %END; statements and I believe that your %PUT is intended to be a %LET, instead, as was mentioned. Scott Barry SBBWorks, Inc.
... View more