SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
tomrvincent
Rhodochrosite | Level 12

Anyone have a syntax checker for SAS?  I had a new-to-SAS coworker who was trying to use the DATEDIF function, which doesn't exist, instead of the DATDIF, which does.  The error message he was getting wasn't helpful and yet typing 'SAS DATEDIF' into Google immediately returns a DATDIF reference...why can't SAS do that?

5 REPLIES 5
art297
Opal | Level 21

If you're on Unix you can try: http://www.vim.org/scripts/script.php?script_id=3522

 

I've never tried it, but sounds like it might do what you want.

 

Art, CEO, AnalystFinder.com

 

ChrisHemedinger
Community Manager

If you're using SAS Enterprise Guide, you can press Ctrl+Shift+F1 and see a list of SAS functions that the program editor knows about. 

 

undefined

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
tomrvincent
Rhodochrosite | Level 12

I was hoping for something that would catch typos, make interactive suggestions...more like a modern word processor would do, like grammar checking. Remind me of what parameters I need to supply, what formats I can choose from, what options a proc offers...

 

I'd especially want SAS to be able to catch the dreaded 'missing quote' nightmare.  If there was a way to clear the 'current line' buffer rather than exiting SAS EG completely, that would be helpful. If the compiler knows the line is too long, why not show me what the line currently is so that I can see where the problem started?

 

Seems like some of these problems never get fixed and I only remember them when I have to train somebody new!

ballardw
Super User

@tomrvincent wrote:

I was hoping for something that would catch typos, make interactive suggestions...more like a modern word processor would do,

 


The little I worked with VBA I hated the constant popups when my VARIABLES had some characters in common with Function names. When we get something that reads minds or has a logic processor like the computer in the later set Star Trek shows maybe.

 

You could add keywords for the functions to the editor so that when you use a key word it highlights it. Then if you use something you think is a function but isn't then the missing highlight may be a clue. But considering the number of people that use mean, sum, max, min and such as variable names I'm not sure how reliable this would be in addition to the time spend to add them to the keyword list.

 

And unfortunately the "current line" that is too long often is caused by something many lines previous in the code. Or an erroneous macro result.

ChrisNZ
Tourmaline | Level 20

Being able to reset the 'current line buffer' has been a request to SAS Institute for many many years.

For example see here

 

 

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4166 views
  • 4 likes
  • 5 in conversation