excel to gams

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede
exceltogams.zip (4.56 KB)

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN


Cheers,
Pedro


On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:



GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found = C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2


Any ideas on how to solve this? I’ve been struggling with this for some time :frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.

\

Hi Fede,

The name of the excel file was: “data.xls.xls”. I have also made some improvements to your code :slight_smile: (attached).


Cheers,
Pedro

On Fri, Jun 22, 2012 at 10:25 AM, Federico Perea wrote:

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:



GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found = C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2


Any ideas on how to solve this? I’ve been struggling with this for some time :frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


exceltogams_fede.zip (4.63 KB)

Dear Pedro,

thank you so much for your help! It sometimes happens to me that the
simplest mistake is impossible to find :frowning:

Honestly, thanks for taking your time to help me out.

Fede

On Fri, Jun 22, 2012 at 11:48 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

The name of the excel file was: “data.xls.xls”. I have also made some
improvements to your code :slight_smile: (attached).

Cheers,
Pedro

On Fri, Jun 22, 2012 at 10:25 AM, Federico Perea wrote:

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:

GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found =
C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2

Any ideas on how to solve this? I’ve been struggling with this for some
time :frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea
wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


You received this message because you are subscribed to the Google
Groups
“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


You received this message because you are subscribed to the Google
Groups
“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.

\

Hi Fedrico



The most simple way is:


\

  • Sets and Parameters definition

SET i ;

  • Data importation from Excel

$CALL GDXXRW I=data.xls O=Data.gdx set=i rdim=1 rng=data!A1:a3 par=a rdim=1 rng=data!A1:b3 trace=3



PARAMETER a(i);





$GDXIN data.gdx

$LOAD i,a

$GDXIN



display a,i;



Notice that you have a parameter a(i) with one dimension, so you have to set rdim=1.





Cheers



Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of Pedro Javier Ramírez Torrealba
Sent: Friday, June 22, 2012 11:49 AM
To: gamsworld@googlegroups.com
Subject: Re: excel to gams



Hi Fede,



The name of the excel file was: “data.xls.xls”. I have also made some improvements to your code :slight_smile: (attached).





Cheers,

Pedro

On Fri, Jun 22, 2012 at 10:25 AM, Federico Perea wrote:

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:



GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found = C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2


Any ideas on how to solve this? I’ve been struggling with this for some time :frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


\

To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Thanks Renger!

On Fri, Jun 22, 2012 at 1:03 PM, Renger van Nieuwkoop
wrote:

Hi Fedrico

The most simple way is:

  • Sets and Parameters definition

SET i ;

  • Data importation from Excel

$CALL GDXXRW I=data.xls O=Data.gdx set=i rdim=1 rng=data!A1:a3 par=a
rdim=1 rng=data!A1:b3 trace=3

PARAMETER a(i);

$GDXIN data.gdx

$LOAD i,a

$GDXIN

display a,i;

Notice that you have a parameter a(i) with one dimension, so you have to set
rdim=1.

Cheers

Renger

From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On
Behalf Of Pedro Javier Ramírez Torrealba
Sent: Friday, June 22, 2012 11:49 AM
To: gamsworld@googlegroups.com
Subject: Re: excel to gams

Hi Fede,

The name of the excel file was: “data.xls.xls”. I have also made some
improvements to your code :slight_smile: (attached).

Cheers,

Pedro

On Fri, Jun 22, 2012 at 10:25 AM, Federico Perea wrote:

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:

GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found =
C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2

Any ideas on how to solve this? I’ve been struggling with this for some time
:frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea
wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.

\

Take a look at:
http://www.gams.com/dd/docs/tools/xls2gms.pdf
There are other ways to perform this task:
http://interfaces.gams-software.com/doku.php?id=excel:excel
good luck


2012/7/31 Gabriel

Hi guys,

I have a excel in the following format, and i want to read it in the TABLE(i,j) gams format.

exporter importer exports
ARG . BRA 269
ARG . CAN 0
BRA . ARG 0
BRA . CAN 37
CAN . BRA 0
CAN . BRA 0




Any comment will be helpfull.

I will atach the xls.

Best,

Gabriel


To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/FC5-L01n1OUJ.
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Edson Valle
edsoncv@gmail.com


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.

Dear all,

I have the same problem.
here is my code:

$CALL GDXXRW.EXE book.xls par=cm rng=C3:G7
Parameter cm(,);
$GDXIN book.gdx
$LOAD cm
$GDXIN

I encounter the same errors(ERROR 502 & 510)




On Friday, 22 June 2012 12:00:42 UTC+4:30, fedperea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN


thanks for you help.


Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Try this! Nadia!


par= cm rng= your_list_name!g6 rdim=1 cdim=1

\


g6 = left upper cotner of table


All the best!






15.05.2013, 13:43, “nadia” :

Dear all,

I have the same problem.
here is my code:

$CALL GDXXRW.EXE book.xls par=cm rng=C3:G7
Parameter cm(,);
$GDXIN book.gdx
$LOAD cm
$GDXIN

I encounter the same errors(ERROR 502 & 510)

On Friday, 22 June 2012 12:00:42 UTC+4:30, fedperea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

thanks for you help.

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\

With kindly regards!
Andre Savitsky
E-mail:andresavit@yandex.ru
andre_savit@yahoo.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

sorry, I did’nt understand what to do. would you please write the entire code?


On Wed, May 15, 2013 at 6:17 PM, Savitsky Andre wrote:

Try this! Nadia!


par= cm rng= your_list_name!g6 rdim=1 cdim=1

\


g6 = left upper cotner of table


All the best!






15.05.2013, 13:43, “nadia” :

Dear all,

I have the same problem.
here is my code:

$CALL GDXXRW.EXE book.xls par=cm rng=C3:G7
Parameter cm(*,*);
$GDXIN book.gdx
$LOAD cm
$GDXIN

I encounter the same errors(ERROR 502 & 510)




On Friday, 22 June 2012 12:00:42 UTC+4:30, fedperea wrote:

    Hey gams community!

    I have trouble importing data from Excel to GAMS. The following code
    does not seem to work :frowning:



    set i passes /1*3/;

    Parameter a(i);

    $CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

    $GDXIN data.gdx
    $LOAD a
    $GDXIN


thanks for you help.


    Any ideas on how to solve this? I attach a zip file in case you want
    to try it on your own.

    Thanks a lot for your help!

    Fede


--
To unsubscribe from this group and stop receiving emails from it, send an email to <gamsworld+unsubscribe@googlegroups.com>.

To post to this group, send email to <gamsworld@googlegroups.com>.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


\

With kindly regards!
Andre Savitsky
E-mail:andresavit@yandex.ru
andre_savit@yahoo.com


You received this message because you are subscribed to a topic in the Google Groups “gamsworld” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsworld/Lca85EO48-o/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



\

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

\

Hello Renger!
I found your response in this post and would like to ask for your help if possible.

I tried entering the code as you suggested, however, I still get the message “no such file or directory”.
If I take away the
$GDXIN data.gdx

I get “GDX file not open”, although I don´t get the previous message anymore.


Any ideas why this is happenning ??
Thanks so much!
Ines


On Friday, June 22, 2012 5:03:30 AM UTC-6, Renger van Nieuwkoop wrote:

Hi Fedrico



The most simple way is:


\

  • Sets and Parameters definition

SET i ;

  • Data importation from Excel

$CALL GDXXRW I=data.xls O=Data.gdx set=i rdim=1 rng=data!A1:a3 par=a rdim=1 rng=data!A1:b3 trace=3



PARAMETER a(i);





$GDXIN data.gdx

$LOAD i,a

$GDXIN



display a,i;



Notice that you have a parameter a(i) with one dimension, so you have to set rdim=1.





Cheers



Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Pedro Javier Ramírez Torrealba
Sent: Friday, June 22, 2012 11:49 AM
To: gams...@googlegroups.com
Subject: Re: excel to gams



Hi Fede,



The name of the excel file was: “data.xls.xls”. I have also made some improvements to your code :slight_smile: (attached).





Cheers,

Pedro

On Fri, Jun 22, 2012 at 10:25 AM, Federico Perea wrote:

Hello Pedro,

thanks but it did not work. It keeps giving errors. Here is the log
file I get when I write down the code you sent before to the gams file
I attached originally:



GDXXRW Feb 14, 2009 23.0.2 WIN 8239.9411 VIS x86/MS Windows
**** Input file not found = C:\Users\fepero.UPVNET\Desktop\exceltogams\data.xls
Total time = 531 Ms
— file_2.gms(8) 3 Mb
*** GDXIN failed C:\Users\fepero.UPVNET\Desktop\exceltogams\data.gdx
*** Msg: No such file or directory
— file_2.gms(8) 3 Mb 1 Error
*** Error 510 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Unable to open gdx file for $GDXIN
— file_2.gms(9) 3 Mb 2 Errors
*** Error 502 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
GDXIN file not open - ignore rest of line
— file_2.gms(14) 3 Mb 3 Errors
*** Error 141 in C:\Users\fepero.UPVNET\Desktop\exceltogams\file_2.gms
Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
— file_2.gms(17) 3 Mb 3 Errors
*** Status: Compilation error(s)
— Job file_2.gms Stop 06/22/12 11:19:13 elapsed 0:00:00.680
Exit code = 2


Any ideas on how to solve this? I’ve been struggling with this for some time :frowning:

Fede

On Fri, Jun 22, 2012 at 11:01 AM, Pedro Javier Ramírez Torrealba
wrote:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN

Cheers,
Pedro

On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:

set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


“gamsworld” group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


“gamsworld” group.
To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to
gamsworld+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/gamsworld?hl=en.


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


\

To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

The name of the Excel file is your problem. It is called
data.xls.xls (extension twice) Rename to data.xls.

Looks like you want to read a parameter with dim=1 so
this will make it work:

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3 rdim=1 cdim=0

–Paul


On Fri, Jun 22, 2012 at 3:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Paul,
can you help me?
I get the follwing errors:
error 1: Unknown identifier entered as set
error 2: GDXIN file not open -ignore rest of file

My code look like this:

SET
i
alias(i,j)
r;

$CALL GDXXRW.EXE I=InputGAMS.xlsx O=InputGAMS.gdx set=i rng=product rdim=1 set=j rng=supplier rdim=1 set=r rng=interval rdim=1 par=d rng=demand Cdim=1 Rdim=1 par=c rng=capacity Cdim=1 Rdim=1 par=B rng=B Cdim=1 Rdim=2 par=k rng=K Cdim=1 Rdim=2 par=P rng=P Cdim=1 Rdim=2 par=Q rng=Q Cdim=1 Rdim=2 par=L rng=L Cdim=1 Rdim=2 par=S rng=S Cdim=1 Rdim=2 Trace=3


PARAMETERS
d(i) annual demand of product i
c(j) capacity at supplier j
B(j,r) busines vol interval wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Inez,

  1. I do not see a declaration of the set R

  2. Before doing a $LOAD you need a $GDXIN

–Paul



On Tue, Jun 25, 2013 at 2:41 PM, Ines TR wrote:

Paul,
can you help me?
I get the follwing errors:
error 1: Unknown identifier entered as set
error 2: GDXIN file not open -ignore rest of file

My code look like this:

SET
i
alias(i,j)
r;

$CALL GDXXRW.EXE I=InputGAMS.xlsx O=InputGAMS.gdx set=i rng=product rdim=1 set=j rng=supplier rdim=1 set=r rng=interval rdim=1 par=d rng=demand Cdim=1 Rdim=1 par=c rng=capacity Cdim=1 Rdim=1 par=B rng=B Cdim=1 Rdim=2 par=k rng=K Cdim=1 Rdim=2 par=P rng=P Cdim=1 Rdim=2 par=Q rng=Q Cdim=1 Rdim=2 par=L rng=L Cdim=1 Rdim=2 par=S rng=S Cdim=1 Rdim=2 Trace=3


PARAMETERS
d(i) annual demand of product i
c(j) capacity at supplier j
B(j,r) busines vol interval wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Yes, I forgot to mention that when adding $GDXIN what i get is “unable to open gdx file for GDXIN”
Any clues why?


2013/6/26 Paul Van der Eijk

Inez,

  1. I do not see a declaration of the set R

  2. Before doing a $LOAD you need a $GDXIN

–Paul



On Tue, Jun 25, 2013 at 2:41 PM, Ines TR wrote:

Paul,
can you help me?
I get the follwing errors:
error 1: Unknown identifier entered as set
error 2: GDXIN file not open -ignore rest of file

My code look like this:

SET
i
alias(i,j)
r;

$CALL GDXXRW.EXE I=InputGAMS.xlsx O=InputGAMS.gdx set=i rng=product rdim=1 set=j rng=supplier rdim=1 set=r rng=interval rdim=1 par=d rng=demand Cdim=1 Rdim=1 par=c rng=capacity Cdim=1 Rdim=1 par=B rng=B Cdim=1 Rdim=2 par=k rng=K Cdim=1 Rdim=2 par=P rng=P Cdim=1 Rdim=2 par=Q rng=Q Cdim=1 Rdim=2 par=L rng=L Cdim=1 Rdim=2 par=S rng=S Cdim=1 Rdim=2 Trace=3


PARAMETERS
d(i) annual demand of product i
c(j) capacity at supplier j
B(j,r) busines vol interval wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvand...@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.





\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


You received this message because you are subscribed to a topic in the Google Groups “gamsworld” group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsworld/Lca85EO48-o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.





\


Aineth Torres
Frontier Market Scout
Village Capital Program Associate
Siguenos en facebook!


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

\

Hi, Pedro
I am try to input the SAM data from the xls to Gams. I use the following code.

execute “gdxxrw sam.xls output=sam.gdx par=sam rng=a1:f6 cdim=1 rdim=1” ;
Parameter SAM (u,v) social accounting matrix;
$gdxin sam.gdx
$loaddc sam
$gdxin

But it is error like:

*** GDXIN failed C:\users\fuxue\Documents\gamsdir\projdir\sam.gdx
***Msg:No such file or directory
— splcge.gms(14) 3 Mb 1 Error
*** Error 510 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms
Unable to open gdx file for $ GDXIN
— splcge.gms(14) 3 Mb 2 Error
*** Error 502 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms
GDXIN file not open - ignore rest of line
*** Error 141 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms
Symbol neither initialized nor assigned

Thanks!

Xue

在 2012年6月22日星期五UTC-4上午5时01分55秒,PowerChile写道:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN


Cheers,
Pedro


On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


splcge.gms (521 Bytes)
sam.xls (22 KB)

Execute ‘happens’ at execution time; the $GDXIN and $LOAD at compile time. So you will create your sam.gdx file too late. Using $call GDXXRW should help you.

–Paul


On Wed, Sep 25, 2013 at 1:57 PM, wrote:

Hi, Pedro
I am try to input the SAM data from the xls to Gams. I use the following code.

execute “gdxxrw sam.xls output=sam.gdx par=sam rng=a1:f6 cdim=1 rdim=1” ;
Parameter SAM (u,v) social accounting matrix;
$gdxin sam.gdx
$loaddc sam
$gdxin

But it is error like:

*** GDXIN failed C:\users\fuxue\Documents\gamsdir\projdir\sam.gdx
***Msg:No such file or directory
— splcge.gms(14) 3 Mb 1 Error
*** Error 510 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms
Unable to open gdx file for $ GDXIN
— splcge.gms(14) 3 Mb 2 Error
*** Error 502 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms

GDXIN file not open - ignore rest of line
*** Error 141 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms

Symbol neither initialized nor assigned

Thanks!

Xue

在 2012年6月22日星期五UTC-4上午5时01分55秒,PowerChile写道:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN


Cheers,
Pedro


On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To post to this group, send email to gams...@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.



\

Paul van der Eijk
GAMS Development Corporation
Tel : (202) 342-0180 Fax : (202) 342-0181
Email: pvandereijk@gams.com
Web : http://www.gams.com


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.

Hi, Paul

Thank you for your help. But I met another problem when I input io.xls to cge1.gms

The code and error are shown as followed:

Parameter io(sec,sec2) io table;
$call “gdxxrw io.xls output=io.gdx par=io rng=a1:f7 cdim=1 rdim=1” ;


$gdxin io.gdx
$loaddc io
$gdxin

***Input file not found =C:\Users\fuxue\Documents\gamsdir\projdir\io.xls
Total time =437 Ms
—CGE0.GMS(21) 3 Mb
*** GDXIN failed C:\Users\fuxue\Documents\gamsdir\projdir\io.gdx
***Msg: No such file or directory
—CGE0.GMS(21) 3 Mb 2 Errors
***Error 510 in C:\Users\fuxue\Documents\gamsdir\projdir\CGE0.GMS
Unable to open gdx file for $GDXIN
—CGE0.GMS(22) 3 Mb 2 Errors
***Error 502 in C:\Users\fuxue\Documents\gamsdir\projdir\CGE0.GMS
GDXIN file not open - ignore rest of line
—CGE0.GMS(45) 3 Mb 3 Errors
***Error 141 in C:\Users\fuxue\Documents\gamsdir\projdir\CGE0.GMS
Symbol neither initialized nor assgned

Kind regards

Xue

在 2013年9月25日星期三UTC-4下午3时13分52秒,Paul Van der Eijk写道:

Execute ‘happens’ at execution time; the $GDXIN and $LOAD at compile time. So you will create your sam.gdx file too late. Using $call GDXXRW should help you.

–Paul


On Wed, Sep 25, 2013 at 1:57 PM, wrote:

Hi, Pedro
I am try to input the SAM data from the xls to Gams. I use the following code.

execute “gdxxrw sam.xls output=sam.gdx par=sam rng=a1:f6 cdim=1 rdim=1” ;
Parameter SAM (u,v) social accounting matrix;
$gdxin sam.gdx
$loaddc sam
$gdxin

But it is error like:

*** GDXIN failed C:\users\fuxue\Documents\gamsdir\projdir\sam.gdx
***Msg:No such file or directory
— splcge.gms(14) 3 Mb 1 Error
*** Error 510 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms
Unable to open gdx file for $ GDXIN
— splcge.gms(14) 3 Mb 2 Error
*** Error 502 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms

GDXIN file not open - ignore rest of line
*** Error 141 in C:\Users\fuxue\Documents\gamsdir\projdir\splcge.gms

Symbol neither initialized nor assigned

Thanks!

Xue

在 2012年6月22日星期五UTC-4上午5时01分55秒,PowerChile写道:

Hi Fede,

Maybe this can work:

SET i /1*3/;

PARAMETER a(i);

$call GDXXRW I=data.xls O=data.gdx par=a rng=data!A1:B3
$GDXIN data.gdx
$LOAD a
$GDXIN


Cheers,
Pedro


On Fri, Jun 22, 2012 at 8:30 AM, Federico Perea wrote:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


CGE0.GMS (3.92 KB)
io.xlsx (7.83 KB)

Hi
I a have a problem with export from Excel to GRAMS. This occur only with three dimensional matrix.
The parameters are vol(i,k,p), pv(i,k,p), CCC(i,k,p)

Gams sentence is::

$onecho > taskinput.txt

par=vol rng=vol!D5:H21 dim=3 rdim=2 cdim=1
par=pv rng=preve!D11:H27 dim=3 rdim=2 cdim=1
par=CCC rng=cos!I8:M24 dim=3 rdim=2 cdim=1

$offecho
$call gdxxrw.exe database.xlsx @taskinput.txt
$gdxin database.gdx
$load vol pv CCC
display vol, pv, CCC, ;

thanks

El viernes, 22 de junio de 2012 04:30:42 UTC-3, fedperea escribió:

Hey gams community!

I have trouble importing data from Excel to GAMS. The following code
does not seem to work :frowning:



set i passes /1*3/;

Parameter a(i);

$CALL GDXXRW.EXE data.xls par=a rng=data!A1:B3

$GDXIN data.gdx
$LOAD a
$GDXIN

Any ideas on how to solve this? I attach a zip file in case you want
to try it on your own.

Thanks a lot for your help!

Fede


To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.