Question: 17.3) The SAS program below is to record 9 values as the missing values for Q1- Q5 and is to create the BMI variables at

17.3) The SAS program below is to record 9 values as the missing values for Q1- Q5 and is to create the BMI variables at each visit using height and weight variables. Use this program. If you submit this program, you will see the error messages in the Log window. Fix the program.

DATA final.htwt_2;

SET htwt_1;

ARRAY xvar (5) Q1 - Q5;

ARRAY old (5) wt_1 - wt_3;

ARRAY new (5) bmi_1 - bmi_3;

DO i = 1 TO 5;

IF xvar(i) = 9 THEN xvar(i) = .;

END;

DO i = 1 TO 5;

new(i) = old(i) / (ht)**2;

END;

DROP i;

RUN;

PROC PRINT DATA = final.htwt_2;

The Error message I am getting in the log window is;

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;

72

73 * Create a permanent SAS data set;

74 LIBNAME htwt_2 '/home/u49676141/final exam/SASProgram';

NOTE: Libref HTWT_2 was successfully assigned as follows:

Engine: V9

Physical Name: /home/u49676141/final exam/SASProgram

75 PROC IMPORT DATAFILE = '/home/u49676141/my_shared_file_links/haeyoung_kim0/BISM6092/Rawdata/Final Exam/htwt.xlsx' DBMS =

75 ! xlsx OUT = finahtwt_2 REPLACE;

NOTE: The import data set has 7 observations and 10 variables.

NOTE: WORK.FINAHTWT_2 data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time):

real time 0.00 seconds

user cpu time 0.01 seconds

system cpu time 0.00 seconds

memory 2741.21k

OS Memory 33192.00k

Timestamp 12/01/2020 05:45:06 PM

Step Count 173 Switch Count 4

Page Faults 0

Page Reclaims 694

Page Swaps 0

Voluntary Context Switches 26

Involuntary Context Switches 0

Block Input Operations 0

Block Output Operations 264

76 DATA final.htwt_2;

77 SET htwt_1;

ERROR: File WORK.HTWT_1.DATA does not exist.

78 ARRAY xvar (5) Q1 - Q5;

79 ARRAY old (5) wt_1 - wt_3;

ERROR: Too few variables defined for the dimension(s) specified for the array old.

80 ARRAY new (5) bmi_1 - bmi_3;

ERROR: Too few variables defined for the dimension(s) specified for the array new.

81 DO i = 1 TO 5;

82 IF xvar(i) = 9 THEN xvar(i) = .;

83 END;

84 DO i = 1 TO 5;

85 new(i) = old(i) / (ht)**2;

86 END;

87 DROP i;

88 RUN;

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).

85:11

ERROR: Libref FINAL is not assigned.

NOTE: The SAS System stopped processing this step because of errors.

NOTE: DATA statement used (Total process time):

real time 0.00 seconds

user cpu time 0.00 seconds

system cpu time 0.00 seconds

memory 522.43k

OS Memory 31140.00k

Timestamp 12/01/2020 05:45:06 PM

Step Count 174 Switch Count 0

Page Faults 0

Page Reclaims 34

Page Swaps 0

Voluntary Context Switches 0

Involuntary Context Switches 0

Block Input Operations 0

Block Output Operations 0

89 PROC PRINT DATA = final.htwt_2;

ERROR: Libref FINAL is not assigned.

90 RUN;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!