Hi, I did use the > 0 as recommended, but I am still getting the same error. Below is the code: libname Learn '/folders/myfolders/Learn' ;
Data Prob12_8 ;
Set learn.study(rename = (Weight = WeightTemp)) ;
If find(weighttemp, 'kg', 'i') > 0 then weight = 2.2*input(compress(Weighttemp,,'kd', 8.)) ;
else if find(weighttemp, 'lbs', 'i') > 0 then weight = input(compress(Weighttemp,,'kd', 8.)) ;
proc print data=Prob12_8 noobs ;
run ; ---------------- Below is the log: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 61 62 /* Chapter 12*/ 63 /* Problem 12.8*/ 64 libname Learn '/folders/myfolders/Learn' ; NOTE: Libref LEARN was successfully assigned as follows: Engine: V9 Physical Name: /folders/myfolders/Learn 65 66 Data Prob12_8 ; 67 Set learn.study(rename = (Weight = WeightTemp)) ; 68 If find(weighttemp, 'kg', 'i') > 0 then weight = 2.2*input(compress(Weighttemp,,'kd', 8.)) ; _ 22 76 69 else if find(weighttemp, 'lbs', 'i') > 0 then weight = input(compress(Weighttemp,,'kd', 8.)) ; _ 22 76 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=. ERROR 76-322: Syntax error, statement will be ignored. 70 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.PROB12_8 may be incomplete. When this step was stopped there were 0 observations and 6 variables. WARNING: Data set WORK.PROB12_8 was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 71 proc print data=Prob12_8 noobs ; 72 run ; NOTE: No observations in data set WORK.PROB12_8. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 73 74 75 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 88
... View more