Just curious if you came across this problem.
look at the following code ..
Code: Select all
for i in PERSON do
// NOT WORKING .......
if AGE(i) in 10:110 then
tmpCnt1 = 0;
if count(Q1300000 where Q1304 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1305 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1306 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1307 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1308 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1309 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1310 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1311 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1312 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1313 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1314 = "X") > 0 then inc(tmpCnt1); endif;
if count(Q1300000 where Q1315 = "X") > 0 then inc(tmpCnt1); endif;
if tmpCnt1 < Q1110(i) then
addErr(130201,MD1_DATE_I,"Q1300000",i,maketext(130201));
endif;
endif;
// ALTERNATIVE WORKING VERSION
if AGE(i) in 10:110 then
tmpCnt1 = 0;
tmpCnt2 = 0;
tmpCnt3 = 0;
tmpCnt4 = 0;
tmpCnt5 = 0;
tmpCnt6 = 0;
tmpCnt7 = 0;
tmpCnt8 = 0;
tmpCnt9 = 0;
tmpCnt10 = 0;
tmpCnt11 = 0;
tmpCnt12 = 0;
tmpCnt13 = 0;
for j in Q1300000 do
if Q1304(i,j) = "X" then
tmpCnt1 = tmpCnt1 + 1;
endif;
if Q1305(i,j) = "X" then
tmpCnt2 = tmpCnt2 + 1;
endif;
if Q1306(i,j) = "X" then
tmpCnt3 = tmpCnt3 + 1;
endif;
if Q1307(i,j) = "X" then
tmpCnt4 = tmpCnt4 + 1;
endif;
if Q1308(i,j) = "X" then
tmpCnt5 = tmpCnt5 + 1;
endif;
if Q1309(i,j) = "X" then
tmpCnt6 = tmpCnt6 + 1;
endif;
if Q1310(i,j) = "X" then
tmpCnt7 = tmpCnt7 + 1;
endif;
if Q1311(i,j) = "X" then
tmpCnt8 = tmpCnt8 + 1;
endif;
if Q1312(i,j) = "X" then
tmpCnt9 = tmpCnt9 + 1;
endif;
if Q1313(i,j) = "X" then
tmpCnt10 = tmpCnt10 + 1;
endif;
if Q1314(i,j) = "X" then
tmpCnt11 = tmpCnt11 + 1;
endif;
if Q1315(i,j) = "X" then
tmpCnt12 = tmpCnt12 + 1;
endif;
enddo;
if tmpCnt1 > 0 then inc(tmpCnt13); endif;
if tmpCnt2 > 0 then inc(tmpCnt13); endif;
if tmpCnt3 > 0 then inc(tmpCnt13); endif;
if tmpCnt4 > 0 then inc(tmpCnt13); endif;
if tmpCnt5 > 0 then inc(tmpCnt13); endif;
if tmpCnt6 > 0 then inc(tmpCnt13); endif;
if tmpCnt7 > 0 then inc(tmpCnt13); endif;
if tmpCnt8 > 0 then inc(tmpCnt13); endif;
if tmpCnt9 > 0 then inc(tmpCnt13); endif;
if tmpCnt10 > 0 then inc(tmpCnt13); endif;
if tmpCnt11 > 0 then inc(tmpCnt13); endif;
if tmpCnt12 > 0 then inc(tmpCnt13); endif;
if tmpCnt13 < Q1110(i) then
addErr(130201,MD1_DATE_I,"Q1300000",i,maketext(130201));
endif;
endif;
enddo;
DATA ...
AGE
12
15
11
13
RESULT ..
AGE(1) returns 13
AGE(2) returns 13 ... and so on.
The first routine also causes CSPro to return a non-occurrence fault. "Occurrence does not exist"
Let me know if you came across this problem.
Thanks,
Pierre