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.
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.
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?
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?
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.
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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.