w********u 发帖数: 328 | 1 F1 column low high
1 1 1 19
2 1 1 20
3 1 1 21
30 1 12 48
31 1 13 49
32 1 14 50
33 1 15 51
34 1 16 52
272 1 254 290
273 1 255 291
274 1 256 292
279 1 261 297
280 1 262 298
...........................
actually there're 360 rows. Now I have 5000 natural numbers, from 1 to 5000,
if this particular number is between low and high at the same time, i'll
set it to one, otherwise i'll set it to zero. so i'll do loop from i=1 to
5000 step=1. So the output should have one column which includes 5000 rows.
i tried multiple times but there's still bugs.
here's the major part of my code:
...........
array count{5000};
array low1{230};
array high1{230};
do i=1 to 5000;
do j=1 to 230;
if i>=low1(j) and i<=high1(j) then count(i)=1;
else count(i)=0;
i=i+1;
j=j+1;
end;
end;
..........
so basically, i don't know how to compary one particular number, like 45,
with every row of 'low' and 'high'till the end.
I don't know if anyone could give me some corrections and suggestions!
thank you!! |
b******e 发帖数: 445 | 2 where did you get the number '230' in your code? I couldn't understand your
question. |
k*******a 发帖数: 772 | 3 你这个似乎用sql比较容易点
【在 w********u 的大作中提到】 : F1 column low high : 1 1 1 19 : 2 1 1 20 : 3 1 1 21 : 30 1 12 48 : 31 1 13 49 : 32 1 14 50 : 33 1 15 51 : 34 1 16 52 : 272 1 254 290
|
w********u 发帖数: 328 | 4 because there're 230 rows in the following dataset, i didn't copy them all
because there're too many rows.
F1 column low high
1 1 1 19
2 1 1 20
3 1 1 21
30 1 12 48
31 1 13 49
32 1 14 50
33 1 15 51
34 1 16 52
272 1 254 290
273 1 255 291
274 1 256 292
279 1 261 297
280 1 262 298 |
s******r 发帖数: 1524 | 5 Still got lost on what you want to do.
maybe
if _n_ >=low and _n_<=high then countt=1;
else countt=0;
【在 w********u 的大作中提到】 : because there're 230 rows in the following dataset, i didn't copy them all : because there're too many rows. : F1 column low high : 1 1 1 19 : 2 1 1 20 : 3 1 1 21 : 30 1 12 48 : 31 1 13 49 : 32 1 14 50 : 33 1 15 51
|
D******n 发帖数: 2836 | 6 You said 360 in your OP. Check your question again.
all
【在 w********u 的大作中提到】 : because there're 230 rows in the following dataset, i didn't copy them all : because there're too many rows. : F1 column low high : 1 1 1 19 : 2 1 1 20 : 3 1 1 21 : 30 1 12 48 : 31 1 13 49 : 32 1 14 50 : 33 1 15 51
|