BookmarkSubscribeRSS Feed
Geo-
Quartz | Level 8

It's an exercise in our company system and I could not copy it into text.Someone familiar with

SAS grammar please help.The correction is only considered from syntax way,no other consideration is needed.

3.jpg

6 REPLIES 6
Reeza
Super User

Need some more context here? What makes you think anything is wrong? Are there errors? Something not working as expected?

 


@Geo- wrote:

It's an exercise in our company system and I could not copy it into text.Someone familiar with

SAS grammar please help.The correction is only considered from syntax way,no other consideration is needed.

3.jpg


 

Reeza
Super User
Honestly it looks like that code has been copied and pasted as well. The quotation marks are slanted which is usually done via a word processor, but it may also mean SAS doesn’t interpret them correctly anymore.
Kurt_Bremser
Super User

Wow. Somebody has really made an effort to make **** out of something that probably once was usable code.

Inconsistent indentation and linefeeds, all capitals, no blanks but long pieces of spaghetti, and obvious remnants of feeding the code through a word processor.

 

Replace the slanted quotes, and then run the code, and post the log here if further errors happen.

 

If you work in an environment where copy/pasting is deliberately disabled while you are supposed to do coding work, tell the moron responsible to get a new job. Someone has to clean the toilets, right?

Reeza
Super User

Usually this means you’re in a secure lab and there are very valid reasons for not allowing copy/paste. Problem is, taking an image will also violate the terms of the research agreement. These are available as RDC where census data are linked to other data such as your tax data and health data sets. From the names in the data above it looks like health data. It has to remain secure from people who post online inadvertently. Maybe I’m a moron for enforcing that but I’ll continue to do so in my labs because that amount of data in the wrong hands is worth millions. There’s also no internet access, swipe cards to monitor and cameras. 

 

Or it’s a hiring test- I’m leaning towards that in this one because the code seems intentionally wrong. 


@Kurt_Bremser wrote:

Wow. Somebody has really made an effort to make **** out of something that probably once was usable code.

Inconsistent indentation and linefeeds, all capitals, no blanks but long pieces of spaghetti, and obvious remnants of feeding the code through a word processor.

 

Replace the slanted quotes, and then run the code, and post the log here if further errors happen.

 

If you work in an environment where copy/pasting is deliberately disabled while you are supposed to do coding work, tell the moron responsible to get a new job. Someone has to clean the toilets, right?


 

Kurt_Bremser
Super User

OTOH, I expect people who work in that kind of environment to know their job (like you) and not be dependent to come here for help with simple syntax problems.

 

And I also think that people you are responsible for do not need to come here for help.

 

Sorry if I stepped on your toes.

Astounding
PROC Star

The quotes have already been mentioned,  But there's much more to fix:

 

There is no such thing as a LET statement in SAS.  There is a %LET statement, and it looks like somebody omitted the percent sign.

 

PROC SORT does not use a CLASS statement.  It uses a BY statement.

 

While PROC FREQ is allowed to use a BY statement, the one there is invalid.  BY does not permit a slash and and a MISSING option.  Most likely, the BY statement in PROC FREQ should be a TABLES statement instead.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 987 views
  • 0 likes
  • 4 in conversation