Page 1 of 1

How to loop between a start_date and a end_date

Posted: Fri Jun 26, 2020 4:27 pm
by jch
(379 Bytes) Downloaded 68 times
I have a function myFunction.gms.

Code: Select all

display "%1";
And a main function testFunction.gms to call myFunction.

Code: Select all

$batinclude myFunction.gms 20200625
$batinclude myFunction.gms 20200626
How to call myFunction.gms to loop from a start_date to an end_date?

For example, how to write gams codes to take two parameters: a start_date of 20200601 and an end_date of 20200605, it will call myFunction.gms 5 times, and each time with a date such as below:

Code: Select all

$batinclude myFunction.gms 20200601
$batinclude myFunction.gms 20200602
$batinclude myFunction.gms 20200603
$batinclude myFunction.gms 20200604
$batinclude myFunction.gms 20200605
Thank you!