Help using Base SAS procedures

subsetting if statement

Occasional Contributor
Posts: 10

subsetting if statement

in one of the codes that I am working on has:

if startdate ne. ; * subsetting if: exclude obs meeting condition;

What does that bold statement do in this code.


Posts: 8,164

Re: subsetting if statement

As long as this is open code, it doesn't have any effect.  The subsetting ends with the first semicolon, the asterisk indicates that the rest of the line (up to the 2nd semicolon) is a comment.

Occasional Contributor
Posts: 10

Re: subsetting if statement

thnx for your reply. if the asterisk sign is not present then what does it really mean...

Occasional Contributor
Posts: 10

Re: subsetting if statement

It mens select startdate not missing rows!

Frequent Contributor
Posts: 106

Re: subsetting if statement

Comments in SAS can be of the form

  •   /* comment enclosed in slash-asterisk and asterisk-slash respectively */
  • * comment as per "if the first nonblank character after a semicolon (or when it is the very first character in the entire source code) is an asterisk then everything up to the next semicolon will be treated as a comment" ;
  • %* comment in macro language syntax. Similar rule as before applies, ie. has to be terminated by a semicolon and has to come first after a statement boundary ;

Now all this is extremely abbreviated and subject to omissions/errors that my fellow peers will eventually point out.

What it boils down to in the context of your question:

The "bold statement" is nothing but a comment that tries to explain the non-bold statement (ie. the subsetting if) to its left.

Hope this makes sense


Ask a Question
Discussion stats
  • 4 replies
  • 4 in conversation