|
Based on system characteristics |
Top Previous Next |
|
One can use a $If or $Ifi with or without the not modifier to test the characteristics of a number of GAMS system options. Such items are addressed as an attribute of the keyword system as follows
%system.attribute%
Most of the available words are not useful in conditionals, thus I list the attributes further below and only deal with the Filesys attribute. That syntax is
$If %system.filesys% == type gamsstatement
where type can be DOS, MS95, UNIX, MSNT and others that identify the type of system on which the job is being run. This allows operating specific command inclusion. Example: When I include the statements
$set console $If %system.filesys% == UNIX $set console /dev/tty $If %system.filesys% == DOS $set console con $If %system.filesys% == MS95 $set console con $If %system.filesys% == MSNT $set console con $If "%console%." == "." abort "filesys not recognized"; file screen / '%console%' /;
that allow definition of a put file destination that is dependent upon the operating system that is being used. In this case I am setting control variable console to the operating system dependent name of the screen that users can view when a job is running. In turn, this permits us to use put commands to pass information to the user on program execution progress during the conduct of a time consuming procedure. |