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
SAS Super FREQ
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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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