I want to make a datetime stamp when the model starts and then prefix this to all the reports the GAMS code creates during execution.
I tried the following but it doesn’t seem to evaluate the date functions at compile time:
{ Create the report prefix Gregorian datetime stamp }
$setglobal REPORT_PREFIX gYear(JNow)gMonth(JNow)gDay(JNow)gHour(JNow)gMinute(JNow)gSecond(JNow)
file f_debug /results%REPORT_PREFIX%_debug.csv/;
The compile time error given is:
{ Create the report prefix Gregorian datetime stamp }
103 file f_debug /results\gYear(JNow)gMonth(JNow)gDay(JNow)_gHour(JNow)gMinute(JNow)gSecond(JNow)__debug.csv/;
104 puclose f_debug “debug”;
**** $140 36
**** 36 '=' or '..' or ':=' or '=’ operator expected
**** rest of statement ignored
**** 140 Unknown symbol
Can someone point me in the right direction, or give me the terms to search the GAMS help for.
Thanks
AndyC