I have been asked the same question many times recently: "Why can't I use SEU with the new RPG?" Before I directed people to various posts in this blog, which I think has confused some. Therefore, I have decided to put it all in one place, this post.
Let me start by saying that it is possible to use SEU to edit totally free RPG. The issue is that IBM has not considered SEU the editor of choice for IBM i since release 6.1, not making any changes to it since that release. Rational Developer for i, RDi, is now IBM's preferred editor. Unlike SEU, RDi is not included with the standard package of IBM i based development tools. RDi is not free, its licenses are purchased separately. I would recommend that if you can get a license of RDi you should start learning how to use it, rather than using the out of date SEU. For the sake of this post I am going to assume that you do not have an RDi license, and you have to continue to use SEU.
As SEU has not been changed since IBM i 6.1 all of the new functions, features, etc. added to all of the IBM i based programming languages since then are not supported by SEU's syntax checking. I found the best description of what SEU's syntax checker does in the COBOL manual:
… syntax checker checks each line for errors as you enter new lines or change existing lines. Incorrect source statements are identified and error messages displayed, allowing you to correct the errors before compiling the program.
Columns . . . : 1 100 Edit SEU==> FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 *************** Beginning of data ***************** 0001.00 **free 0002.00 ctl-opt option(*nodebugio:*srcstmt) 0003.00 dftactgrp(*no) ; 0004.00 0005.00 dcl-pr sleep extproc('sleep') ; 0006.00 *n uns(10) value ; 0007.00 end-pr ; F3=Exit F4=Prompt F5=Refresh F9=Retrieve F10=Curso F16=Repeat find F17=Repeat change F24=More Form-Type entry for main procedure not valid or out of sequence.
To be able to enter all the latest programming language enhancements I have to turn off syntax checking, unless I want every line with a new RPG definition specification, operation code, built in function, CL command, etc. to be highlighted as an error. The question is: Do I have to use the syntax checking? I do not, any errors I make when entering code will still be found when I compile the source.
To turn SEU's syntax checking off:
- Edit any source member in SEU, it does not matter which member or what type of member it is.
- Press F13, to "Change session defaults", and the following screen is displayed.
Change Session Defaults Type choices, press Enter. Amount to roll . . . . . . . . . H H=Half, F=Full C=Cursor, D=Data 1-999 Uppercase input only . . . . . . N Y=Yes, N=No Tabs on . . . . . . . . . . . . N Y=Yes, N=No Increment of insert record . . . 0.01 0.01-999.99 Full screen mode . . . . . . . . N Y=Yes, N=No Screen size . . . . . . . . . . 1 1=27x132, 2=24x80 Source type . . . . . . . . . . RPGLE Syntax checking: When added/modified . . . . . Y ⇐ Y=Yes, N=No
- Change the "Syntax checking" from Y to N.
- Press Enter.
Next issue before I can use totally free RPG without errors is how to position in the editor window in the right place before I enter **FREE.
In all earlier forms of RPGLE (or RPGIV), including: fixed format, free form calculations, and free format definitions, all need to be coded between the sixth and 80th columns in the editor, with the exception of tables. When you edit a RPGLE, or SQLRPGLE, member SEU positions the source to start at the sixth column, which is where you would put the letter for the specification you were entering.
Columns . . . : ⇒ 6 100 Edit SEU==> FMT * *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+. *************** Beginning of data *************************** 0000.01 0001.00 C<- 6th column: Fixed format starts here 0002.00 <- 8th column: Free format calcs start here 0004.00 e <- 1st column: Totally free starts here
Notice that on the first line where it says "Columns", it shows that this editor window starts in column six. You can also tell from the FMT line, if you count backwards from the tenth position you will find that this window starts in the sixth position. This is ideal for the versions of RPG that were available in IBM i 6.1, but not for totally free RPG, which was released in a TR for IBM i 7.2. When using totally free RPG you can use every column in the member, from the first to the end, whatever column that maybe. To flag to the RPG compiler that this is totally free code **FREE must be entered starting in the first column.
To move my editor window to start in the first position I press the F19 key. The editing space is moved to the left, the columns line at the top of the screen now shows the first column displayed really is the first column, and the ruler on the format line starts in the first position too.
Columns . . . : ⇒ 1 100 Edit SEU==> FMT * ..... *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 *************** Beginning of data ************************** 0001.00 0002.00 C<- 6th column: Fixed format starts here 0003.00 <- 8th column: Free format calcs start here 0004.00 **free <- 1st column: Totally free starts here
Once the **FREE has been entered in the first column the rest of my totally free RPG can be entered starting in any column.
When I have finished entering code, exit the source member, and then edit or browse it again SEU will start displaying the source in the sixth column as before. I have been unable to find a setting in SEU to override this. If you have please let me know in the comments below.
I hope this explains simply how to configure SEU editor for more than just modern RPG, removing syntax checking will also allow me to use the latest commands and built in functions in CL too.
It is possible to download a 60 day trial of RDi from IBM's developerWorks web site here.
This article was written for IBM i 7.3, and should work for later TRs of IBM i 7.2 too.