11-04-2017 03:23 AM
11-04-2017 07:06 AM
Simple. Procedures are pre-fabricated modules that accept a limited set of parameters, the data step is undetermined and compiled.
11-04-2017 08:29 AM
The very brief picture: In a DATA step, IF deletes observations that have already been read in. The deletion can be based on original values in the observation, or can be based on values calculated along the way by the DATA step.
However, the WHERE statement subsets observations before they get read into the DATA step. By subsetting earlier, the WHERE statement (in many cases) is faster than the IF statement. In addition, the WHERE statement is available for procedures as well as the DATA step. Since procedures don't calculate new variables, and procedures have the WHERE statement available, there is no need for an IF statement there.
11-04-2017 09:01 AM
Actually, a number of procedures use IF statements. They use a system called CMP that provides programming capabilities. Here is one example, NLIN. https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_nlin_sect01... I know some of the OR procs have complicated syntax too, so they probably do. IML of course does. Look at the documentation, it will tell you. There might be a list of CMP procs somewhere. I could more easily check if I were in my office. Most procedures do not use IF statements.
11-05-2017 06:14 AM
To subset data many procedure allow for a WHERE statement (which is more like SQL syntax).
When working with SAS tables you can also use a WHERE statement as data set option to subset records:
Proc <some proc> data=source(where=(<condition>)); ...