DATA Step, Macro, Functions and more

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

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

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

[ Edited ]

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?


Accepted Solutions
Solution
2 weeks ago
Occasional Contributor
Posts: 5

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

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


All Replies
Super User
Super User
Posts: 7,401

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

I suspect that it is the same setting the let's OUTLOOK preview SAS programs.

 

https://communities.sas.com/t5/Base-SAS-Programming/Allow-OUTLOOK-to-preview-attached-SAS-programs/m...

 

Solution
2 weeks ago
Occasional Contributor
Posts: 5

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

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.
Occasional Contributor
Posts: 5

Re: How do I search for a keyword in a.sas file using microsoft file explorer - windows

[ Edited ]

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.

Super User
Posts: 12,148

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

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

Occasional Contributor
Posts: 5

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

[ Edited ]

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}

Frequent Contributor
Posts: 91

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

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.

PROC Star
Posts: 1,935

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

[ Edited ]

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.

 

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 209 views
  • 0 likes
  • 5 in conversation