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. 

 

datdif1.png

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 3161 views
  • 4 likes
  • 5 in conversation