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...

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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