Create TABLO code


A GEMPACK program to process a HAR file typically consists of code for:

set declarations

coefficient declarations

read statements

formulae

assertions

write statements

The Export..Create TABLO code command will create such code to process all real matrices in the currently open file. The code is copied to the clipboard. Then you can paste it into TABmate or another text editor. Probably it will then require modification -- ViewHAR only produces skeleton code which you will have to adapt.

You can choose which statements to include and whether:

to write code for all real matrices or just for the currrently selected matrix.

to group statements by function or by coefficient.

The various settings are remembered within a ViewHAR session, but not between sessions, ie, they revert to defaults when ViewHAR is started.

Note: Only real matrices which include full set and element labelling information can be turned into TABLO code.

Example: You wish to make a TABLO program to convert data from the strange HisModel format to the sensible MyModel format.

· start a new TAB file in TABmate (File..New..TAB file)

· in ViewHAR, open the input file (HisModel format). Export..Create Tablo code choosing options all real headers, sets, coefficients, and reads. Paste into new TAB file.

· in ViewHAR, open an example of a file in the output (MyModel) format. Export..Create Tablo code choosing options all real headers, sets, coefficients, formulae and writes. Paste into bottom of new TAB file.

· At this point, the program is nearly complete, except that all formulae for the new MyModel headers simply set values to zero. You need to add code which turns values from the input (HisModel) headers into values for the new MyModel headers.

Change April 2013: GEMPACK 11.2 and later allows lines in the TAB file to be up to 255 chars long (previous limit was 80). If the "Long Lines" option is checked, lines will be wrapped at 255 (not 80). Only check this if you have GEMPACK 11.2 or later.

Change April 2013: Export..Create TABLO code now includes more set declarations, even if not actually needed by a real header, and includes mappings recognized by ViewHAR.

Change Sep 2009: Previously, set elements were listed in the produced TAB file, even if their elements could be read from a string (1C) header. Now, set elements are not listed, unless you check the "List Set Elements" box (or if there is no 1C header containing that set).

Change Nov 2005: Problems were experienced creating TABLO code from a file based on a GAMS model where all sets were one letter only, giving rise to code like:

Coefficient (all,s,s)(all,r,r) domexp(s,r) # Domestic exports #;

TABLO, however, does not allow the same string (ie, "s") to be used as an index and as a set. To avoid the problem, Create TABLO code now adds 3 letters "Set" to the end of one-letter set names, so giving:

Coefficient (all,s,sSet)(all,r,rSet) domexp(s,r) .......

You can use search-and-replace to turn these artificial setnames into reasonable 3-letter set names, such as COM, IND and REG.



URL of this topic: www.copsmodels.com/webhelp/viewhar/hc_tabcode.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage