BookmarkSubscribeRSS Feed
ThomasFrederiksen
SAS Employee

Actually this is a tip I got from the great SAS developers at Odense Kommune.

It’s a tip about searching for text strings in files and folders.

E.g. you want to find all files where you have used a ’PROC TRANSPOSE’. Or you want to find all files where a specific environment variable is used. That was the case when I got this tip.

I bet this could be solved in many ways and by many tools.

 

Windows

On Windows you can download (for free) a tool called ”Agent Ransack” https://www.mythicsoft.com/agentransack/

 

Just type the text string you want to search for, choose which folder to search and submit.

In this example there are two files containing the string SAS_ROOT_FOLDER.

ransack.PNG

 

 

Unix/Linux

If you are on a Linux you can use a command like this one:

grep -irw --include=\*.sas "SAS_ROOT_FOLDER" /thesasfolder/programs

 

This command will search all .sas files in the folder ’/thesasfolder/programs’ and subfolders for the text string ’SAS_ROOT_FOLDER’.

 

Merry Christmas

1 REPLY 1
andypandy_swe
Obsidian | Level 7
Notepad++ also has a "search in files" option...

SAS Innovate 2025: Call for Content

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!

Submit your idea!

Discussion stats
  • 1 reply
  • 1198 views
  • 9 likes
  • 2 in conversation