Page 61 - SAS_manual
P. 61

6.4 Some other statement


               6.4.1 Retain statement:

               Retain statement is used to retain previous value of given variable.

               6.4.2 Sum Statement:

               Syntax::Newvar+increment;

                      Is used to create new variable & initialize with zero.
                      It is also used to retain previous value of variables.

               Program 6.10:                                   Output:

























               If we don’t use retain statement then SAS is not remembering the last t_age. Here sum of age can be
               calculated row wise.

               6.4.3 Delete statement:

               It is used to delete an observation.
               6.4.4 Missing function:

               It is used to return value 1 if given variable has missing value otherwise zero.

               Program 6.11:                                   Output:








                                                    SAS HANDBOOK | VISIT:: http://nikhilanalytics.com  61
   56   57   58   59   60   61   62   63   64   65   66