BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DrSAS
Fluorite | Level 6

How do I search for a keyword in a.sas file using microsoft file explorer using windows 10?

 

Problem:  I need to find all SAS programs with a specific keyword in them.

 

So I am trying to search a SAS program (files with a .sas extension) using windows explorer in windows 10.  Windows file explorer can't find them.  This has been the case in many versions of windows for as long as I can remember.  The solution used to be to "Add a registry key" that made Microsoft play nice with SAS. 

Can software be added to the SAS install process to do this for all SAS users on the network?

1 ACCEPTED SOLUTION

Accepted Solutions
DrSAS
Fluorite | Level 6

Thanks for your effort but This is only similar to the solution but not the answer... 

 

When you use Windows Explorer to find files containing specific text, the results may not include files of all types. In fact, quite a few file types will be omitted. Microsoft created this situation deliberately, to avoid having you find "irrelevant" files and SAS was left out from this list. Updating the Windows Registry will rectify this and allow Windows to search the file types you need.

 

The Search function relies on an internal filter to find words; file types that don't have a defined HKEY_CLASSES_ROOT filter won't be searched. If you find that certain file types don't appear in the search results, you can try assigning the plain-text filter to those types.

 

To have Windows Explorer search files of a certain file extension in this case SAS:

 

  1. launch Regedit from the Start menu's Run dialog.
  2. navigate to the key HKEY_CLASSES_ROOT\.??? (where .??? is the extension you want searched).
    1. If you don't find a subkey named PersistentHandler, create one.
  3. double-click on the value "(Default)" for that subkey and set its data to {5e941d80-bf96-11cd-b579-08002b30bfeb}.

 

  • Administrator rights are needed to perform this.

View solution in original post

7 REPLIES 7
DrSAS
Fluorite | Level 6

Thanks for your effort but This is only similar to the solution but not the answer... 

 

When you use Windows Explorer to find files containing specific text, the results may not include files of all types. In fact, quite a few file types will be omitted. Microsoft created this situation deliberately, to avoid having you find "irrelevant" files and SAS was left out from this list. Updating the Windows Registry will rectify this and allow Windows to search the file types you need.

 

The Search function relies on an internal filter to find words; file types that don't have a defined HKEY_CLASSES_ROOT filter won't be searched. If you find that certain file types don't appear in the search results, you can try assigning the plain-text filter to those types.

 

To have Windows Explorer search files of a certain file extension in this case SAS:

 

  1. launch Regedit from the Start menu's Run dialog.
  2. navigate to the key HKEY_CLASSES_ROOT\.??? (where .??? is the extension you want searched).
    1. If you don't find a subkey named PersistentHandler, create one.
  3. double-click on the value "(Default)" for that subkey and set its data to {5e941d80-bf96-11cd-b579-08002b30bfeb}.

 

  • Administrator rights are needed to perform this.
DrSAS
Fluorite | Level 6

To use Windows File Explorer to find keywords in .sas files containing specific text, you have to modify the windows registry because the results may not include a search of all files. In fact, quite a few file types will be omitted. Microsoft created this situation deliberately, to avoid having you find "irrelevant" files and SAS was left out from this list. Updating the Windows Registry will rectify this and allow Windows to search the file types you need.

 

The Search in windows file explorer relies on an internal filter to find words; file types that don't have a defined HKEY_CLASSES_ROOT filter won't be searched. If you find that certain file types don't appear in the search results, you can try assigning the plain-text filter to those types.

 

To have Windows File Explorer search files of a certain file extension in this case SAS:

 

  1. launch Regedit from the Start menu's Run dialog.
  2. navigate to the key HKEY_CLASSES_ROOT\.SAS .
    1. If you don't find a subkey named PersistentHandler, create one.
  3. double-click on the value "(Default)" for that subkey and set its data to {5e941d80-bf96-11cd-b579-08002b30bfeb}.

 

Administrator rights are needed to perform this.

ballardw
Super User

Don't know about Windows 10 but in earlier versions of Windows Explorer go to Tools>Folder Options>Search and look for an option like "Always search file names and contents" and set that option . Then the Apply button. It seems if this is done at the "Computer" level it propigates to the system.

And when it says "may take minutes" they aren't joking. So if you don't know which folder to start in and are searching with "Include subfolders" option it can take a long time to search every file of every subfolder.

 

OR make sure that every single folder is always "indexed".

DrSAS
Fluorite | Level 6

Thanks for your effort but you have windows file explorer confused with internet explorer.  This solution involves doing a regedit and finding the .sas extension under the HKEY_CLASSES_ROOT and setting it to {5e941d80-bf96-11cd-b579-08002b30bfeb}

Sven111
Pyrite | Level 9

If your on a fairly updated version of Windows 10 and also have familiarity with Linux/UNIX tools or prefer them like I do, then you can take advantage of the Windows 10 feature to run Bash on Ubuntu on Windows 10.  I played around with this on my personal PC and thought it was quite handy, unfortunately my work PC isn't on Win10 yet so I'm using CygWin, which also lets me use tools like grep to search for keywords.  If you're not a Linux person, this may not be helpful, but I thought I'd pass it along.

ChrisNZ
Tourmaline | Level 20

Microsoft, in their wisdom, created the Advanced Query Syntax (curse them!) to look for files having certain characteristics or contents, rather than XP's unreliable search menu.

Sadly it is even worse and doesn't work too well; but that's all you have to use in the Windows explorer.

Look for AQS tutorials online.

A much better option is to search using a SAS program if you can. Or bash. Or any other program.

 

 

 

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3731 views
  • 2 likes
  • 5 in conversation