Monday, June 11, 2012

Confusing SAS statements

Here are some wiered (different with other programming languge) SAS syntax:
1. IF statement in DATA steps.
eg. IF expression ;
if the expression fails, the process will skip rest statements and start over the next observation in the DATA step.
2. RETAIN and SUM expression
e.g. sumVar+ValueExpression
the initiation of SUM variable is 0, instead of missing value like other variables. When you need an other than zero initiation for sumVar, you have to use modifier RETAIN. This is not consistent grammar design.
3. Left SUBSTR
e.g. SUBSTR(TagetStr, insertPos, length)=InsertString
overloaded the function, left assigment

No comments:

Post a Comment