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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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