error reading table with table handler odbc

2,901 views
Skip to first unread message

Fatemeh R.

unread,
Feb 23, 2012, 4:51:25 PM2/23/12
to AMPL Modeling Language
Hello,
I try to read an excel table. but I get error:
ampl: set FOOD;
ampl: param fmin{FOOD};
ampl: param fmax{j in FOOD}>= fmin[j];
ampl: param cost{FOOD};
ampl: table Foods IN "ODBC" "DIET.xIs": FOOD <- [FOOD], cost, fmin,
fmax;
ampl: read table Foods
Error executing "read_table" command:
Error reading table Foods with table handler odbc:
Cannot open file DIET.xIs for table Foods.

I have windows 7, 64bit. I am using Excel 2007 but I save my files in
*.xls format.
I checked my Ample folder I have ampltabl.dll and my excel file is in
the same folder as my ampl program

Could you please help me what is this error mean?

Robert Fourer

unread,
Feb 24, 2012, 9:33:27 AM2/24/12
to am...@googlegroups.com
It may be that "DIET.xIs" is the wrong name for your file. Normally
spreadsheet files end in "xls" (lower-case "ell") rather than "xIs"
(upper-case "eye"). If that is just an error in the posting, however, and
your actual AMPL statement has the correct filename, then try using the
newer *.xlsx format -- with the newer Windows ODBC drivers that seems to
work better.

Bob Fourer
4...@ampl.com

Fatemeh R.

unread,
Feb 27, 2012, 2:45:01 PM2/27/12
to AMPL Modeling Language
"xIs" was a typo when I pasted the line. I tried xlsx format to. the
error is
Error executing "read_table" command:

Error reading table Foods with table handler odbc:
ODBC is not available.

is it enough to have ampltabl.dll or I should have some thing else to
enable ODBC handler?

Thanks,
Fatemeh

Robert Fourer

unread,
Feb 28, 2012, 12:17:58 PM2/28/12
to am...@googlegroups.com
Looking back at your original post it seems you may be running 64-bit AMPL
with a 32-bit version of Excel. If so you will need to either upgrade to
the 64-bit Excel 2010 or else use the 32-bit version of AMPL. A workaround
for "mixed" combinations of AMPL and Microsoft Office will be announced
soon, but for now it is not possible to use 32-bit Office with 64-bit AMPL
(or vice-versa).

Bob Fourer
4...@ampl.com


> -----Original Message-----
> From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of
> Fatemeh R.
> Sent: Monday, February 27, 2012 1:45 PM
> To: AMPL Modeling Language
> Subject: [AMPL 5521] Re: error reading table with table handler odbc
>
> "xIs" was a typo when I pasted the line. I tried xlsx format to. the
> error is
> Error executing "read_table" command:
>
> Error reading table Foods with table handler odbc:
> ODBC is not available.
>
> is it enough to have ampltabl.dll or I should have some thing else to
> enable ODBC handler?
>
> Thanks,
> Fatemeh
>
> >

victor.z...@gmail.com

unread,
Feb 28, 2013, 12:54:58 PM2/28/13
to am...@googlegroups.com
The reason you get the error is that you are trying to use 64-bit ampltabl.dll with 32-bit tableproxy. You should use a 32-bit version of ampltabl.dll instead and there is no reason to rename anything, AMPL will pick up the correct DLL automatically. The main idea is that the architecture (32-bit or 64-bit) of ampltabl.dll should match the one of tableproxy and the ODBC drivers you are trying to use. Most systems have 32-bit ODBC drivers for Excel available straight away (you don't even need Excel installed).

However, it should be possible to use 64-bit ODBC drivers which can be downloaded for free from http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=13255 in which case you don't need tableproxy at all. You can check if you have 64-bit ODBC drivers installed with a 64-bit version of ODBC Administrator  c:\windows\sysWOW64\odbcad32.exe

HTH,
Victor



On Wed, Feb 27, 2013 at 10:06 PM, a..@lbl.gov <adm...@lbl.gov> wrote:
Hi,
I'm trying to work with a simple AMPL file that needs to load data from Excel and later write the output to Excel.  I'm having a hard time with that and getting the following error:

Error at _cmdno 4 executing "read_table" command
(file ED.ampl, line 27, offset 685):

        Error reading table General with table handler tableproxy:
        Error with proxy table handler:  could not load "ampltabl.dll".

ED.ampl file contains the following at the start of the script:
-------------------------------------------------------------------------------
model ED.mod;
option solver "C:\Program Files\CPLEX_Studio123\cplex\bin\x64_win64\cplexamp";

# Define the tables where the data is located

table General IN 'tableproxy' 'odbc' 'ED.xlsx': [], Tend, LsPen;
table Generators IN 'tableproxy' 'odbc' 'ED.xlsx': [GEN], Kmax, MC;
table Load IN 'tableproxy' 'odbc' 'ED.xlsx': [T], L, V;
 
# Import the data from the tables

read table General;
read table Generators;
read table Load;

solve;
--------------------------------------------------------------

Based on earlier posts, I've checked a few things with my system:
- I am running 64-bit AMPL on Windows Server 2008
- I am using 32-bit version of Excel
- I downloaded a 64-bit version of ampltabl.dll from here and renamed the file from ampltabl.dll, then put it in the same folder as ampl.exe
- I downloaded tableproxy32.exe and tableproxy64.exe from here and also put those in the same folder as ampl.exe. 

Any suggestions?  One thing I have not tried is reinstalling Office 2010 as a 64-bit version.  If that would solve the problem, then I am open to doing it, but I was hoping for an easier fix.

Thanks!

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Robert Fourer

unread,
Mar 1, 2013, 9:55:37 AM3/1/13
to am...@googlegroups.com

To connect to 32-bit Excel or Access from 64-bit AMPL, put the following 3 files into your AMPL folder:

 

   ampltabl.dll

   ampltabl_64.dll

   tableproxy32.exe

 

To get ampltabl.dll you will need to copy it out of the 32-bit AMPL distribution.  The other two files are from the 64-bit AMPL distribution.  (But you don't want tableproxy64.exe from the 32-bit distribution.)

 

Then substitute 'tableproxy' 'odbc' for 'ODBC' in your table statements, for example

 

   table General IN 'tableproxy' 'odbc' 'ED.xlsx': ...

 

(which I believe you have already done).  This has been tested to work properly, without any need for manual "load" statements or other adjustments.

 

Bob Fourer

4...@ampl.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of a..@lbl.gov
Sent: Thursday, February 28, 2013 11:06 PM
To: am...@googlegroups.com
Subject: Re: [AMPL 6698] Re: error reading table with table handler odbc

 

Thanks for the quick response:

I see that I'm a bit confused about how AMPL handles these different dll's and the tableproxy, so thanks for your patience.

I downloaded the 32-bit ampltabl.dll file and returned the 64-bit to its original naming (ampltabl_64.dll).  Now when I run the script I get the following error:

Error at _cmdno 5 executing "read_table" command
(file ED.ampl, line 25, offset 640):

        Error reading table General:
        no acceptable table handler found.

When I type:
ampl: display _HANDLERS;

I get the following response:
set _HANDLERS := tab bit; 

If I type:
ampl: load 'C:\Program Files\AMPL\ampltabl.dll';

Then I get:
Error executing "load" command:
Cannot load library C:\Program Files\AMPL\ampltabl.dll.

Presumably this is because I am running 64-bit AMPL and this is a 32-bit dll.

So if I then type:
ampl: load 'C:\Program Files\AMPL\ampltabl_64.dll';

ampl: display _HANDLERS;


I get:
set _HANDLERS := tab bit odbc tableproxy;

Progress!
So I added that line " load 'C:\Program Files\AMPL\ampltabl_64.dll';" to my script and run it again and now get the following:

Error at _cmdno 5 executing "read_table" command
(file ED.ampl, line 26, offset 686):



        Error reading table General with table handler tableproxy:
        Error with proxy table handler:  could not load "ampltabl.dll".



That doesn't work either (and is infact the same error as I had seen earlier when I renamed the 'ampltabl_64.dll' file to 'ampltabl.dll'; but this time the 32-bit version is now named ampltabl.dll and the 64-bit version is ampltabl_64.dll) .

Two questions then:
(1) Why does ampltabl.dll fail to load automatically or even after I manually try to load it?
(2) Why does AMPL look for ampltabl.dll after I loaded ampltabl_64.ampl?

Again I think this has to do with the mismatch between 32-bit and 64-bit, so I should just try to get everything to work in 64bit.

Just out of curiosity, if I then remove the 'tableproxy' in the table creation commands in the script and run it again, I get:
Error at _cmdno 5 executing "read_table" command
(file ED.ampl, line 26, offset 649):

        Error reading table General with table handler odbc:
        ODBC is not available.


This probably indicates that AMPL is working with the ampltabl_64.dll fine, but that it is unable to communicate with the 32-bit ODBC drivers currently on the machine.

The next step I tried was to install the 64-bit ODBC drivers that you provided the link to.  When I started that install, however, Windows saw that I already had 32-bit office installed and said I needed to remove that before installing the 64-bit ODBC driver. 

So I am back to simply reinstalling all of my Office software in the 64-bit version.  Based on these results, do you see anything else I could try before doing the re-installation?  Thanks.

-A

 

Message has been deleted

Robert Fourer

unread,
May 29, 2013, 7:26:47 PM5/29/13
to am...@googlegroups.com

It appears that the "ampltabl.dll" that comes with the 64-bit AMPL distribution is not the right one.  We're in the process of deleting or fixing it, but meanwhile if you download "ampltabl.dll" from the 32-bit AMPL distribution and put that in your folder with the other AMPL files instead, you should not get this error message.

 

Also note that, for greatest reliability, it's best to use the .xlsx form of Excel files with this arrangement.

 

Bob Fourer

am...@googlegroups.com

 

 

From: am...@googlegroups.com [mailto:am...@googlegroups.com]

On Behalf Of p.alc...@gmail.com
Sent: Tuesday, May 28, 2013 5:10 PM
To: am...@googlegroups.com
Cc: 4...@ampl.com
Subject: Re: [AMPL 7067] Re: error reading table with table handler odbc

 

Dear Bob:

Hi,

I´m just starting with AMPL, and trying to learn how to read data from Excel.

 

I'm having the same trouble as the guys above, trying to connect to 32-bit Excel from 64-bit AMPL. Same as them, I got the error message:

 Error reading table Student with table handler odbc:
 ODBC is not available.

 

I downloaded the tableproxy32.exe file and made sure that the 3 files you mention above are in the folder. I also substituted 'tableproxy' 'odbc' for 'ODBC' in my table statements.

Then, the error message changed:

 Error reading table Student with table handler tableproxy:


 Error with proxy table handler:  could not load "ampltabl.dll".

 

But I already made sure that file is in the folder. What should I do next? Do I need to load something manually?

 

Many thanks for your help,

Pilar.

 

Robert Fourer

unread,
Jun 3, 2013, 10:49:12 AM6/3/13
to am...@googlegroups.com
The 64-bit AMPL distribution has been updated to fix the problem with
ampltabl.dll. To use 32-bit Office with 64-bit AMPL, you can now follow the
directions in the Microsoft Windows section at www.ampl.com/NEW/TABLES.

Bob Fourer
am...@googlegroups.com



yih...@gmail.com

unread,
Sep 9, 2014, 10:38:14 PM9/9/14
to am...@googlegroups.com, 4...@ampl.com
Try to read in the table using "tab" format. It did not get through with the following error message. 
Error executing "read_table" command:

Error reading table diet with table handler tab:
Error reading file diet.tab:
early end of file on partial line 10.

victor.z...@gmail.com

unread,
Sep 10, 2014, 11:44:42 AM9/10/14
to am...@googlegroups.com
Looks like the file diet.tab you are trying to read is in incorrect format (possibly a missing newline at the end of file or an incomplete file).

HTH,
Victor

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

YIHSU CHEN

unread,
Sep 10, 2014, 3:13:34 PM9/10/14
to am...@googlegroups.com
Thanks. it works. 
i am using the example from the book. 
one more q: 
what is "ampl.tab 1 3" referring to at the top of the tab file? 

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/wUgDrqZ_PmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.

victor.z...@gmail.com

unread,
Sep 10, 2014, 3:46:27 PM9/10/14
to am...@googlegroups.com
The .tab file format is described at the end of the RELATIONAL DATABASE ACCESS page, quoting:

In the first line, ampl.tab identifies this as an AMPL relational table text file, and is followed by the numbers of key and non-key columns, respectively.

HTH,
Victor

YIHSU CHEN

unread,
Sep 11, 2014, 8:30:52 AM9/11/14
to am...@googlegroups.com
Hi all;

I could use some help here. I'm trying to read a table with t1 and t2 jointly and uniquely define A & B. The first few rows of the data look like:

ampl.tab 2 2
t1 t2 A B
1 3001 0.120812235 0.120812235
1 3002 0.130329328 0.130329328
1 3008 0.850026083 0.850026083
1 3010 0.007126985 0.007126985
2 3011 0.065337694 0.065337694
2 3013 0.000310792 0.000310792
2 3014 0.011752274 0.011752274
2 3019 2.221158325 2.221158325
2 3025 0.016497328 0.016497328

However, I'm getting error message as follows when reading the table. 


ampl: read table exp;                                                           
Error executing "read_table" command:

Error reading table exp with table handler tab:
Error reading file exp.tab:
Too many fields on line 3.

any thoughts? thanks a lot. 

victor.z...@gmail.com

unread,
Sep 11, 2014, 11:58:13 AM9/11/14
to am...@googlegroups.com
I don't see any errors in the .tab file. In fact, the following code works:

set S dimen 2;
param A{S};
param B{S};
table test: S <- [t1, t2], A, B;
read table test;
display A, B;

and prints

:             A             B         :=
1 3001   0.120812      0.120812
1 3002   0.130329      0.130329
...
;

where test is a table referring to the test.tab file with the content copied from your email.

Maybe if you attach the .tab file rather than copy its content in the email, it will help to reproduce the issue. Also it might be useful to see your table declaration.

HTH,
Victor


YIHSU CHEN

unread,
Sep 11, 2014, 2:28:01 PM9/11/14
to am...@googlegroups.com
Victor;

Thank you so much for help. I attached the mod and tab file with this e-mail. The error message is when trying to read the table. 


read table CA2014ampl: 0822tab; 
Error executing "read_table" command:

Error reading table CA20140822tab with table handler tab:
Error reading file CA20140822tab.tab:
Too many fields on line 3.


--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/wUgDrqZ_PmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
model.txt
CA20140822tab.tab

victor.z...@gmail.com

unread,
Sep 11, 2014, 2:33:48 PM9/11/14
to am...@googlegroups.com
Looks like you have extra tabs at the end of several lines in the .tab file including line 3.

HTH,
Victor

YIHSU CHEN

unread,
Sep 11, 2014, 3:04:01 PM9/11/14
to am...@googlegroups.com
great!! those are tricky. 
is there anyway to change the table name to be different from the file name?  

victor.z...@gmail.com

unread,
Sep 11, 2014, 4:05:52 PM9/11/14
to am...@googlegroups.com
Here's the description of the 'tab' table handler:

ampl: print _handler_desc['tab'];  
Builtin file.tab (ASCII table) handler: at most one string
(the file name, ending in ".tab") expected before ":[...]";
table_name.tab is assumed if there are no strings.

So you should be able to specify a different file name as in the following example:

table CA20140822tab IN "test.tab": S <- [uimplan,  vimplan], SAMimplan;

HTH,
Victor


YIHSU CHEN

unread,
Oct 6, 2014, 8:36:24 AM10/6/14
to am...@googlegroups.com
Thanks. Victor;

Continue having trouble with the following error message:
Error reading table implan:
no acceptable table handler found.

My code

table implan IN "CA20140828tab": [I, J], imp;

read table implan; 


in dat file:
let I := {1..440} union {3001..3440} union {5001,6001,7001, 8001} union {10001..10009} union {11001..11003} union {12001..12003} union {13001, 14001, 14002, 25001,28001};
let J := {1..440} union {3001..3440} union {5001,6001,7001, 8001} union {10001..10009} union {11001..11003} union {12001..12003} union {13001, 14001, 14002, 25001,28001};

in mod:

param imp{I,J};
set I; # IMPLAN sectors
set J; # IMPLAN sectors





sample.tab

Robert Fourer

unread,
Oct 6, 2014, 11:25:47 AM10/6/14
to am...@googlegroups.com
You need to name your table file "CA20140828.tab" rather than "CA20140828tab" in order for AMPL to recognize the file type and find a suitable table handler.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Monday, October 6, 2014 12:55 AM
To: am...@googlegroups.com

YIHSU CHEN

unread,
Oct 23, 2014, 5:54:48 PM10/23/14
to am...@googlegroups.com
Victor;

Thank you're so much for helping me with the data import last time. 

I could use your expertise as well as a fresh pair of eyes on this one as well. I attached with this email four files, dat, mod, run and tab file. The run file is a bit of sophisticated. It takes data from tab, balance, calibrate and run it.  But, what happened is that once I run it using "include CGE-CA20140828.run;" in the command line. It exited ampl directly without producing anything. I've gone through the code to see if any command might trigger this, but I cannot find any… Will you mind take a quick look at this? Thank you so much. 

Thanks. 

Yihsu

On Wed, Sep 10, 2014 at 8:44 AM, victor.z...@gmail.com <victor.z...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/wUgDrqZ_PmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
CGE-CA20140828.run
CGE-CA20140828.mod
CA20140822.tab
CGE-CA20140828.dat

victor.z...@gmail.com

unread,
Oct 23, 2014, 6:41:43 PM10/23/14
to am...@googlegroups.com
The problem is in lines 280 - 281:

# subject to eqpqd{i in Uact}: # market clearing cond. for comp. good
q[i]    = xp[i] +xg[i] +xv[i] +sum{j in Uact} x[i,j];

The first line of the constraint is commented out while the second is not.

The AMPL translator should have reported a syntax error here, so we'll look into this issue in more details. In the meantime, commenting (or uncommenting) both lines of the constraint should solve the problem.

Thanks for the bug report,
Victor

YIHSU CHEN

unread,
Oct 27, 2014, 9:21:46 AM10/27/14
to am...@googlegroups.com
Thanks. I will probably never be able to find this myself. Thanks. very grateful. 

Another issue that I am currently working on. I have something like following in my dat file.  The biofuel.xls is also attached. 


table DistFPCorn IN "odbc" "Biofuel.xls" "DistFP":
   [fc ~ Corn], {p in 1..28} <D_FP['cornstover', fc, p] ~ (p)>;

table DistFPForest IN "odbc" "Biofuel.xls" "DistFP":
   [fc ~ Forest], {p in 1..28} <D_FP['forest', fc, p] ~ (p)>;
read table DistFPCorn;
read table DistFPForest;

Here goes the error message. Any thought? 

Error at _cmdno 1 executing "read_table" command
(file Biofuel.dat, line 197, offset 3204):

Error reading table DistFPCorn:
no acceptable table handler found.

Thanks a billion!
Biofuel.xls

victor.z...@gmail.com

unread,
Oct 27, 2014, 7:06:54 PM10/27/14
to am...@googlegroups.com
Usually this error means that you are trying to use 64-bit AMPL with 32-bit ODBC drivers. If this is the case, then you need to use tableproxy as described here: http://www.ampl.com/NEW/TABLEPROXY/

HTH,
Victor

YIHSU CHEN

unread,
Oct 28, 2014, 12:23:35 PM10/28/14
to am...@googlegroups.com
This might be why:
ampl: display _HANDLERS;
set _HANDLERS := tab bit;
any suggestion of how to proceed from here to allow odbc connector? 

and install dmg but did not where to go from here on… 

YIHSU CHEN

unread,
Oct 28, 2014, 12:24:32 PM10/28/14
to am...@googlegroups.com

just tried it still did not work. 

table DistFPCorn IN "tableproxy" "odbc" "Biofuel.xls" "DistFP":
   [fc ~ Farmer], {p in 1..28} <D_FP['cornstover', fc, p] ~ (p)>;

table DistFPForest IN "tableproxy" "odbc" "Biofuel.xlsx" "DistFP":
   [fc ~ Farmer], {p in 1..28} <D_FP['forest', fc, p] ~ (p)>;
read table DistFPCorn;
read table DistFPForest;

but given below… i thought that there are only two types of links work: tab and bit, but no obdc. 


 ampl: display _HANDLERS;
set _HANDLERS := tab bit;

victor.z...@gmail.com

unread,
Oct 28, 2014, 12:33:07 PM10/28/14
to am...@googlegroups.com
Looks like you don't have ampltabl.dll. You can download one from http://www.ampl.com/NEW/TABLEPROXY/, extract into the directory containing the ampl executable and restart ampl.

However, Microsoft doesn't provide the Excel ODBC driver for OS X. Please see this thread: https://groups.google.com/d/msg/ampl/8sne3XHNUlw/qKN-CfxP_z8J

HTH,
Victor

YIHSU CHEN

unread,
Nov 3, 2014, 10:22:11 AM11/3/14
to am...@googlegroups.com
i thought that might be problem with lic so I login to the site and found out that 

You have a floating license with current maintenance for ampl, cplex*, gurobi*, knitro, minos, and xpress*.
*Expiring 20150731.

You also have an expired trial floating license for ampl and knitro.


I'm not sure why the "trial" floating lic for ampl and knitro is expired?  Any thought? I thought my lic will not expire until 7/31/2015 or the school server has patched over the old one yet? 


On Sun, Nov 2, 2014 at 9:14 PM, YIHSU CHEN <yih...@gmail.com> wrote:
Victor;

Try to copy file ampltabl.dll into /usr/local/bin/ampl
but somehow it causes another problem with error message for my "FLOATING LICENCE"

-bash: /usr/local/bin/ampl: Permission denied

Any thought? 

On Mon, Oct 27, 2014 at 4:06 PM, victor.z...@gmail.com <victor.z...@gmail.com> wrote:

YIHSU CHEN

unread,
Nov 3, 2014, 10:22:12 AM11/3/14
to am...@googlegroups.com
Victor;

Try to copy file ampltabl.dll into /usr/local/bin/ampl
but somehow it causes another problem with error message for my "FLOATING LICENCE"

-bash: /usr/local/bin/ampl: Permission denied

Any thought? 
On Mon, Oct 27, 2014 at 4:06 PM, victor.z...@gmail.com <victor.z...@gmail.com> wrote:

victor.z...@gmail.com

unread,
Nov 3, 2014, 10:46:46 AM11/3/14
to am...@googlegroups.com
Looks like you have replaced the ampl executable /usr/local/bin/ampl with the dynamic library ampltabl.dll. You should place ampltabl.dll in the same directory as ampl or somewhere on the search path instead. Now you should also restore the ampl executable by downloading it and unpacking to /usr/local/bin/ampl replacing the broken version.

HTH,
Victor

Robert Fourer

unread,
Nov 3, 2014, 10:50:39 AM11/3/14
to am...@googlegroups.com
You can ignore the message about the trial license, as it only refers to a limited-time trial license (which was requested in 2011). The important message is the one that begins, "You have a floating license with current maintenance for ampl ..." -- this confirms that you're current for AMPL and all the listed solvers.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Sunday, November 2, 2014 11:20 PM
To: am...@googlegroups.com

YIHSU CHEN

unread,
Feb 11, 2015, 6:02:19 PM2/11/15
to am...@googlegroups.com
Victor;
Hope all goes well. 
I'm having a very simple but strange problem with my very simple LP program. 
In particular, I cannot get the value of the objective right. 
Solving the model should give me the totalcost of 325793200, but when I displayed it, it gave me 325793000. The difference is 200. 
Any idea? 


On Wed, Sep 10, 2014 at 8:44 AM, victor.z...@gmail.com <victor.z...@gmail.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/wUgDrqZ_PmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+uns...@googlegroups.com.
LP_dispatch.dat
LP_dispatch.mod
LP_dispatch.run

victor.z...@gmail.com

unread,
Feb 11, 2015, 6:40:52 PM2/11/15
to am...@googlegroups.com
You might need to set a smaller optimality tolerance value before solve:

  option cplex_options 'optimality=1e-9';


HTH,
Victor

Robert Fourer

unread,
Feb 11, 2015, 6:49:55 PM2/11/15
to am...@googlegroups.com
If you are using "display" to show the objective value, then by default it rounds to 6 significant digits, which would be consistent with seeing 325793000 rather than 325793200. If this is relevant then setting "option display_precision 7;" will give you 325793200.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Wednesday, February 11, 2015 2:38 PM
To: am...@googlegroups.com

YIHSU CHEN

unread,
Feb 11, 2015, 9:38:44 PM2/11/15
to am...@googlegroups.com
Thanks. By 6-digit, you meant "3257893" right?  Thanks. 

Robert Fourer

unread,
Feb 12, 2015, 1:58:33 PM2/12/15
to am...@googlegroups.com
If you think of 325793200 as a floating-point number, then it is 3.257932 x 10^8, and you can see that 7 digits are needed to express it. When "display" rounds it to 6 significant digits it becomes 3.25793 x 10^8, which is 325793000.

YIHSU CHEN

unread,
Feb 12, 2015, 4:04:31 PM2/12/15
to am...@googlegroups.com
great!

YIHSU CHEN

unread,
May 6, 2015, 10:26:50 AM5/6/15
to am...@googlegroups.com
Victor;

I am using PATH to solve a LCP.  It stopped with an error message:

Other error
Not sufficient progress. 

Any suggestions on what to change in options to see if it might work? 
Thanks. 

Yihsu

On Wed, Sep 10, 2014 at 8:44 AM, victor.z...@gmail.com <victor.z...@gmail.com> wrote:
Looks like the file diet.tab you are trying to read is in incorrect format (possibly a missing newline at the end of file or an incomplete file).

HTH,
Victor
On Tue, Sep 9, 2014 at 7:38 PM, <yih...@gmail.com> wrote:
Try to read in the table using "tab" format. It did not get through with the following error message. 
Error executing "read_table" command:

Error reading table diet with table handler tab:
Error reading file diet.tab:
early end of file on partial line 10.

On Monday, June 3, 2013 7:49:12 AM UTC-7, AMPL Optimization wrote:
The 64-bit AMPL distribution has been updated to fix the problem with
ampltabl.dll.  To use 32-bit Office with 64-bit AMPL, you can now follow the
directions in the Microsoft Windows section at www.ampl.com/NEW/TABLES.

Bob Fourer
am...@googlegroups.com



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.

To post to this group, send email to am...@googlegroups.com.
Visit this group at http://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

victor.z...@gmail.com

unread,
May 6, 2015, 7:18:59 PM5/6/15
to am...@googlegroups.com
I'm not sure how to address this error. Perhaps someone more familiar with PATH can comment or you can contact the solver authors. Please see http://pages.cs.wisc.edu/~ferris/path.html for their contact information.

HTH,
Victor

YIHSU CHEN

unread,
Oct 27, 2015, 8:55:02 AM10/27/15
to am...@googlegroups.com
hi all;

I am solving a mixed integer problem with the following error message:

ampl: include GL2010MILP_firms.run;

CPLEX 12.6.2.0: integer unbounded ray.

336 MIP simplex iterations

0 branch-and-bound nodes


I thought there is a finite number of combination of integer variables and unbounded ray is not likely according to previous posted message.  Any comments will be helpful. 

Thanks. 

Robert Fourer

unread,
Oct 28, 2015, 11:24:03 AM10/28/15
to am...@googlegroups.com
If all of the integer variables of a mixed-integer program have finite lower and upper bounds, then there can't be an integer unbounded ray in which some integer variables go to infinity. However there can be an unbounded ray in which the integer variables stay fixed, but some of the continuous variables go to infinity; CPLEX will also report "integer unbounded ray" in this situation.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Monday, October 26, 2015 10:12 PM
To: am...@googlegroups.com

YIHSU CHEN

unread,
Oct 28, 2015, 1:15:05 PM10/28/15
to am...@googlegroups.com
Thanks. Those are binary so the bounds are obvious. I will look into more details.  

YIHSU CHEN

unread,
Oct 29, 2015, 3:18:47 PM10/29/15
to am...@googlegroups.com
Thanks Rob. 
Here is another error message that I got when running knitro.  I cannot find useful info from the group so I am seeking your suggestion again.  The error message is as follows, and any suggestions will be useful:

ampl: include GL2010MPEC_firms.run;


Presolve eliminates 23 constraints and 8 variables.

Substitution eliminates 8 variables.

"option presolve 1;" used.

Adjusted problem:

36 variables:

9 nonlinear variables

27 linear variables

31 constraints, all linear; 97 nonzeros

11 equality constraints

20 inequality constraints

20 complementarity conditions among the constraints:

20 linear, 0 nonlinear.

1 nonlinear objective; 9 nonzeros.


KNITRO 8.1.1: 6 linear definitional constraints eliminated (14 fills)

2 nonlinear definitional constraints eliminated

2 unused

Nonsquare complementarity system:

31 complementarities including 11 equations

36 variables

error running knitro:

termination code 11

Robert Fourer

unread,
Oct 30, 2015, 8:08:01 PM10/30/15
to am...@googlegroups.com
The "termination code 11" message has appeared occasionally with KNITRO and other solvers and may indicate a crash that occurred without any useful information returned. Since you are using version 8.1.1, which is about 3 years old, it is not possible to get a fix for your version. Tomorrow (October 31) we will release KNITRO version 10 for AMPL, so we suggest downloading that version to test on your problem. If you still get an error message, then let us know and we can work with you to file a bug report.

YIHSU CHEN

unread,
Oct 31, 2015, 10:59:07 PM10/31/15
to am...@googlegroups.com
The same error as well. 

Knitro 10.0.0: 6 linear definitional constraints eliminated (14 fills)

2 nonlinear definitional constraints eliminated

2 unused

Nonsquare complementarity system:

31 complementarities including 11 equations

36 variables

error running knitro:

termination code 11

Robert Fourer

unread,
Nov 1, 2015, 8:36:37 AM11/1/15
to am...@googlegroups.com
Thanks for running this again with KNITRO 10. This confirms that there is a bug of some kind, most likely in the handling of complementarity constraints. Would you be able to send to sup...@ampl.com some files that we could use to reproduce this behavior on our computers? Then we can communicate with the KNITRO developers to get this fixed.

YIHSU CHEN

unread,
Nov 1, 2015, 11:07:20 AM11/1/15
to am...@googlegroups.com
Thanks Rob. 
Those are three files, mod, dat and run, that are associated with error message. 
yours,
yihsu

GL2010MPEC_firms.mod
GL2010MPEC_firms.run
GL2010MPEC_firms.dat

YIHSU CHEN

unread,
Nov 2, 2015, 9:47:39 AM11/2/15
to am...@googlegroups.com
Vic;
As requested. 
Yihsu
ampl.txt

victor.z...@gmail.com

unread,
Nov 3, 2015, 10:46:12 AM11/3/15
to am...@googlegroups.com
Thanks for providing additional info. As I wrote in a separate email baron doesn't have executable permissions on your machine which causes the error.

HTH,
Victor

You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.

Robert Fourer

unread,
Nov 4, 2015, 11:33:33 AM11/4/15
to am...@googlegroups.com
We're writing to let you know that progress is being made on the AMPL-KNITRO bug that you reported. It is associated with situations where a defined variable (such as flow) appears in a complementarity constraint. We will announce when a fix is available.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Sunday, November 1, 2015 9:42 AM
To: am...@googlegroups.com
Subject: Re: [AMPL 10893] Re: error reading table with table handler odbc

Those are three files, mod, dat and run, that are associated with error message.

Robert Fourer

unread,
Nov 6, 2015, 1:50:21 PM11/6/15
to am...@googlegroups.com
We have revised AMPL so that it does not cause the reported error. With the example given, we get the following report from KNITRO:

ampl: include GL2010MPEC_firms.run
6 linear definitional constraints eliminated (14 fills)
2 nonlinear definitional constraints eliminated
2 unused

Presolve eliminates 23 constraints and 8 variables.
Substitution eliminates 8 variables.
"option presolve 1;" used.
Adjusted problem:
36 variables:
9 nonlinear variables
27 linear variables
31 constraints, all linear; 98 nonzeros
11 equality constraints
20 inequality constraints
20 complementarity conditions among the constraints:
20 linear, 0 nonlinear.
1 nonlinear objective; 9 nonzeros.

Knitro 10.0.0: Nonsquare complementarity system:
31 complementarities including 11 equations
36 variables
Locally optimal solution.
objective 1746.797204; feasibility error 5.32e-13
69 iterations; 76 function evaluations

The updated AMPL binaries can be downloaded from http://www.ampl.com/dl/ampl-download.html.

Bob Fourer
am...@googlegroups.com

=======

From: am...@googlegroups.com [mailto:am...@googlegroups.com] On Behalf Of YIHSU CHEN
Sent: Sunday, November 1, 2015 9:42 AM

YIHSU CHEN

unread,
Nov 6, 2015, 8:35:58 PM11/6/15
to am...@googlegroups.com
Thanks. 

Reply all
Reply to author
Forward
0 new messages