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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1269 views
  • 0 likes
  • 3 in conversation