Interactive mode

Top  Previous  Next

When Xls2gms.exe is executed without arguments one receives the screen

 

_img77

 

In turn, if one specifies use of the spreadsheet tran.xls, and the range sheet1!a1:d3 one addresses the spreadsheet area below

 

_img78

 

and the program generates an include file as follows

 

* -----------------------------------------------------

* Xls2gms Version 1.5,  August 2002

* Erwin Kalvelagen, GAMS Development Corp.

* -----------------------------------------------------

* Application: Microsoft Excel

* Version:     9.0

* Workbook:    C:\gams\gamspdf\bigone\tran.xls

* Sheet:       Sheet1

* Range:       $A$1:$D$3

* -----------------------------------------------------

          new-york chicago topeka

seattle   25       17      18

san-diego 25       18      14

*-----------------------------------------------------

 

This file in turn can be included into GAMS at compile time or at execution time via GDX and the GAMS to GAMS trick discussed below.

Note while the data are output in Table format, the table statement is not present.  Thus the user needs to supply it either in the GAMS file or it can be typed above the table in the spreadsheet and Xls2gms will copy it.  In particular Xls2gms copies all entries longer than 30 columns verbatim into the GMS file (see the resource.xls example as imported by Xl2gmsresource.gms as discussed below).

There are a number of options in Xls2gms that merit mention

Checking the quote blanks box causes the program to encapsulate strings that contains blanks in quotation marks and also deals with strings containing quotation marks.
The box to the right of separator allows the user to enter a character that will be used to separate cells in the output file.  By default this is a blank. CSV files can be generated by entering a , (comma)  in this field.
Checking the mute box will reduce the amount of information written to the output file.  The output file then becomes

 

          new-york chicago topeka

seattle   25       17      18

san-diego 25       18      14

 

Checking the No listing box causes the program to enter $offlisting and $onlisting into the program suppressing the data from the LST file.
Checking the Ignore language settings box causes the program to convert numbers in the common European format (where a comma is used for the decimal point --3.14 is written as 3,14) into the US notation using a decimal point employed in GAMS.