SAS OnlineTutorback||next

Try It! Using the Hrd.Funddrive data set, group and process variables as an array.

Creating HTML output? Read this first.

  1. Create the Hrd.Added data set from Hrd.Funddrive, which contains employees' contributions to a charity. Below is a sample of the data set.

    SAS Data Set Hrd.Funddrive
    LastName Qtr1 Qtr2 Qtr3 Qtr4
    ADAMS 18 18 20 20
    ALEXANDER 15 18 15 10
    APPLE 25 25 25 25
    ARTHUR 10 25 20 30
    AVERY 15 15 15 15
    BAREFOOT 20 20 20 20

    The following steps instruct you to add an employer's supplement of 25 percent to each employee's contribution.

  2. Write an ARRAY statement to group the variables Qtr1 through Qtr4 for processing. Name the array contrib.

  3. Write a DO loop to add the company's supplement of 25% to each employee's quarterly contribution.

  4. Submit the DATA step and correct any errors; then print the new data set.

    Return here and select Next.

Solution
back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA.
All rights reserved.

Terms of Use & Legal Information | Privacy Statement