Problem Reading Inputs via CSV file

Problems with syntax of GAMS
Post Reply
arvindmarandi
User
User
Posts: 8
Joined: 1 year ago

Problem Reading Inputs via CSV file

Post by arvindmarandi »

Hello Everyone,

I am new to GAMS, and this is my first post.

I am facing a quite annoying problem in GAMS, basically I wanted to input data in the form of Tables.

I have attached the csv file, which is a dummy one exactly resembling my original file.
DC.csv
Input CSV Files
(121.63 KiB) Downloaded 139 times
The GAMS code, I am using to create a gdx file is:

Code: Select all

$call csv2gdx dc.csv id=DC useheader=y index=1,2,3 values=4..lastCol 
I am receiving an error message saying

Code: Select all

*** ErrNr = 20 Msg = Bad UELs (check option "acceptBadUels")
Bad Uel Count = 1, CSV2GDX time = 2ms
If I apply the acceptBadUels=y options, everything is changed of UNDF
Last edited by arvindmarandi 1 year ago, edited 1 time in total.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: Problem Reading Inputs via CSV file

Post by bussieck »

No attachement. Copy and paste into a code section also works. -Michael
arvindmarandi
User
User
Posts: 8
Joined: 1 year ago

Re: Problem Reading Inputs via CSV file

Post by arvindmarandi »

I have attached the document (.csv file) in the previous post. And the codes that I am using to create a gdx file.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: Problem Reading Inputs via CSV file

Post by bussieck »

Sorry, can't reproduce the problem:

Code: Select all

d:\Users\mbussieck\Downloads>csv2gdx dc.csv id=DC useheader=y index=1,2,3 values=4..lastCol
No errors, CSV2GDX time = 47ms
This is with csv2gdx from GAMS 39.2.0. What version did you use?

-Michael
arvindmarandi
User
User
Posts: 8
Joined: 1 year ago

Re: Problem Reading Inputs via CSV file

Post by arvindmarandi »

GAMS Version: 37.1.0

Operating System: Linux (Ubuntu 20.04LTS)

I also like to mention that I am creating the csv file by opening the excel sheet using LibreOffice Calc and
then Saving as CSV file.

I was successfully able to run model libraries examples (those using csv2gdx), they are running perfectly well.

I can not figure it out, where is mistake that I am receiving BadUels errors.
User avatar
bussieck
Moderator
Moderator
Posts: 1037
Joined: 7 years ago

Re: Problem Reading Inputs via CSV file

Post by bussieck »

I ran the same command on Linux with GAMS 37.1.0 and again received no errors. I used exactly your dc.csv. Can you try running the csv2gdx from the command line on this exact file. There is a trace option (e.g. trace=4) that you can set to see more information.

-Michael
Post Reply