How to loop between a start_date and a end_date

Problems with syntax of GAMS
Post Reply
jch
User
User
Posts: 3
Joined: 4 months ago

How to loop between a start_date and a end_date

Post by jch » 3 months ago

LoopDates.zip
(379 Bytes) Downloaded 34 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!

Post Reply