I used the following code:
$call GDXIN merged.gdx
$LOAD PAR1 PAR2 …PAR N
$GDXIN.
On giving the above commands I got not one error but multiple errors.
Thanks once again
On Monday, December 16, 2013 4:12:46 PM UTC+5:30, Renger van Nieuwkoop wrote:
Send the code and error message, otherwise I have no idea what is going wrong.
Renger
Von: gams...@googlegroups.com [mailto:gams...@googlegroups.com] Im Auftrag von jyo padmanabhan
Gesendet: Montag, 16. Dezember 2013 11:41
An: gams...@googlegroups.com
Betreff: Re: Reading data from Excel, but only one column?
Hi Renger
Now that the merged gdx file has been created my next doubt /problem is in calling the file into the model. I tried calling it after the declaration of all sets, parameters and variables just before the equations, still I’m getting error.When do I call this merged file, I mean after what step. Thanks for your continued help.
Jyotsna
On Monday, December 16, 2013 2:38:58 PM UTC+5:30, jyo padmanabhan wrote:
Hi Renger
Thanks it works. The mistake I made was that I used the " " while specifying the file names.
Jyotsna
On Friday, December 13, 2013 2:26:35 PM UTC+5:30, Renger van Nieuwkoop wrote:
Hi Jyotsna
I merged the gdx files with
$call gdxmerge *.gdx
Or
$call gdxmerge capitalq.gdx laborq.gdx cropq.gdx
And got all the data (see attached file).
Don’t know why this isn’t working for you.
Cheers
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of jyo padmanabhan
Sent: Freitag, 13. Dezember 2013 05:59
To: gams...@googlegroups.com
Subject: Re: Reading data from Excel, but only one column?
Hi Renger
Please find attached the files for your reference.
Thanks a lot once again
Jyotsna
On Thursday, December 12, 2013 5:16:25 PM UTC+5:30, Renger van Nieuwkoop wrote:
Hi
For that I would need the code or an example that produces the problem.
Cheers
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of jyo padmanabhan
Sent: Donnerstag, 12. Dezember 2013 09:13
To: gams...@googlegroups.com
Subject: Re: Reading data from Excel, but only one column?
Hi Renger
Thanks a lot.
It works.
But now I have another query, regarding merging multiple gdx files.
I have multiple gdx files for different data inputs for a particular model.
Instead of calling the gdx files from GAMS one by one, I want to merge all the gdx files and call that merged gdx file only once at the beginning of the model.
i I tried usung the “gdxmerge”, but only the dimensions were getting loaded, not the data. Could you please help me out.
Regards
Jyotsna
On Monday, December 9, 2013 2:45:49 PM UTC+5:30, Renger van Nieuwkoop wrote:
Hi Jyotsna
You are importing ACROPYL twice, once with the direct command “par=ACROPYL†and then using the command “Index=…â€. If you delete “par=ACROPYL†and it works fine.
Cheers
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of jyo padmanabhan
Sent: Sonntag, 8. Dezember 2013 14:41
To: gams...@googlegroups.com
Subject: Re: Reading data from Excel, but only one column?
Hi Renger
I’m sending the excel file for your reference.Thanks
Jyotsna
On Sunday, December 8, 2013 12:13:19 AM UTC+5:30, Renger van Nieuwkoop wrote:
Hi Jyotsna
You have a comma instead of a point in the gdx file name. If this not causing the problem, send me the xls file
Cheers
Renger
sent from my iPad
Am 07.12.2013 um 19:14 schrieb “jyo padmanabhan” :
Hi Renger
I read the data from excel using
$ Call gdxxrw.exe i= input.xlsx par=ACROPYL O=ACROPYL,GDX Index=INDEXSH!A4
but I get output gdx file deleted.
*** Duplicate Identifier =ACROPYL.
Could you please help me out solving this problem.I’m not able to identify th e mistake.Looking forward for suggestions.Thanks
Jyotsna
On Tuesday, July 3, 2012 8:50:03 PM UTC+5:30, Renger van Nieuwkoop wrote:
Just define two parameters and read them with two calls of gdxxrw:
$CALL GDXXRW.EXE skudata.xls par=m rng=margin!A1:B1014 Rdim=1 Cdim=0
$CALL GDXXRW.EXE skudata.xls par=n rng=margin!C1:D1014 Rdim=1 Cdim=0
Or define a set for the column names and define one parameter with two dimensions ( m(I, columnamesset)) and delete the set column between the two value columns and read the parameter with
$CALL GDXXRW.EXE skudata.xls par=m rng=margin!A1:C1014 Rdim=1 Cdim=1
Cheers
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Jackson
Sent: Tuesday, July 03, 2012 4:55 PM
To: gams...@googlegroups.com
Subject: Re: Reading data from Excel, but only one column?
Hello Renger,
I seem to have a different problem now. How would I go about reading multiple columns with one set column?
Column 1
Column 2
1
9661.98
1
19484.58471
2
61695.89
2
24140.97804
3
1284.61
3
6188.350606
4
20969.93
4
13397.07451
5
14374.08
5
13668.80667
I tried to add another set label column and used the cell ranges C1:D6, but it will only give me an empty parameter set.
Here’s my code:
Sets
i SKU number /1*1013/;
\
$CALL GDXXRW.EXE skudata.xls par=m rng=margin!A1:B1014 Rdim=1 Cdim=0
Parameters m(i) Margin;
$GDXIN skudata.gdx
$LOAD m
$GDXIN
display m;
\
$CALL GDXXRW.EXE skudata.xls par=c rng=margin!C1:D1014 Rdim=1 Cdim=0
Parameters c(i) Column 2;
$GDXIN skudata.gdx
$LOAD c
$GDXIN
display c;
Thanks,
Jackson
On Tuesday, July 3, 2012 10:08:09 AM UTC-4, Renger van Nieuwkoop wrote:
Keep CDIM=0 and start your range just below your column title, then you don’t need the set a.
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Jackson
Sent: Tuesday, July 03, 2012 4:04 PM
To: gams...@googlegroups.com
Subject: Re: Reading data from Excel, but only one column?
Hello Renger,
Thanks for the advice. I actually figured out that I needed a set label column to match each element for the margin parameter.
However, I’m not sure if I’m doing this correctly. I ended up creating a dummy set:
Sets
i SKU number /1*1013/
a Column entry /Margin/;
\
$CALL GDXXRW.EXE skudata.xls par=m rng=margin!A1:B1014 Rdim=1 Cdim=1
Parameters m(i,a) Margin;
$GDXIN skudata.gdx
$LOAD m
$GDXIN
display m;
This code works and matches up with the set i. But is there a way where I can simply have one set? I don’t want to be creating new dummy sets for each column of data.
Thanks,
Jackson
On Tuesday, July 3, 2012 9:37:53 AM UTC-4, Renger van Nieuwkoop wrote:
Hi Jackson
When you want to read one column you have probably a parameter defined over a set. Something like m(year) and then want to fill this parameter with the data from the excel sheet.
So, you should have two columns: one with the set over which you defined the parameter m and one with the values. You then can just read all the values with your command but the range A2:B1014.
Cheers
Renger
From: gams...@googlegroups.com [mailto:gams...@googlegroups.com] On Behalf Of Jackson
Sent: Tuesday, July 03, 2012 2:50 PM
To: gams...@googlegroups.com
Subject: Reading data from Excel, but only one column?
Hello everyone!
I just started using GAMS today and I am trying to figure out how to input Excel data into GAMS. I’ve gone over some of the GDXXRW example files in the User Guide but I can’t seem to figure out how to only read one whole column from an Excel sheet. I keep getting a “bad data range for symbol m” error.
Here is my code:
Sets
i SKU /1*1013/
\
$CALL GDXXRW.EXE skudata.xls par=m rng=sheet!B2:B1014 Cdim=0 Rdim=1
Parameters m(i) Margin;
$GDXIN skudata.gdx
$LOAD m
$GDXIN
And this is the error I get:
— call GDXXRW.EXE skudata.xls par=m rng=sheet!B2:B1014 Cdim=0 Rdim=1
GDXXRW Mar 17, 2012 23.8.2 WIN 31442.32372 VS8 x86/MS Windows
Input file : C:\Users\jachou\Documents\gamsdir\projdir\skudata.xls
Output file: C:\Users\jachou\Documents\gamsdir\projdir\skudata.gdx
**** Bad data range for symbol m : sheet!B2:B1014
Output gdx file deleted
Any help or advice would be greatly appreciated. Thanks!
\
To view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/6z9qhs7vJLAJ.
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 view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/GtWpqwMfCusJ.
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 view this discussion on the web visit https://groups.google.com/d/msg/gamsworld/-/YUo-0iReUE8J.
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+...@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+...@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+...@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+...@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.