# \[MathOptFormat.jl\] Error when reading MPS file: objective functions with constant terms

**URL:** <https://discourse.julialang.org/t/mathoptformat-jl-error-when-reading-mps-file-objective-functions-with-constant-terms/55683>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [February 20, 2021, 4:17pm UTC](https://discourse.julialang.org/t/mathoptformat-jl-error-when-reading-mps-file-objective-functions-with-constant-terms/55683 "2021-02-20T16:17:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hustkisas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hustkisas/32/22155_2.png) [@hustkisas](https://discourse.julialang.org/u/hustkisas)\
**Post date:** [February 20, 2021, 4:17pm UTC](https://discourse.julialang.org/t/mathoptformat-jl-error-when-reading-mps-file-objective-functions-with-constant-terms/55683/1 "2021-02-20T16:17:56Z")

</div>

The objective function of a math programming problem usually does not have constant terms. But occasionally, MILP models processed by the solvers (CPLEX in this case) have constants in objective functions. When JuMP.read\_from\_file is called, it will produce the following error message:

ERROR: ROW name obj not recognised. Is it in the ROWS field?

This is a message from this file [MathOptFormat.jl/MPS.jl at master · odow/MathOptFormat.jl · GitHub](https://github.com/odow/MathOptFormat.jl/blob/master/src/MPS/MPS.jl)

I have to write codes to remove the constant term in objective from mps files. But it would be nice that MathOptFormat package can handle this (e.g., remove the constants). Thanks!

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [February 20, 2021, 9:31pm UTC](https://discourse.julialang.org/t/mathoptformat-jl-error-when-reading-mps-file-objective-functions-with-constant-terms/55683/2 "2021-02-20T21:31:21Z")

</div>

Thanks for the report, that looks like a bug.

I’ve opened an issue so we can track: [Support objective constants in MPS · Issue #1247 · jump-dev/MathOptInterface.jl · GitHub](https://github.com/jump-dev/MathOptInterface.jl/issues/1247). If you want to start contributing to JuMP, it’s a good first issue to tackle.
