Guru: MiWorkplace As An Alternative To SEU
March 13, 2017 Jon Paris
From time to time somebody will recommend an application to me and it sounds really useful – until I discover that it is Windows Only. Whenever that happens I usually go to one of the Alternative To websites, such as AlternativeTo.net, to see what I can find.
Recently I was asked if there were any alternatives to SEU by a programmer who wanted to use fully free RPG and was tired of the green screen blobs all over his code. (See the example below if you don’t know what I mean by this.) This was a topic that the Alternative websites were not able to help me with.
The obvious alternative is, of course, IBM’s RDi tool. I have been paying for and using RDi for years and personally believe that it more than pays for itself in productivity. However, I know that some RPGers have trouble justifying the cost to their management. There are a number of programming editors that can be “persuaded” to work with RPG source, but to my knowledge, other than IBM’s RDi, the only one that is specifically targeted at the RPG programmer is the Eclipse-based MiWorkplace editor. It is not free, but at € 27,50 (roughly $30 U.S. at today’s exchange rate) for a one-year license, it is very inexpensive. It also allows for a free trial period before purchasing. So, what have you got to lose?!
This story contains code, which you can download here.
Versions are available for Windows, Linux, and Mac, so just about any desktop you are likely to be using is covered. I downloaded the Mac version and this tip is the result of my preliminary explorations.
Before I begin, I should perhaps explain why this programmer was having problems. In essence, this is the result of SEU not having been updated since V6.1.
Some of you may be thinking that IBM will eventually get round to fixing this – but you’d be wrong. IBM has stated unequivocally that SEU will remain frozen at its V6.1 level. No enhancements; bug fixes only.
SEU, therefore, does not have a clue what a Dcl-s means. Not only does this result in the kind of mess you see above, but you also have to fight with SEU when you want to exit, as it always wants to return to editing so that you can fix your errors. Of course, you could turn off syntax checking but that is not much of a solution.
Installation And First Steps
Begin by downloading the appropriate package for your desktop from the MiWorkplace (MiW) website. There is no install program. You simply unzip the download contents to your desired folder. Since this is a Java-based application, it will run directly from within this folder. Any desktop shortcuts, etc., for the application that you want, you will have to create yourself. While you are on the download page, you should also grab a trial license key, as you’ll need it in a few minutes. In the text just below the “Download” heading, look for the sentence: “You can get a trial license key here.” Do as the page suggests and use a right click and the “Save link as . . .” option to store the key in a file. It is a good idea to store this key somewhere other than in the application folder, as it makes it easier to update the application when a new release comes out.
Now launch the miworkplace.exe file. (For Mac it is miworkplace.app.) At this point it will prompt you for the license key file. Point the dialog to the file you just saved and the workbench will start up. At this point it should look something like the picture below:
In the “Welcome” window are number of links to help you get started. From left to right they are:
- Create A New Connection
- Go To The MiWorkplace Website
- Access Documentation
- Access “How-To” Videos
- End email to the product’s author
Of these options, probably the most useful for beginners are the videos and the documentation. However, like many of you, I suspect, I decided to just jump in and create a connection.
Creating A Connection
You can either click the new connection link in the welcome screen, or alternatively click the indicated link in the “Remote Explorer” pane on the left-hand side of the window. When you do, the new connection window appears:
Once you have entered the minimum information (the name of your connection and the name or IP address of the server) you can either press the Finish button, or press Next to specify the libraries you want to work with. I wanted to add an additional library to the library list, so I pressed Next. This is the result:
The dialog is named Library List Settings, but this is really a bit misleading. It could really use a better title. As you can see, you can opt to show all libraries (rarely a good idea), the job’s library list, and/or a specified group of libraries. I chose to show my library list and the library SIDDBV2. Note that this dialog does not modify the job’s library list. It merely controls the libraries that will be listed in the tool and has no effect on compiles. At this point I pressed Finish and my new connection appeared in the Remote Explorer pane. To open the connection, I double-clicked the connection’s name (SiD), and was prompted for my user name and password.
Once I had entered those details, the libraries appeared beneath the connection name. If you have designated a Current Library that will appear first, followed by any other libraries in the User portion of the library list. Clicking on the arrowhead beside the Partner400 library name produced a huge list that included everything in the library. In other words, the list produced is equivalent to that obtained from Work With Objects Using PDM (WRKOBJPDM) – but there are significant differences.
The most obvious, other than the fact that it is much prettier than a green screen, is that the full list is immediately available. There is no need to keep paging down. The second is that the list is completely alphabetical. That is, it is not alphabetical within object type, as WRKOBJPDM is. The biggest advantage to this is that to advance directly to (for example) QxxxSRC files, you can just key the letter “Q” and the list will be repositioned. If you are really fast on the keyboard, you could type “QR” to jump to the RPG source files. To achieve this with PDM would have required keying the “QR” and specifying “*FILE” for the object type. As we will see in a moment though, there is an easier way to navigate to your source files.
Once you have located your source files, click the arrowhead by the name to show the members within that file (i.e., the equivalent to specifying option 12 against the source file in the object list). This is what it looks like after opening a list of source members.
Filtering
Just as PDM allows you to filter lists, so MiW also provides filters so that you do not have to fight your way through all the items in the library to find what you need. Filters are accessed via the dropdown menu that appears when you click the down-pointing triangle, as highlighted here. Note that filters apply to the whole Remote Explorer view. So it does not appear to be an easy task to (for example) show only source files in one library, and only data files in another.
You begin by pressing the Filters… selection, at which point this pop-up dialog will appear:
If you are familiar with Regular Expressions you can use them here to specify what should be excluded – Note “excluded“. All filters cause things to be excluded from the list, unlike filtering criteria in PDM, which would cause them to be included. For a tool that is targeted as an SEU replacement this seems a strange choice. Another aspect that seems a little strange is that filters have to be specified using IFS style notation, i.e., qsys.lib/partner400.lib/…. Luckily for most of us the predefined options available via the checkboxes will give us what we want, i.e., a list that only includes source files.
I selected those two boxes and pressed OK. This only specifies the filters that you want available however. To actually apply the filter(s) requires that you click on Filters Enabled, and you will see the remote object list change to contain only the source files in the library as shown below:
From here opening a source member for editing is simply a matter of opening up the relevant source file, and double-clicking on the source name (or using the right-click content menu and selecting Open With RPG Editor). Note that opening for browse is also an option. The source will then be downloaded and opened in the editor.
Editing
The screen shot shows the same program that we saw earlier in SEU. But there are no nasty green bars and the source is color coded. Now admittedly I am “cheating” in the comparison a little here, because MiW does not do syntax checking. However, the color coding does help to make errors a little more obvious than simply turning off syntax checking in SEU could achieve. Plus, of course, syntax checking may be added in the future, something we know IBM won’t be doing with SEU. At the time that I took this screen shot I was operating in a window that was not full screen. Even so I could see 22 lines of source code. When I operated MiW full screen I was able to see 38 lines – more than double what I could have seen in SEU no matter how big a window I ran my 5250 emulator in. If you double-click on the source name tab the edit window takes over the whole screen. In my case that resulted in a full 56 lines being visible.
The editor supports the usual text editing keyboard shortcuts such as Ctl-C and Ctl-V to copy and paste, Ctl-F for performing a find, and many more. I won’t go into them all here but you can find a full list in the Key Binding section of the manual. One combination that I found useful was Alt + Arrow Up/Down, which can be used to move a selected block of code up or down in the source file.
Just like SEU, MiW has a format line at the top of the screen whenever it encounters fixed-form source. Unlike SEU this format line changes as you move from line to line.
One thing that you will not find is the ability to use SEU line commands, such as I(nsert) and D(elete). This is very much a workstation editor – not a green-screen one.
As you might expect, another major benefit of the editor is the ability to have multiple source members open for editing/browsing at the same time. This, to me, has always been one of the biggest benefits that I gain from using a workstation-based editor. I rarely work on one source member at a time, and having all the members related to my current task open at the same time is a huge benefit to me rather than having to wrestle with multiple 5250 sessions. In addition, you can use a split screen to edit multiple source members side by side.
Those of you who are familiar with RDi and other Eclipse-based tools will immediately notice the Outline view that is positioned to the right of the edit window. However, the functionality of this view is somewhat limited at present, as it lists only the names of procedure interfaces. Clicking on an individual routine’s name positions the editor at the start of that code. Prototypes are also listed in the Outline but the positioning doesn’t seem to work for them.
That is a very quick introduction to the editor. There is a lot more to it, including the ability to comment out blocks of code and use code snippets and templates. I’ll leave you to explore those features in the videos and documentation. Of course, editing is only part of the job – we also need to compile our programs.
Compiling
You can initiate a compile of your source either from the Source menu or via the keyboard shortcut Shift – Ctrl – C. Once the compile completes, any error messages will appear in the Compile Result window. Double-clicking on any error will highlight the problem within the source, as you can see in this image:
This is just so much easier than having to hunt though source listings as you are forced to when using SEU. That said, I do have a couple of complaints about the way compilations are handled. I’m mentioning them here so that you are aware of the issue before you start and don’t waste time, as I did, before realizing the problem.
First, when you initiate a compile the editor does not prompt you to save your changes – so you can easily end up compiling and testing an old version of the code and not your current version. With SEU this is not an issue, as you would have invariably exited the editor before submitting a compile.
Second problem is that CRTRPGMOD is the default compile option, and I could find no way to change this. Since most of my compiles are set up to require CRTBNDRPG, this resulted in compile errors. The only way to specify the type of compile I wanted was to right click on the individual source member and take the Set compile command option. To me having to do this separately for each and every single source member was probably the single most frustrating aspect of using the tool. In addition, when a source member is copied that attribute is not copied with it.
When a compile completes, a separate pop-up window appears. Blue for success, red for failure. However, this message only stays on screen for a short period of time and when I was not using the tool full screen I found that, because the pop-up appears off to one side of the window, I often missed the message and then wasted time compiling again to be sure that I hadn’t forgotten to compile the first time.
These issues will hopefully be addressed in future version of the tool.
Summary
Frankly I find SEU so frustrating to use that I am delighted to see the emergence of this product as an alternative. In that role it does a good job, although it still has a number of rough edges that need to be addressed before I can wholeheartedly recommend it.
What it is not, is a replacement for RDi, which has so many additional features and capabilities that it really is impossible to directly compare the two. MiW’s focus is on replacing SEU, not RDi. That is deliberate on the part of the tool’s developer. His intent is to improve the lives of SEU users whose management will not pay the price of RDi, but who desperately need rescuing from the outdated SEU. In that goal he is well on the way to success.
Hi Jon, how does this product, and RDi for that matter, handle source control? Does either one prevent a programmer from editing a test or production level source code? We use Aldon change management, but it sounds like these bypass that.
Thanks.
I setup a trial version and all looks good for connection and configuration and it shows all files/sources on the list. But when I open any source it opens a blank source and a message at the right bottom corner, cannot open source. Any ideas, where it would be stopped and how to make it open the sources for a test.
Thanks
Farhan