ASNA Generates First-Class C# from RPG with Encore
August 2, 2023 Alex Woodie
ASNA this summer unveiled a new version of Monarch, its flagship offering for migrating RPG applications to .NET Core. The big new deliverable with Monarch 11 is the introduction of Encore RPG, which enables IBM i shops to convert their RPG directly into usable C# source code. The new product will help IBM i shops with aging RPG programmers make the gradual transition to C#, ASNA says.
ASNA originally launched Monarch way back in 2004 as a mechanism for converting RPG code into a language supported in Microsoft’s .NET Framework (Microsoft replaced the .NET Framework with .NET Core back in 2020). ASNA has always played the Microsoft language angle, going back to its heyday with ASNA Visual RPG (AVR), which is an RPG compiler for Microsoft’s Visual Studio, so Monarch was a natural evolution for the longtime IBM i software provider.
The original version of ASNA’s Monarch supported two language targets for RPG III or RPG IV code: AVR and C#. AVR in effect provided an RPG-to-RPG experience, with the caveat that the AVR code could be compiled to run on Windows. But the support for C# generation was more of an afterthought than a fully supported language, says ASNA Product Evangelist Roger Pence.
“The original Monarch for .NET FW [framework] does target both ASNA Visual RPG (AVR) FW and C# FW,” Pence tells IT Jungle via email. “However, C# was bolted onto Monarch FW later and didn’t offer the first-class dev experience that targeting AVR offered.”
With version 11 of the product, ASNA is refining its generation of C# code, with the idea that customers can cut their ties with RPG permanently and move forward with C# source code that they can compile to run with .NET Core.
That little trick is delivered via the introduction of Encore RPG, which is one part syntax and one part migration software. Encore RPG uses syntax derived from AVR, and gives users two options: create binary AVR code that’s executable in .NET Core, or create C# source code.
The C# code generated by Encore is “modern, remediated, ready-for-production,” Pence says. That’s in contrast to the C# code generated by the previous version of Monarch. “Monarch .NET could convert an AVR migrated project to C#,” he says, “but it was, well, painful at a later stage,” requiring special tooling and debugging tools to work with.
When ASNA was creating the first version of Monarch for .NET Core a couple of years ago, it contemplated leaving AVR generation out of the new product entirely. “Given that the biggest driver to migration is RPG programmer fade, we didn’t think an AVR FW target would be considered strategic by any prospect,” Pence says.
However, as ASNA started testing an early version of Encore in Monarch for .NET Core with customers, the feedback it received surprised company officials, and caused it to change course and keep AVR generation in the new Encore product.
“We were stunned to hear many prospects say, ‘Because of RPG programmer fade, we need to migrate our RPG estate application to .NET. But . . . we don’t want to migrate to C# initially. We want to migrate to RPG on .NET first and then later to C# Core,’” Pence says.
The support for AVR and C# gives Monarch customers more flexibility in how they move their RPG applications forward, and who does the forwarding. To that end, Encore supports the IBM i customer that wants to take the stepwise migration to C# from RPG, as well as the IBM i shop that wants to move directly to C#.
It’s the best of both worlds, Pence says.
“For many shops, the fading RPG team has three to five years left to work and migrating to RPG is strategic – at least for those remaining years,” he says. “The RPG programmers can help remediate the migrated applications in AVR (which they will intrinsically understand) and, post-migration, work with the C# programming team introducing RPG business logic, bugs, work-arounds, and whatever other communal topics need to be transferred. In three to five years, these shops want to press a button and boom, turn that AVR into C#.”
Encore may eventually replace AVR in the Monarch product, but it’s not ready to take that role at this point, Pence says. “The biggest difference from AVR FW is that Encore cannot produce Windows applications,” he says. “We currently don’t have plans to package Encore as its own stand-alone product. Its initial focus and purpose now is to facilitate RPG application migrations.”
On the user interface front, Monarch 11 supports the creation of HTML5 pages, powered by ASP.NET Core and Razor pages. Razor pages are basically the Microsoft .NET Core replacement for the original Web UI/presentation model in .NET Framework, Pence says.
Monarch 11 is available now. For more information, see www.asna.com.
RELATED STORIES
ASNA Dips Its New ‘Wings’ Into OAR Waters
Please include an outline of the scope / limits of the migration possibilities (to be informative to the reader…. ok and fine if that is sponsored content… but at least one can have an idea).
RPG is also a runtime with strong ties to the application server (that exposed a lot of services).
Say that I have a simple RPG reading from a dataqueue, write a simple log file with attached triggers, that then spool a simple printout barcode to a queue load balanced between 3 physical printers (for fault tolerance). Say 30 lines of code with a basic use of the system.
How can one migrate such basic PGM? all the IBMi system (that provides a lot of services) is reimplemented in C#?
IMHO there are two options to the mythical RAD (“Retiring AS400 Dude”) issue:
– hire and train another 😉 keep the platform engaging (now you have a single problem)
– convert all to C# (now you have two problems) 😉
the easiest path? you choose.