BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is it possible to rename a file when attaching it to an email?

I am sending the file from a mainframe dataset.

I currently using code like so:

ATTACH=("G741270.DATASET.NAME" EXT='CSV');

I would like to rename the file to something like "latest data file.csv"

is there a RENAME= option I could use?


thanks,
2 REPLIES 2
JackHamilton
Lapis Lazuli | Level 10
Use the NAME= and EXTENSION= options in the ATTCH= clause of the email filename to cause the attachment to be received with a different name.

See http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a002058232.htm
Cynthia_sas
Diamond | Level 26
Hi,
I have to admit that my mainframe days are fading into the past, but wasn't there a utility program called IEBCOPY or something that you could use? As I remember, spaces are not valid in mainframe dataset names, but it seems to me that you could use mainframe utilities to rename the file from:
G741270.DATASET.NAME to LATEST.DATA.FILE

Or even better, just use the name you want in your SAS program (if you are using SAS to create G741270.DATASET.NAME ). The only way that I can think of to do it with SAS is to issue an X command that issues a TSO command to do the rename OR an X command to invoke a CLIST, but if you're doing this in batch JCL, then you might need a different approach.

This is probably a question that is best answered by Tech Support, since they are better in tune with how to do things on the mainframe these days.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1817 views
  • 0 likes
  • 3 in conversation