I am sending an e-mail with attachment txt file which is created in the above DATA step of the mainframe SAS program. While in first time run, the sas program giving error for email as ERROR: Error opening attachment file TSA.DEVL.RM81251.T0457.DEC07. And also i am recieving the empty file through mail. when i tried in 2nd time it runs fine. Please help to resolve this problem.
I expect you used a FILENAME statement to define the attachment file outside of the data step that creates it. You may need to clear the FILEREF first to force the data to be flushed to the file, then reissue the FILENAME statement again to "open" the file for the attachment.