Hello everybody,
im working with gams and I want to include data from a excel file.
This excel file has several tables at several separate worksheets.
I always get the error that my gdx file could not be read because gams
deletes it automatically. I have no idea why.
Would be great if you help me out with some ideas or hints !
Gams Code :
$CALL GDXXRW.EXE Data1.xls set=e rng=Skillmatrix!A2:A82 rdim=1 set=q
rng=Skillmatrix!B2:F2 cdim=1 par=s rng=Skillmatrix!A1:F82 rdim=1
cdim=1 set=q rng=Skillrequirements!B2:F2 cdim=1 set=t
rng=Skillrequirements!A2:A32 rdim=1 par=r rng=Skillrequirements!A2:F32
rdim=1 cdim=1 set=t rng=Shifttypes!A2:A32 rdim=1 set=j rng=Shifttypes!
A2:A32 rdim=1 par=a rng=Shifttypes!A2:D32 rdim=1 cdim=1 set=q
rng=Costmatrix!B4:F4 cdim=1 par=c rng=Costmatrix!B4:F5 rdim=1 cdim=1
set=q rng=Costmatrix!B14:F14 cdim=1
$GDXIN Data1.gdx
sets
e employees
q qualifications
t time period
j shift type
d day /1*2/
;
$LOAD e q t j
parameters
s(q,e) qualification q per employee e
a(t,j) shift parameter
c(q) cost per qualification q
r(q,t) demand of qualification q in period t
;
$LOAD s r a c v
$GDXIN
binary variables
p(e,j,d) Assignment of employee e to shift j on day d
y(e,d) Day-off variable for employee e on day d
;
variables
F total Costs
;
equations
objective Minimize total costs
shiftperday1 At moste 1 shift per day
requirement Requirement fulfillment in each period for each
qualification
;
objective…
F =e= sum( (e,j,d,q), c(q) * p(e,j,d) * s(q,e))
;
shiftperday1(e,d)…
sum(j, p(e,j,d)) =e= y(e,d)
;
requirement(t,q,d)…
sum( (e,j), a(t,j) * p(e,j,d) * s(q,e) ) + sum( (e,j), a(t,j) *
p(e,j,d) * s(q,e)$(ord(q)=5)) =g= r(q,t)
;
Model A2T2 /all/;
Solve A2T2 using MIP minimizing F;
Error log:
— Job Task_2_test.gms Start 03/11/12 17:18:27 WEX-WEI 23.7.3 x86_64/
MS Windows
GAMS Rev 237 Copyright (C) 1987-2011 GAMS Development. All rights
reserved
Licensee: GAMS Development Corporation, Washington, DC
G871201/0000CA-ANY
Free Demo, 202-342-0180, sales@gams.com, www.gams.com
DC0000
— Starting compilation
— Task_2_test.gms(1) 2 Mb
— call GDXXRW.EXE Data1.xls set=e rng=Skillmatrix!A2:A82 rdim=1
set=q rng=Skillmatrix!B2:F2 cdim=1 par=s rng=Skillmatrix!A1:F82 rdim=1
cdim=1 set=q rng=Skillrequirements!B2:F2 cdim=1 set=t
rng=Skillrequirements!A2:A32 rdim=1 par=r rng=Skillrequirements!
GDXXRW Jul 14, 2011 23.7.3 WIN 27723.27726 VS8 x86/MS
Windows
Input file :\Task_2_test.gms
Output file: D:\Task_2_test.gms
**** Duplicate identifier = q
Output gdx file deleted
Total time = 764 Ms
— Task_2_test.gms(3) 2 Mb
*** GDXIN failed D:\Task_2_test.gms
*** Msg: No such file or directory
— Task_2_test.gms(3) 2 Mb 1 Error
*** Error 510 in D:\Task_2_test.gms
Unable to open gdx file for $GDXIN
— Task_2_test.gms(19) 3 Mb 2 Errors
*** Error 409 in D:\Task_2_test.gms
Unrecognizable item - skip to find a new statement
looking for a ‘;’ or a key word to get started again
— Task_2_test.gms(31) 3 Mb 3 Errors
*** Error 409 in D:\Task_2_test.gms
Unrecognizable item - skip to find a new statement
looking for a ‘;’ or a key word to get started again
— Task_2_test.gms(72) 3 Mb 4 Errors
*** Error 257 in D:\Dropbox\Uni Mannheim\02Fundamentals\Shares
\FSS12\OPM 662 Modelling and Optimization of Operations Scheduling
\Assignments\Assignment 2\Task 2\Task_2_test.gms
Solve statement not checked because of previous errors
— Task_2_test.gms(72) 3 Mb 4 Errors
*** Status: Compilation error(s)
— Job Task_2_test.gms Stop 03/11/12 17:18:28 elapsed 0:00:00.913
Exit code = 2
Excel file:
http://www.xup.in/dl,65267370/Data1.xls/ (Sorry I dont know how to
attach a file into a google group)
Thanks for your help.
Looking forward to hearing from you
Rich
\