BookmarkSubscribeRSS Feed
jaliu
Quartz | Level 8

How many statements does the following SAS program contain?


proc print data=cert.admit label double;
var ID Name Sex Age; where Sex=F;
label Sex='Gender'; run;

 

 

The solution says "the PROC PRINT statement (two lines long);" but it looks like one line for the proc print. What am i missing?

8 REPLIES 8
PaigeMiller
Diamond | Level 26

You keep jumping between "lines" and "statements". Which is it? These are not the same, and I doubt "lines" is meaningful in any event.

--
Paige Miller
jaliu
Quartz | Level 8

This is pasted verbatim from the certification book. So, apparently I am not the only one confused by their material.

Tom
Super User Tom
Super User

@jaliu wrote:

This is pasted verbatim from the certification book. So, apparently I am not the only one confused by their material.


What "certification book"?  If you got it from SAS check if there is a feedback link where you can tell them about mistakes in their document.  If you got it from someone else then perhaps you should switch sources for your preparation materials.

Tom
Super User Tom
Super User

The way you have presented that code there are three LINES, but in general LINES have no meaning in SAS code.

There are 5 statements.

jaliu
Quartz | Level 8
I agree, for them to add that doesn't make any sense, is wrong, and only confuses students.
Tom
Super User Tom
Super User

Two of the five statements are unique to PROC PRINT.  The PROC PRINT statement itself and the VAR statement. (Although there are a lot of other PROC's that also use a VAR statement each one will have their own variations on the syntax and options.) 

 

The other three statements ( WHERE LABEL RUN) are generally supported by every procedure and so are not unique to PROC PRINT.

Tom
Super User Tom
Super User

Your subject is "Number of lines in a statement".

None of those statements use more than one line. And some of them are only using part of a line as there is another statement on the same line.

Panagiotis
SAS Employee

What page number in the certification book is this 'lines' on?

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 534 views
  • 0 likes
  • 4 in conversation