06-19-2013 09:00 AM
I need to change a variable name across all programs in a project. I'm going to go ahead and do a CTRL+H find and replace manually, and furthermore, replace it with a macro parameter that I'll add to the macros in which this variable resides (I know that it could have been done in the first place, but it wasn't).
I don't expect there's a better way but I just wanted to ask. I became familiar with Chris Hemedinger's article about searching SAS projects recently, but I do not believe that would allow for replacing text within programs.
Any suggestions for my future edification?
06-20-2013 09:39 AM
No quick, easy answer. Technically, you could do it in SAS, but it would be a lot of work. Depends on how many files....
Unless you already know how to use perl, 3 might be a challenge.
If you are familiar with Unix scripting, you could download the "GNU on Windows" tools and write the script as a batch file.
06-20-2013 09:50 AM
I have done this (not for EG, but just regular SAS, as I don't use EG)
Basically, Doc has the answer, but for his step 3, I just used ordinary SAS code, not Perl regular expressions. The FIND command in SAS is useful for finding lines that have the desired target string, and the SUBSTR command allows you to pull apart the text and make replacements.
06-20-2013 09:55 AM
Doc & Paige, thanks for those suggestions. The drawback is that (and I didn't make this explicit before) these programs may not be actual physical files-- in an EG project, you can have a program that just lives in the project rather than having a shortcut to a program that lives outside of the project.
06-20-2013 10:03 AM
Unfortunately, there is not a find-and-replace tool that operates across all objects in a project, let alone across several projects.
The EGP Search tool can help you identify the items that you might need to change, but you'll have to open each project and change each manually.
10-20-2016 05:22 AM