ReadTrnsportData2.gms : Reads set data and the table of the transportation model in one call

Description

This program reads transportation data using xls2gms.exe and a command file.


Category : GAMS Data Utilities library


Main file : ReadTrnsportData2.gms   includes :  Test3.xlsx  ReadTrnsportData2.gms

$ontext
   This program reads transportation data using xls2gms.exe and a command file.

   
   The Windows GAMS distribution contains several tools to exchange data with MS-Excel:  
   GDX2XLS, GDXXRW, XLS2GMS, and XLSDUMP. While we continue to include all four tools in our 
   distribution, only GDXXRW is under active development.  Therefore, we strongly recommend 
   using GDXXRW for data exchange with Excel.
$offtext

$callTool win32.msappavail Excel
$if errorlevel 1 $abort.noError "No Excel available"

$onecho > cmdxls.txt
i=Test3.xlsx
r1=Sheet2!a3:a4
o1=seti.inc
r2=Sheet2!b2:d2
o2=setj.inc
s2=","
r3=Sheet2!a2:d4
o3=pard.inc
$offecho

$call =xls2gms @cmdxls.txt

set i /
$include seti.inc
/;
set j /
$include setj.inc
/;
table d(i,j)
$include pard.inc
;
display i,j,d;