To write an MPS file directly from AMPL, use MATLAB API commands like
ampl.setOption('auxfiles','rc');
ampl.eval('write mtest;');
This writes files named test.mps, test.row, and test.col containing the problem in standard MPS format and lists of the row (constraint) and column (variable) names. You can replace 'test' in the above command with any other filename that you like.
(Users of CPLEX or Gurobi can also take advantage of their features for writing files in extended MPS and 'LP' formats.)
Bob Fourer
am...@googlegroups.com
=======