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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

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