include file

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.


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.

Hakan,

$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use

$setglobal source 1

in the include file to have the variable in the including file also.

More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.

-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.


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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.com

Thank you very much Steve, It worked.
Mohammad, my aim is to solve the model with different pairs of source and sink. I modify the inc file in C and run the model in C.


Date: Fri, 6 May 2011 07:50:02 -0400
Subject: Re: include file
From: sdirkse@gams.com
To: gamsworld@googlegroups.com

Hakan,

$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use

$setglobal source 1

in the include file to have the variable in the including file also.

More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.

-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.


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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdirkse@gams.com
http://www.gams.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.


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 Steve
I am having some problem in creating and calling them into the model.The model uses many tables to be included as input data.The problem I’m facing is that I’m unable to create the include files for two data tables which I have stored in the same Excel sheet of the workbook. The two tables have the same dimensions (sets) though they represent data pertaining to different variables. I get the error message as follows
Domain violation for element
Overlapping Row name.
Could you please help me out.
Thanks in advance.


Regards
Pooja



On Friday, May 6, 2011 7:16:32 PM UTC+5:30, Hakan Kutucu wrote:

Thank you very much Steve, It worked.
Mohammad, my aim is to solve the model with different pairs of source and sink. I modify the inc file in C and run the model in C.


Date: Fri, 6 May 2011 07:50:02 -0400
Subject: Re: include file
From: sdi...@gams.com
To: gams...@googlegroups.com

Hakan,

$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use

$setglobal source 1

in the include file to have the variable in the including file also.

More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.

-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.


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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com


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.

Hi Pooja

Without any code it is hard to see where the problem lies.

Use trace=3 after the gdxxrw (see gdxuitls manual) to get more information.

It looks like one of the row elements is not member of the set over which the parameter is defined.

Cheers

Renger


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

Info@modelworks.ch

blog.modelworks.ch







From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of pooja padmanabhan
Sent: Sonntag, 23. Februar 2014 14:31
To: gamsworld@googlegroups.com
Subject: Re: include file



Hi Steve
I am having some problem in creating and calling them into the model.The model uses many tables to be included as input data.The problem I’m facing is that I’m unable to create the include files for two data tables which I have stored in the same Excel sheet of the workbook. The two tables have the same dimensions (sets) though they represent data pertaining to different variables. I get the error message as follows
Domain violation for element
Overlapping Row name.
Could you please help me out.
Thanks in advance.


Regards
Pooja



On Friday, May 6, 2011 7:16:32 PM UTC+5:30, Hakan Kutucu wrote:

Thank you very much Steve, It worked.
Mohammad, my aim is to solve the model with different pairs of source and sink. I modify the inc file in C and run the model in C.



Date: Fri, 6 May 2011 07:50:02 -0400
Subject: Re: include file
From: sdi...@gams.com
To: gams...@googlegroups.com

Hakan,



$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use



$setglobal source 1



in the include file to have the variable in the including file also.



More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.



-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.

\

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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com

\

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.


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.

Thanks Renger.
I have another basic doubt.
When do we use an include command and a gdx command to export data from excel to the model.Would produce differences in the results for a multiperiod model.Could you please clarify my doubt.The commands I used are:

$onecho > taskin1.txt
Par= lvlabreq rng=a2:m5 cdim=1 rdim=1
$offecho
$call gdxxrw.exe lvlabreq2.xlsx @taskin1.txt
$gdxin lvlabreq2.gdx
parameter lvlabreq(H,S);
$load lvlabreq
display lvlabreq

$ontext

$offtext
and
$CALL =xls2gms rng=a2:m5 i=lvlabreq2.xlsx o=lvlabreq.inc
$include lvlabreq.inc

;
Could you please tell me when to use which command.
Thanks a lot.


Regards

On Monday, February 24, 2014 3:43:37 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Pooja

Without any code it is hard to see where the problem lies.

Use trace=3 after the gdxxrw (see gdxuitls manual) to get more information.

It looks like one of the row elements is not member of the set over which the parameter is defined.

Cheers

Renger


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

In…@modelworks.ch

blog.modelworks.ch







From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of pooja padmanabhan
Sent: Sonntag, 23. Februar 2014 14:31
To: gams...@googlegroups.com
Subject: Re: include file



Hi Steve
I am having some problem in creating and calling them into the model.The model uses many tables to be included as input data.The problem I’m facing is that I’m unable to create the include files for two data tables which I have stored in the same Excel sheet of the workbook. The two tables have the same dimensions (sets) though they represent data pertaining to different variables. I get the error message as follows
Domain violation for element
Overlapping Row name.
Could you please help me out.
Thanks in advance.


Regards
Pooja



On Friday, May 6, 2011 7:16:32 PM UTC+5:30, Hakan Kutucu wrote:

Thank you very much Steve, It worked.
Mohammad, my aim is to solve the model with different pairs of source and sink. I modify the inc file in C and run the model in C.



Date: Fri, 6 May 2011 07:50:02 -0400
Subject: Re: include file
From: sdi...@gams.com
To: gams...@googlegroups.com

Hakan,



$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use



$setglobal source 1



in the include file to have the variable in the including file also.



More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.



-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.

\

lvlabreq2.xlsx (8.86 KB)

Hi

I would use the gdx utility. Xls2gms was developed in 2004 when we didn’t have the gdx utility yet.

Gdx is more powerful.

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com] On Behalf Of pooja padmanabhan
Sent: Mittwoch, 26. Februar 2014 14:23
To: gamsworld@googlegroups.com
Subject: Re: include file



Thanks Renger.
I have another basic doubt.
When do we use an include command and a gdx command to export data from excel to the model.Would produce differences in the results for a multiperiod model.Could you please clarify my doubt.The commands I used are:

$onecho > taskin1.txt
Par= lvlabreq rng=a2:m5 cdim=1 rdim=1
$offecho
$call gdxxrw.exe lvlabreq2.xlsx @taskin1.txt
$gdxin lvlabreq2.gdx
parameter lvlabreq(H,S);
$load lvlabreq
display lvlabreq

$ontext

$offtext
and
$CALL =xls2gms rng=a2:m5 i=lvlabreq2.xlsx o=lvlabreq.inc
$include lvlabreq.inc

;
Could you please tell me when to use which command.
Thanks a lot.


Regards

On Monday, February 24, 2014 3:43:37 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Pooja

Without any code it is hard to see where the problem lies.

Use trace=3 after the gdxxrw (see gdxuitls manual) to get more information.

It looks like one of the row elements is not member of the set over which the parameter is defined.

Cheers

Renger


Modelworks

Gewerbestrasse 15

3600 Thun – Switzerland

+41 79 818 53 73

In…@modelworks.ch

blog.modelworks.ch







From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of pooja padmanabhan
Sent: Sonntag, 23. Februar 2014 14:31
To: gams...@googlegroups.com
Subject: Re: include file



Hi Steve
I am having some problem in creating and calling them into the model.The model uses many tables to be included as input data.The problem I’m facing is that I’m unable to create the include files for two data tables which I have stored in the same Excel sheet of the workbook. The two tables have the same dimensions (sets) though they represent data pertaining to different variables. I get the error message as follows
Domain violation for element
Overlapping Row name.
Could you please help me out.
Thanks in advance.


Regards
Pooja



On Friday, May 6, 2011 7:16:32 PM UTC+5:30, Hakan Kutucu wrote:

Thank you very much Steve, It worked.
Mohammad, my aim is to solve the model with different pairs of source and sink. I modify the inc file in C and run the model in C.



Date: Fri, 6 May 2011 07:50:02 -0400
Subject: Re: include file
From: sdi...@gams.com
To: gams...@googlegroups.com

Hakan,



$set is scoped, i.e. the setting is in effect in the current file and included files, but not the parent of the included file. For an unscoped set, use



$setglobal source 1



in the include file to have the variable in the including file also.



More info at http://support.gams-software.com/doku.php?id=gams:the_difference_between_set_and_setglobal or google gams setglobal.



-Steve

On Fri, May 6, 2011 at 6:37 AM, Hakan Kutucu wrote:

Dear All,
I have a serious problem with include.

“st.inc” file includes the following two lines.

$Set Source 1
$Set Sink 6

But I could not success to pass these to the main gms file.

Thanks in advance.

\

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.



\

Steven Dirkse, Ph.D.
GAMS Development Corp., Washington DC
Voice: (202)342-0180 Fax: (202)342-0181
sdi...@gams.com
http://www.gams.com

\

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+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
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.
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.
For more options, visit https://groups.google.com/groups/opt_out.