$title	Illustrate How to Use BATINCLUDE File pivotdata.gms

*	Generate lots of multidimensional output:

set	t /2000*2100/
	s /ind, ser, agr/
	i /i1,i4/,
	k /price, output, investment/;

*	In this example we have two arrays of data: a and b,
*	both randomly assigned.

parameter	a(t,s,k), b(t,i,s,k), c(t,s);
a(t,s,k) = exp(0.02*(ord(t)-1)) * uniform(0.8,1.2);
b(t,i,s,k) = exp(0.01*(ord(t)-1)) * uniform(0.8,1.2);
c(t,s) = exp(0.01*(ord(t)-1)) * uniform(0.5,1.5);

*	Define the name of the workbook to be generated:

$setglobal workbook mypivotdata

*	Optionally delete the workbook if you want to 
*	have a fresh start:

$if exist mypivotdata.xls $call 'rm mypivotdata.xls'

*	Dump out the data along with column headers --
*	identifiers with which to label each colum of data.
*	The column with numeric values is always labelled "value".

*	You may wish to use set IDs as column headings:

$batinclude pivotdata a t s k

*	Or you may wish to use more descriptive names:

$batinclude pivotdata b time index sector variable

*	If you fail to provide column headings, pivotdata.gms
*	will not complain, but you will need to be sure you have entered
*	column headings in your workbook:

$batinclude pivotdata c