call GAMS from GAMS : GDX file exchange

Archive of Gamsworld Google Group
Archiver
User
User
Posts: 7876
Joined: 7 years ago

call GAMS from GAMS : GDX file exchange

Post by Archiver »


Dear GAMS users,

I am trying to call gams file from gams. I have tried to follow the example given in link below,
https://www.gams.com/help/index.jsp?top ... m_gams.htm

I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.




--
Attachments
invert2.gms
(516 Bytes) Downloaded 297 times
invert.gms
(952 Bytes) Downloaded 270 times
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Dear Renger,

Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.

Thank you
Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Hi Prateek



If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:



set i /i1*i4 /;

$gdxout 'mygdx.gdx'

$unload i

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;

execute "gams inverse2.gms";

parameter ainv(i,j);

execute_load 'mygdx1.gdx', ainv;

display ainv;

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com]
Sent: Montag, 22. Februar 2016 13:05
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.



Thank you

Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Dear Renger,

Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error

GDXopenRead failed E:\.....\mygdx1.gdx
Msg: No such file or directory.

I have opened a new project in this directory and kept both the gms file in the same. Please help !!

On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Prateek



If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:



set i /i1*i4 /;

$gdxout 'mygdx.gdx'

$unload i

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;

execute "gams inverse2.gms";

parameter ainv(i,j);

execute_load 'mygdx1.gdx', ainv;

display ainv;

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 13:05
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.



Thank you

Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: call GAMS from GAMS : GDX file exchange

Post by Archiver »


here some things you could try:
check if it runs in a dos window. open one and type gams invert.gms.
did you add the second file to your project?
run the first file without the call of the second file.
Renger


sent from my iPad

On 22 Feb 2016, at 17:13, 'Prateek Mittal' via gamsworld wrote:

> Dear Renger,
>
> Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error
>
> GDXopenRead failed E:\.....\mygdx1.gdx
> Msg: No such file or directory.
>
> I have opened a new project in this directory and kept both the gms file in the same. Please help !!
>
> On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:
>
> Hi Prateek
>
>
>
> If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:
>
>
>
> set i /i1*i4 /;
>
> $gdxout 'mygdx.gdx'
>
> $unload i
>
> alias(i,j);
>
> table a(i,i)
>
> i1 i2 i3 i4
>
> i1 2 0 2 1
>
> i2 0 1 1 1
>
> i3 0 0 1 3
>
> i4 1 0 0 1
>
> ;
>
> execute "gams inverse2.gms";
>
> parameter ainv(i,j);
>
> execute_load 'mygdx1.gdx', ainv;
>
> display ainv;
>
> Cheers
>
> Renger
>
>
>
> From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
> Sent: Montag, 22. Februar 2016 13:05
> To: gamsworld
> Subject: Re: call GAMS from GAMS : GDX file exchange
>
>
>
> Dear Renger,
>
>
>
> Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.
>
>
>
> Thank you
>
> Best Regards
> Prateek
>
> On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:
>
> Hi Mittal
>
>
>
> In this case, you have to use the “compile time” version of the gdx command:
>
> $gdxout 'mygdx.gdx'
>
> $unload i
>
> Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.
>
> Cheers
>
> Renger
>
>
>
> From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
> Sent: Montag, 22. Februar 2016 09:22
> To: gamsworld
> Subject: call GAMS from GAMS : GDX file exchange
>
>
>
> Dear GAMS users,
>
>
>
> I am trying to call gams file from gams. I have tried to follow the example given in link below,
>
> https://www.gams.com/help/index.jsp?top ... m_gams.htm
>
>
>
> I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!
>
> Note: Please find attached gms files, both of them are kept in same directory.
>
>
>
>
>
>
>
> --
> 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 https://groups.google.com/group/gamsworld.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 https://groups.google.com/group/gamsworld.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 https://groups.google.com/group/gamsworld.
> For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Dear Renger,

while running one invert.gms in DOS I am getting these errors ( I am attaching a screenshot ).
Yes I have included both the files in project Is there a way to check this out ??




On Monday, February 22, 2016 at 10:19:24 PM UTC+5:30, Renger van Nieuwkoop wrote:

here some things you could try:
check if it runs in a dos window. open one and type gams invert.gms.
did you add the second file to your project?
run the first file without the call of the second file.
Renger


sent from my iPad

On 22 Feb 2016, at 17:13, 'Prateek Mittal' via gamsworld wrote:

> Dear Renger,
>
> Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error
>
> GDXopenRead failed E:\.....\mygdx1.gdx
> Msg: No such file or directory.
>
> I have opened a new project in this directory and kept both the gms file in the same. Please help !!
>
> On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:
>
> Hi Prateek
>
>
>
> If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:
>
>
>
> set i /i1*i4 /;
>
> $gdxout 'mygdx.gdx'
>
> $unload i
>
> alias(i,j);
>
> table a(i,i)
>
> i1 i2 i3 i4
>
> i1 2 0 2 1
>
> i2 0 1 1 1
>
> i3 0 0 1 3
>
> i4 1 0 0 1
>
> ;
>
> execute "gams inverse2.gms";
>
> parameter ainv(i,j);
>
> execute_load 'mygdx1.gdx', ainv;
>
> display ainv;
>
> Cheers
>
> Renger
>
>
>
> From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
> Sent: Montag, 22. Februar 2016 13:05
> To: gamsworld
> Subject: Re: call GAMS from GAMS : GDX file exchange
>
>
>
> Dear Renger,
>
>
>
> Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.
>
>
>
> Thank you
>
> Best Regards
> Prateek
>
> On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:
>
> Hi Mittal
>
>
>
> In this case, you have to use the “compile time” version of the gdx command:
>
> $gdxout 'mygdx.gdx'
>
> $unload i
>
> Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.
>
> Cheers
>
> Renger
>
>
>
> From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
> Sent: Montag, 22. Februar 2016 09:22
> To: gamsworld
> Subject: call GAMS from GAMS : GDX file exchange
>
>
>
> Dear GAMS users,
>
>
>
> I am trying to call gams file from gams. I have tried to follow the example given in link below,
>
> https://www.gams.com/help/index.jsp?top ... m_gams.htm
>
>
>
> I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!
>
> Note: Please find attached gms files, both of them are kept in same directory.
>
>
>
>
>
>
>
> --
Attachments

[The extension bmp has been deactivated and can no longer be displayed.]

Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Move the files to a directory with a simpler name (not so many empty spaces) and try again.

Did you add the changes I sent you?

If you comment the “call gams invert2…” line out does invert.gms produce a gdx file?

Cheers

Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com]
Sent: Montag, 22. Februar 2016 18:12
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



while running one invert.gms in DOS I am getting these errors ( I am attaching a screenshot ).

Yes I have included both the files in project Is there a way to check this out ??







On Monday, February 22, 2016 at 10:19:24 PM UTC+5:30, Renger van Nieuwkoop wrote:

here some things you could try:

check if it runs in a dos window. open one and type gams invert.gms.

did you add the second file to your project?

run the first file without the call of the second file.

Renger



sent from my iPad


On 22 Feb 2016, at 17:13, 'Prateek Mittal' via gamsworld wrote:

Dear Renger,



Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error



GDXopenRead failed E:\.....\mygdx1.gdx

Msg: No such file or directory.



I have opened a new project in this directory and kept both the gms file in the same. Please help !!

On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Prateek



If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:



set i /i1*i4 /;

$gdxout 'mygdx.gdx'

$unload i

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;

execute "gams inverse2.gms";

parameter ainv(i,j);

execute_load 'mygdx1.gdx', ainv;

display ainv;

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 13:05
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.



Thank you

Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

Re: call GAMS from GAMS : GDX file exchange

Post by Archiver »


Dear Renger,

Yes I have Incorporated the changes you have told into invert.gms, further commenting the invert2.gms call, invert.gms is producing gdx file.

Moreover, I have moved the files to simple directory. E:\GAMS
Still I am getting the same error :

GDXopenReadfailed: E:\GAMS\mygdx1.gdx
MSG: No such file or directory

Is there any such settings I should do in GAMS ?? Or should I reinstall GAMS.


On Monday, February 22, 2016 at 11:04:51 PM UTC+5:30, Renger van Nieuwkoop wrote:

Move the files to a directory with a simpler name (not so many empty spaces) and try again.

Did you add the changes I sent you?

If you comment the “call gams invert2…” line out does invert.gms produce a gdx file?

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 18:12
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



while running one invert.gms in DOS I am getting these errors ( I am attaching a screenshot ).

Yes I have included both the files in project Is there a way to check this out ??







On Monday, February 22, 2016 at 10:19:24 PM UTC+5:30, Renger van Nieuwkoop wrote:

here some things you could try:

check if it runs in a dos window. open one and type gams invert.gms.

did you add the second file to your project?

run the first file without the call of the second file.

Renger



sent from my iPad


On 22 Feb 2016, at 17:13, 'Prateek Mittal' via gamsworld wrote:

Dear Renger,



Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error



GDXopenRead failed E:\.....\mygdx1.gdx

Msg: No such file or directory.



I have opened a new project in this directory and kept both the gms file in the same. Please help !!

On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Prateek



If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:



set i /i1*i4 /;

$gdxout 'mygdx.gdx'

$unload i

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;

execute "gams inverse2.gms";

parameter ainv(i,j);

execute_load 'mygdx1.gdx', ainv;

display ainv;

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 13:05
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.



Thank you

Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Archiver
User
User
Posts: 7876
Joined: 7 years ago

RE: call GAMS from GAMS : GDX file exchange

Post by Archiver »


YOu’re right. This doesn’t work. But can you try to explain again in more detail what you want to do and why it is necessary to do a call of gams (you could just include the invert2.gms:



*Matrix inversion through passed put and loaded GDX file

*Illustrates GAMS call to GAMS



set i /i1*i4 /;

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;



$include invert2.gms



execute_load 'mygdx1.gdx', ainv;

display ainv;



and invert2:



parameter ainv(i,j);

ainv(i,j) = uniform(0,1);

display ainv;

execute_unload 'mygdx1.gdx', ainv;



Renger



From: gamsworld@googlegroups.com [mailto:gamsworld@googlegroups.com]
Sent: Dienstag, 23. Februar 2016 06:14
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Yes I have Incorporated the changes you have told into invert.gms, further commenting the invert2.gms call, invert.gms is producing gdx file.



Moreover, I have moved the files to simple directory. E:\GAMS

Still I am getting the same error :



GDXopenReadfailed: E:\GAMS\mygdx1.gdx

MSG: No such file or directory



Is there any such settings I should do in GAMS ?? Or should I reinstall GAMS.




On Monday, February 22, 2016 at 11:04:51 PM UTC+5:30, Renger van Nieuwkoop wrote:

Move the files to a directory with a simpler name (not so many empty spaces) and try again.

Did you add the changes I sent you?

If you comment the “call gams invert2…” line out does invert.gms produce a gdx file?

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 18:12
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



while running one invert.gms in DOS I am getting these errors ( I am attaching a screenshot ).

Yes I have included both the files in project Is there a way to check this out ??







On Monday, February 22, 2016 at 10:19:24 PM UTC+5:30, Renger van Nieuwkoop wrote:

here some things you could try:

check if it runs in a dos window. open one and type gams invert.gms.

did you add the second file to your project?

run the first file without the call of the second file.

Renger



sent from my iPad


On 22 Feb 2016, at 17:13, 'Prateek Mittal' via gamsworld wrote:

Dear Renger,



Thanks for your time and efforts, I have modified the code as you suggested, still am getting the same error



GDXopenRead failed E:\.....\mygdx1.gdx

Msg: No such file or directory.



I have opened a new project in this directory and kept both the gms file in the same. Please help !!

On Monday, February 22, 2016 at 7:23:21 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Prateek



If I change the invert.gms to (note that you forget to close the table by a semicolon) the following, it runs fine on my computer:



set i /i1*i4 /;

$gdxout 'mygdx.gdx'

$unload i

alias(i,j);

table a(i,i)

i1 i2 i3 i4

i1 2 0 2 1

i2 0 1 1 1

i3 0 0 1 3

i4 1 0 0 1

;

execute "gams inverse2.gms";

parameter ainv(i,j);

execute_load 'mygdx1.gdx', ainv;

display ainv;

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 13:05
To: gamsworld
Subject: Re: call GAMS from GAMS : GDX file exchange



Dear Renger,



Thanks for your reply but still am unable to execute invert2 from invert.gms. I would really appreciate if you can modify the code or else provide me any source or link. One more thing I want to clarify I want to run single file invert.gms and exceute or call invert2,gms in between.



Thank you

Best Regards
Prateek

On Monday, February 22, 2016 at 2:36:26 PM UTC+5:30, Renger van Nieuwkoop wrote:

Hi Mittal



In this case, you have to use the “compile time” version of the gdx command:

$gdxout 'mygdx.gdx'

$unload i

Using the “execute” version means that this command is done during execution time meaning that during compilation time the file mygdx.gdx isn’t generated and not available in the call of invert2.gms (if you run the two files separately, it works because in that case, the file is generated.

Cheers

Renger



From: gams...@googlegroups.com [mailto:gams...@googlegroups.com]
Sent: Montag, 22. Februar 2016 09:22
To: gamsworld
Subject: call GAMS from GAMS : GDX file exchange



Dear GAMS users,



I am trying to call gams file from gams. I have tried to follow the example given in link below,

https://www.gams.com/help/index.jsp?top ... m_gams.htm



I have removed invert1.exe contribution and make it quite simplified. Now main aim is to create a GDX file in one file (invert,gms) and pass its values to another file (invert2.gms) which will further create another GDX file (mygdx1.gdx) with new parameter and call it in first (invert.gms) file. While running the program invert.gms, it is unable to read mygdx1.gdx i.e. program invert2.gms is not being executed from main file. PLEASE HELP !!!

Note: Please find attached gms files, both of them are kept in same directory.







--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

--
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 https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.
Post Reply