You need to login to view this content. Please
Login. Not a Member?
Join Us
Log:
62 data stats;
63 set revenue;
64 array weekly{5} mon tue wed thu fri;
65 do i = 1 to 5;
66 total = weekly{i} * .25;
67 output;
68 end;
69 run;
NOTE: There were 2 observations read from the data set WORK.REVENUE.
NOTE: The data set WORK.STATS has 10 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
Commentary:
The statement array weekly{5} mon tue wed thu fri; defines an array for variables mon, tue, wed, thu, and fri are present in the dataset REVENUE. To process the array we need to use a loop. To define the loop the correct syntax is do i = 1 to 5; as this will process the array variables.
Below is the newly created WORK.STATS dataset:
Dataset(s):

Leave a Comment