I have an ODS pdf that currently produces one file, and within the file are two pages per faculty member at our institution. I made a modification to the code so that there is one file per faculty member with the two needed pages. Is there a way that I can pass the faculty members name from the dataset to the filename? Currently, it is naming the successive files with (1), (2), (3), etc. however, I would like the file to have REPORTNAME_JDOE.PDF, REPORTNAME_DDUCK.PDF, etc. Any direction would be appreciated!
Sadly no.
I wish you could control the names, but you could with a macro/call execute.
Another option is to rename the files after the fact but I dislike doing that, because it assumes order though I suppose you could check that. There is a RENAME() function that will rename files via a data step.
This illustrates how to do it via macro:
https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md
@laura6728 wrote:
I have an ODS pdf that currently produces one file, and within the file are two pages per faculty member at our institution. I made a modification to the code so that there is one file per faculty member with the two needed pages. Is there a way that I can pass the faculty members name from the dataset to the filename? Currently, it is naming the successive files with (1), (2), (3), etc. however, I would like the file to have REPORTNAME_JDOE.PDF, REPORTNAME_DDUCK.PDF, etc. Any direction would be appreciated!
Sadly no.
I wish you could control the names, but you could with a macro/call execute.
Another option is to rename the files after the fact but I dislike doing that, because it assumes order though I suppose you could check that. There is a RENAME() function that will rename files via a data step.
This illustrates how to do it via macro:
https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md
@laura6728 wrote:
I have an ODS pdf that currently produces one file, and within the file are two pages per faculty member at our institution. I made a modification to the code so that there is one file per faculty member with the two needed pages. Is there a way that I can pass the faculty members name from the dataset to the filename? Currently, it is naming the successive files with (1), (2), (3), etc. however, I would like the file to have REPORTNAME_JDOE.PDF, REPORTNAME_DDUCK.PDF, etc. Any direction would be appreciated!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.