Errors that arise during puts

Top  Previous  Next

Errors can occur during execution of put commands that are caused when file or page attributes are violated.  These errors are non-fatal and are listed at the end of the program listing.  They typically occur when a put statement attempts to write outside of a page, such as moving the cursor with the @ character to a location beyond the page width.  Other typical errors are the inability to open a specified file, the overflow of a page, or an inappropriate value being assigned to a suffix.  For many of these errors, an additional set of asterisks will be placed at the location of the error in the output file.

Since put errors are non-fatal, their presence is sometimes overlooked without reviewing the program listing and these put errors might go undetected, especially in large output files.  Consequently, GAMS includes a file attribute to help one detect errors:

 

localfileidentifier.errors

 

This attribute allows one to display the number of put errors occurring during execution of put commands to a file.  The attribute is addressed using the syntax

 

Parametervalue = Localfileidentifier.errors;

 

Such statements can be inserted at any point of a program to detect the number of errors, which have occurred up to that location.