Database text files


You can save real (RE) headers in a text format used by some database or other programs (eg, Stata). It is sometimes called an SQL text file. For each header there is:

a descriptive row, beginning '!Header;';

a column heading for each index (dimension), followed by the Value column header;

for each non-zero element, a line showing set elements (index values), followed by the value.

In the example below, fields are separated by commas, but you can choose tabs instead.

!Header: 2BAS, dimensions: COM*SRC*IND [5*2*5], description: Investment Basic

COM,SRC,IND,Value

AgricMining,dom,AgricMining,200.07162476

Manufactures,dom,AgricMining,1362.1809082

UtilsCnstruc,dom,AgricMining,3256.8295898

TradeTranspt,dom,AgricMining,18.750864029

Other,dom,AgricMining,313.5632019

.......... and so on

ViewHAR cannot read data in this format, but the command-line program CSV2HAR can. CSV2HAR is not supplied with GEMPACK but is part of the free "bundle" that you can download. There are instructions in CSV2HAR.DOC. The "bundle" also contains HAR2CSV, a command-line program to go from HAR to Database text format.

The above text format can be very easily used to create an Excel Pivot Table. First, open the text file in Excel (an Import Wizard may guide you). Then select the text data in the Excel sheet. Then, use the Pivot Wizard to guide your next steps. If you are new to Pivot Tables, it may be hard going at first -- but the results are worth it.

Other methods of Saving Data to file are:

GEMPACK Text Files

Excel (XLS) format

GDX (GAMS) files

Information and instructions about Excel Pivot tables:

http://peltiertech.com/Excel/Pivots/pivotlinks.htm



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

Link to full GEMPACK Manual

Link to GEMPACK homepage