Hello everyone,
I would want to replicate the code from paper. And, The code gives several similar ERROR 22-322 and ERROR 76-322. I could not find the proper solution.
It shows that, several ERRORS 22-322 and ERROR 76-322 in log files (I attached the log file here {
142 p3 = p1; -- 22 76 ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant. ERROR 76-322: Syntax error, statement will be ignored. 143 p2 = p1; 144 p4 = p1; /*equal p*/ 145 /* con1 = (p1+q1)*(p1+q1)/p1; 146 con2 = (p2+q2)*(p2+q2)/p2; 147 con3 = (p3+q3)*(p3+q3)/p3; 148 con4 = (p4+q4)*(p4+q4)/p4; */ 149 e1 = exp(-(p1+q1)*t); de1 = 1+(q1/p1)*e1; 150 e2 = exp(-(p2+q2)*(t- 4 )); de2 = 1+(q2/p2)*e2; -- 22 76 151 e3 = exp(-(p3+q3)*(t- 10 )); de3 = 1+(q3/p3)*e3; --- 22 76 152 e4 = exp(-(p4+q4)*(t- 16 )); de4 = 1+(q4/p4)*e4; --- 22 76 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, LE, LT, NE, OR, ^<, ^=, ^>, |, ||, ~<, ~=, ~>. ERROR 76-322: Syntax error, statement will be ignored.
}).
Please, help me how to solve it.
Thanks in advance!
Karim John
___________________________________
Here is the script:
DATA DRAM;
INPUT t g1 g2 g3 g4;
DATALINES;
1 190 0 0 0
2 560 0 0 0
3 1000 0 0 0
4 1680 0 0 0
5 2542 3 0 0
6 2640 880 0 0
7 2350 2510 0 0
8 1820 4725 0 0
9 1170 7720 0 0
10 750 10940 0 0
11 455 13090 625 0
12 303 13330 3881 0
13 203 9977 8125 0
14 170 6896 13110 0
15 49 4646 17687 0
16 29 3297 19412 0
17 14 2916 17529 806
18 6 2384 14909 2922
19 4 2079 10475 5887
20 4 1676 8060 8440
21 3 1397 6450 9335
22 0 1107 5919 9046
23 0 894 5118 10450
24 0 829 4641 11348
;
RUN;
PROC PRINT DATA=DRAM; RUN;
PROC MODEL CONVERGE = 0.0000001 MAXITER = 10000 METHOD = MARQUARDT;
ENDOGENOUS g1 g2 g3 g4;
EXOGENOUS t;
PARAMETERS
p1 = 0.001
p2 = 0.001
p3 = 0.001
p4 = 0.001
q1 = 0.3
q2 = 0.3
q3 = 0.3
q4 = 0.3
m1 = 3000000
m2 = 1500000
m3 = 2000000
m4 = 1500000
p2 = p1;
p3 = p1;
p4 = p1; /*equal p*/
/* con1 = (p1+q1)*(p1+q1)/p1; con2 = (p2+q2)*(p2+q2)/p2; con3 = (p3+q3)*(p3+q3)/p3; con4 = (p4+q4)*(p4+q4)/p4; */
e1 = exp(-(p1+q1)*t); de1 = 1+(q1/p1)*e1;
e2 = exp(-(p2+q2)*(t- 4 )); de2 = 1+(q2/p2)*e2;
e3 = exp(-(p3+q3)*(t- 10 )); de3 = 1+(q3/p3)*e3;
e4 = exp(-(p4+q4)*(t- 16 )); de4 = 1+(q4/p4)*e4;
IF t<5 THEN /* Gen2 introduced in time 5 */
DO;
g1=m1*(1-e1)/de1;
g2=0;
g3=0;
g4=0;
END;
ELSE IF t<11 then /* Gen3 introduced at time 11*/
DO;
g1=m1*(1-e1)/de1*(1-(1-e2)/de2);
g2=(1-e2)/de2*(m2+m1*(1-e1)/de1)*(1-(1-e3)/de3);
g3=0;
g4=0;
END;
ELSE IF t<17 then /* Gen3 introduced at time 17*/
DO;
g1=m1*(1-e1)/de1*(1-(1-e2)/de2);
g2=(1-e2)/de2*(m2+m1*(1-e1)/de1)*(1-(1-e3)/de3);
g3=(1-e3)/de3*(m3+(1-e2)/de2*(m2+m1*(1-e1)/de1))*(1-(1-e4)/de4);
g4=0;
END;
ELSE
DO;
g1=m1*(1-e1)/de1*(1-(1-e2)/de2);
g2=(1-e2)/de2*(m2+m1*(1-e1)/de1)*(1-(1-e3)/de3);
g3=(1-e3)/de3*(m3+(1-e2)/de2*(m2+m1*(1-e1)/de1))*(1-(1-e4)/de4);
g4=(1-e4)/de4*(m4+(1-e3)/de3*(m3+(1-e2)/de2*(m2+m1*(1-e1)/de1)));
END;
FIT/FIML;
RUN;
Hi @KarimJOHN
It seems that there is a semicolon missing after specifying the values of the parameters
m4 = 1500000
;
p2 = p1;
Another thing is that it seems confusing to SAS to specify values for p1, p2, p3 and p4 and then specify conditions such as p1=p2.
I believe you need to specify only one .
Best,
Hi @KarimJOHN
It seems that there is a semicolon missing after specifying the values of the parameters
m4 = 1500000
;
p2 = p1;
Another thing is that it seems confusing to SAS to specify values for p1, p2, p3 and p4 and then specify conditions such as p1=p2.
I believe you need to specify only one .
Best,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.