# About sol.retcode

**URL:** <https://discourse.julialang.org/t/about-sol-retcode/99443>\
**Category:** New to Julia\
**Tags:** question, differentialequation\
**Created:** [May 26, 2023, 12:06pm UTC](https://discourse.julialang.org/t/about-sol-retcode/99443 "2023-05-26T12:06:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [May 26, 2023, 12:06pm UTC](https://discourse.julialang.org/t/about-sol-retcode/99443/1 "2023-05-26T12:06:06Z")

</div>

Here I will expect code to print Success but its not doing so. can anyone tell why even when I get solution by ODE system?

```julia
if sol.retcode == :Success
    print("Success")
end

```

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [May 26, 2023, 12:45pm UTC](https://discourse.julialang.org/t/about-sol-retcode/99443/2 "2023-05-26T12:45:07Z")

</div>

about a year ago, this was turned to `sol.retcode == ReturnCode.Success` (i.e. an enum)

---

<div class="post-metadata">

**Author:** ![Sahil\_Khan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sahil_khan/32/47573_2.png) [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Post date:** [May 26, 2023, 12:46pm UTC](https://discourse.julialang.org/t/about-sol-retcode/99443/3 "2023-05-26T12:46:28Z")

</div>

I used this and it works.

```julia
if Symbol(sol.retcode) == :Success
    print("Success")
end

```

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 26, 2023, 12:57pm UTC](https://discourse.julialang.org/t/about-sol-retcode/99443/4 "2023-05-26T12:57:18Z")

</div>

See the documentation:

[https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes](https://docs.sciml.ai/SciMLBase/stable/interfaces/Solutions/#retcodes)

The recommended form is `SciMLBase.successful_retcode(sol.retcode)` since that covers more than just `ReturnCode.Success`.
