GDXXRWExample8.gms : Reads a parameter with special values from an MS Excel file and writes it to a GDX file

Description

This program illustrates reading a parameter with
special values such Eps, +Inf, -Inf, etc.


Category : GAMS Data Utilities library


Main file : GDXXRWExample8.gms   includes :  Test1.xls  GDXXRWExample8.gms

$ontext

This program illustrates reading a parameter with
special values such Eps, +Inf, -Inf, etc.

$offtext

$if %system.filesys% == UNIX $abort.noerror 'This model cannot run on a non-Windows platform';
$call msappavail -Excel
$if errorlevel 1 $abort.noerror 'Microsoft Excel is not available!';

 sets v  column entries    /v1,v2,v3,v4,v5,v6/ ;

 parameter data4(v);

* $onUNDF must be set in order to read #DIV/0!
$onUNDF
$CALL GDXXRW Test1.xls par=data4 rng=EX4!A1:F2 Cdim=1 trace=0
$GDXIN Test1.gdx
$LOAD data4
$GDXIN

display data4;


* Data Validation
parameter exp_data4(v) expected_data4 / v1 Eps, v2 NA, v3 Eps, v4 +Inf, v5 -Inf, v6 UNDF /;
set error01(v) unexpected value;
error01(v) = exp_data4(v)<>data4(v);
abort$card(error01) error01;