just use TRANWRD().
data have;
input oldname $200;
cards;
blah_blah_person.pdf
;
data want;
set have;
length newname $200;
newname=tranwrd(oldname,'.pdf ','_2023.pdf');
run;
Now that you have both names you can use them to generate RENAME commands.
@mollywilk wrote:
Would the rename all of the files in the folder at once?
To rename a series of files you need to:
1) Get the names of the files.
2) Generate the new name you want it to have.
3) Issue a rename command for each file.
What part of that are you having trouble with?
What have you tried?
How can you get a list of the files? (Hint that question has been asked hundreds of times on this site).
I showed you how to generate a new name.
How can you rename one file? What command can you use? What would you do if it was just one file you had to rename?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.