Hi..
"Why If condition won't work in Procedures"????
As Per my knowledge IF condition works only in Proc Report Procedure that too in Compute block only.
Could any one explain me why IF won't works in all other procedures??
Thanks in Advance 🙂
Regards.
Sanjeev.K
The short answer: the procedures weren't programmed that way.
My guess why not: make sure your data is what you want to analyze before going to procedures else they get very complicated to program and maintain.
What procedure do want to use that you think NEEDS an IF statement?
If you want a procedure to process some of the data based on a condition that is accomplished with a WHERE statement as part of the procedure or as a data set option;
Because there's a WHERE clause and its more efficient that IF statements.
WHERE statements just subset or filter your data.
IF statements do a whole lot more than just filter data. Their primary use in DATA steps is conditional processing (IF condition true then do something), hence their implementation in REPORT procedure COMPUTE blocks.
Doing IF conditional processing in procedures other than REPORT doesn't make sense because their purpose is to transform data and that can be handled in the DATA step. And if all you want to do is filter data then WHERE statements are available for that.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.