一道SAS基础题重金悬赏,求程序. (题中的参考帮助来自 SAS Certification Prep Guide Base Programming for SAS 9的第14章)
Assignment:
Create a data set with the following attributes. Arrays and material from chapter 14 should help.
Use a do loop to create a variable i that goes from 0 to 9.
Use a do loop to create a variable j that goes from 0 to 9 for each value of i.
Create a variable k that is the sum of i times 10 plus j. (k will count from 0 to 99).
Create an array x of 10 variables named x1 through x10. For each observation, the value of x1 is 1 divided by the current value of k, x2 is 2 over k, x3 is 3 over k, and so on.
Create a variable m that takes the value of `ODD' for odd value of k and `EVEN' for even values of k.
Create a variable n that takes the value of i written out (i.e. n = `Zero' for i = 0).
Create a variable o that takes the value of j written out (i.e. o = `Zero' for j = 0).
Create a variable p that concatenates n and o (no spaces) and converts it to all uppercase.
Create a variable q that removes all instances of the substring `ON' from p and replaces them with `NO'.
Create a variable r that takes only the rst two characters of q
Output to the data set for every value of k.
As a hint, the data set should have 100 observations and 19 variables.