BookmarkSubscribeRSS Feed
CameronLawson
Obsidian | Level 7
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
10 REPLIES 10
LinusH
Tourmaline | Level 20
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
Peter_C
Rhodochrosite | Level 12
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
CameronLawson
Obsidian | Level 7

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 😞



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 🙂
Gettting the highlighter to contextually highlight correctly along with something resembling intelli-sense will be v2.0 release 😉

At present I have it highlighting;

  • comments (except *;)</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>
CameronLawson
Obsidian | Level 7
a beta is released here.

Readme is in the download.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
CameronLawson
Obsidian | Level 7
Thanks for the link.

In true SAS tradition....Design straight from 1999!!!
Patrick
Opal | Level 21

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.

 

ptimusk
Obsidian | Level 7

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.

gamotte
Rhodochrosite | Level 12

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

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

ptimusk
Obsidian | Level 7

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

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
  • 10 replies
  • 10545 views
  • 2 likes
  • 7 in conversation