using SAS 94 version The work sheet gender has data of only
using SAS 9.4 version
The work sheet gender has data of only one variable sex and has even number of rows in the
work sheet. Write a data step to create a data set that will have two central observations.
Note that no sorting needed to find central observations. No credit for counting the observations
manually
data:
| sex |
| M |
| M |
| F |
| F |
| F |
| F |
| M |
| M |
| F |
| F |
| F |
| F |
| F |
| F |
| F |
| M |
| M |
| F |
| F |
| F |
| F |
| F |
| M |
| M |
Solution
Steps
1 Begin the DATA step and create a SAS data set called Gender.
2 Read an observation from SAS data set Weight. (Total Count)
3 Calculate a value for variable Central. (i.e Total Count/2)
4 Execute the DATA step.
| M |
| M |
| F |
| F |
| F |
| F |
| M |
| M |
| F |
| F |
| F |
| F |
| F |
| F |
| F |
| M |
| M |
| F |
| F |
| F |
| F |
| F |
| M; |

