SAS Programming

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

Once I asked myself this, I just can't get the question out of my head.  The OF symbol (syntax) is not motivated by the English preposition "of", is it?

 

SAS Help Center: The OF Operator with Functions and Variable Lists

10 REPLIES 10
Tom
Super User Tom
Super User

Are you trying to get into the minds of the SAS development team?

Makes sense to me.  MAX(of var1-var10) means "take the max of var1 thru var10".

PhilC
Rhodochrosite | Level 12

@Tom wrote:

  MAX(of var1-var10) means "take the max of var1 thru var10".


yeah, but then there is 

CALL MISSING(of var1-var10);
jimbarbour
Meteorite | Level 14

@PhilC wrote:

CALL MISSING(of var1-var10);

This is sort of like saying:

Dear SAS, of this list of variables, var1 through var10, please set them to missing.

 

I would agree that 

MAX(of Var1 - Var10);

is easier to "translate" into English, but I think the paradigm still holds even for MISSING.

 

The general rule for "translating" into English would be:

of these variables (a list of vars), do this (perform the specified function)

 

In the case of MISSING:

Of these variables, Var1 - Var10, set them to missing.

 

In short:  "of these, do this".

 

I think this is a reasonable way of understanding the syntax.  

 

Jim

PhilC
Rhodochrosite | Level 12

Ok I get it, thanks for your submissions.  Sadly I'm too unsatisfied to press "Accept as Solution", so I'm passing out likes.  

Tom
Super User Tom
Super User

@PhilC wrote:

Ok I get it, thanks for your submissions.  Sadly I'm too unsatisfied to press "Accept as Solution", so I'm passing out likes.  


That because your original goal is a fool's errand .

 

Software designers create syntax that re-use normal words.  But the meaning of the syntax is what the computer language supports, not the normal conversational meaning of that word.

PhilC
Rhodochrosite | Level 12

It's a good point to bring up about the re-using of pre-existing reserved words.  That dawned on me when a day after the post. 

 

---

"Who's the more foolish, the fool or the fool who follows him?" - George Lucas

 

jimbarbour
Meteorite | Level 14

The Cambridge Dictionary lists one of the uses of "of" as "relating to".  In this sense, the developers used the word well.  They used "of" to relate a function to a grouping of variables. 

 

However, to @Tom's point, if we discuss this long enough, the Dictionary of Internet Slang's definition of "of" may soon apply to all of us. 😉

 

What does "of" mean in slang?
 
The Meaning of OF:
OF means "Old Fart" 

 

jimbarbour_0-1628174820021.png

 

PhilC
Rhodochrosite | Level 12

@Tom wrote:

Are you trying to get into the minds of the SAS development team?

ha ha, yes I am.

PaigeMiller
Diamond | Level 26

Are you referring to using OF in many functions such as 

 

y=mean(of x1-x5);

???

 

If so, then this indicates that the function (in this case the MEAN function) is to use a variable list x1-x5.

 

Or are you asking about other uses? If so, please specify where in SAS you would use this OF

--
Paige Miller
WarrenKuhfeld
Ammonite | Level 13

At one time, there was no OF operator. In those bad-old-days, the statement

 

mean = mean(x1-x100);

 

computed the mean of x1 minus x100, which was not what anyone would ever likely want.
So SAS added OF to take the mean (or whatever function) *of* a list, suppressing the normal subtraction. More generally, OF can be used with any list. So, yes, the english word "of" makes sense: function of a list of variables.

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 10 replies
  • 3181 views
  • 9 likes
  • 5 in conversation