DATA Step, Macro, Functions and more

List of All SAS Keywords

Reply
Contributor
Posts: 66

List of All SAS Keywords

Hi All,
Does anyone know/have a list of all sas keywords for base datastep/procs?

I am building a parser for the sas language that color codes sas programs for viewing through a web browser.

Many thanks if anyone/SAS can help.

Cameron
Super User
Posts: 5,254

Re: List of All SAS Keywords

I don't if there are any public database where you can pick this up. But in the doc you can quite easily find global and data step statements, function an macros listed.

As I'm sure you are aware of, SAS is colour coding in DMS and EG, maybe there is way to reuse these schemas. I suggest that you open a track to SAS support if you need help on this from the inside...

/Linus
Data never sleeps
Valued Guide
Posts: 2,174

Re: List of All SAS Keywords

good luck!
I really hope you'll be successful, because you might be delivering the syntax formatter that has been outstanding for a long time.
(well that would be more useful to me than the color which pastes quite well into m$word).
One challenge you face is that some SAS keywords are context dependant.
Even the SAS code node (a.k.a. enhanced editor) has a problem with, for example matching do-end where select-end is present in the code.
Would your code-coloring extend inside a %macro definition (unlike the enhanced editor :-( )?

I haven't found a language syntax dictionary on the http://support.sas.com site. However, declared for SAS9.1.3, I found one on the ultraedit website, at http://www.ultraedit.com/files/wf/sas.uew .

good luck

PeterC
Contributor
Posts: 66

Re: List of All SAS Keywords

Thanks for the vote of support! I dream of the day when we get a proper SAS IDE!!!! This post is because I'm trying to avoid the task of going through the sas doc to get all the keywords. I think though it will be the only way to get them Smiley Sad



The parser extends Syntax Highlighter written by Alex Gorbatchev. The highlighter can be found here.



Once I have a suitable release you can find my parser at my google code site here. It will contain the language file and a css file with the colors. I also aim to release a code viewer (written in .NET) that allows you to view code stored on the file system within a browser.


I haven't uploaded anything yet but will be in the next few days.

The color coding does extend to macro definitions Smiley Happy
Gettting the highlighter to contextually highlight correctly along with something resembling intelli-sense will be v2.0 release Smiley Wink

At present I have it highlighting;

  • comments (except *Smiley Wink</li><br> <li>libnames</li> <br> <li>ods</li> <br> <li>strings</li> <br> <li>formats/informats</li> <br> <li>sas supplied macros (%symget %sysfunc %put etc.)</li> <br> <li>Variable Definitions (%global, %let %local etc)</li><br> <li>user defined macros</li> <br> <li>data/proc/run;/quit;</li> <br> <li>All Base Procs (9.1.3)</li><br> <li>keywords</li></li>
Contributor
Posts: 66

Re: List of All SAS Keywords

a beta is released here.

Readme is in the download.
Super Contributor
Super Contributor
Posts: 3,174

Re: List of All SAS Keywords

A Multi-Edit add-in (IDE) named EZRTOOLS from Martin Works can be found at the link below:

http://www.ezrtools.com/

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 66

Re: List of All SAS Keywords

Thanks for the link.

In true SAS tradition....Design straight from 1999!!!
Respected Advisor
Posts: 3,887

Re: List of All SAS Keywords

[ Edited ]

I believe SAS Studio got syntax highlighting and colouring implemented and as this is a Web client you could search through the installation folders and see if there is some XSL with what you're after.

 

Frequent Contributor
Posts: 75

Re: List of All SAS Keywords

Hello was a list found? I want such a list of SAS Keywords to parse SAS programs for anything that is not a keyword. This is just one approach I have for validating a few small programs. Basically this would tell me any variables needed by the programs or output by the programs.

Regular Contributor
Posts: 194

Re: List of All SAS Keywords

Vim has a syntax file for SAS. You can find it here :

http://www.vim.org/scripts/script.php?script_id=3522

Frequent Contributor
Posts: 75

Re: List of All SAS Keywords

Thanks I can extract the list from the vim script. Personally I am not looking for highlighting.

Ask a Question
Discussion stats
  • 10 replies
  • 1688 views
  • 2 likes
  • 7 in conversation