how to export values after each loop to excel file in GAMS

45 Views Asked by At

I want to know how to export values after each loop to an Excel file in GAMS EX: Calculate the sum from 1 to 5

Scalar itrlim upper limit of the summation /5/
        k summation variable
        S value of summation /0/;
        
for(k=1 to itrlim by 1,
S=S+k
);

display S;
k S
1 1
2 3
3 6
4 10
5 15

I have tried the commands execute_unload + execute, but the result is not as expected.

0

There are 0 best solutions below