Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPG /Free 3

Status
Not open for further replies.

GhostWolf

Programmer
Jun 27, 2003
290
US
Can someone please point me towards some documentation?

I'm finally in a job where I can get back into RPG, and have seen a few code examples. Some trial and error finally got me a working program, but it would sure be nice to see what functions are available.

Searching here for several combinations of "rpg /free" didn't work, and I couldn't find it at PubLib either.

Thanks, in advance.


Dennis
 
Let me try that again - try this link.

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
Thank you, thank you! That was a big help.

I just never thought to look in the ILE RPG section for it.
 
fwiw: free-form is simply an alternative syntax, and part of RPG-IV (sometimes referred to as ILE-RPG, becuase it also supports ILE).

A great way to learn RPG-IV is to use the editor (lpex, not the old SEU). Simply click on "convert to free-form" and it magically converts most of the calc specs to free-form. (can also do RPG-III to RPG-IV on the fly).

A great feature here is that freeform and BIF's are supported by the interactive IDE that prompts for next field/parm/etc as you are entering it, much like the way Java IDE's do.
 
lpex"? How do I get to that one? That automatic conversion would be a great learning tool, (I've written some SQLRPGLEs that I'd love to see it convert!).

Right now I'm using IBM's CODE editor, but haven't checked for any advanced functionality in it. Sounds like a fine first task for work tomorrow...
 
lpex is part ow WDSc (Websphere Development Suite for Clients). It's a separate CD (or DVD, now, I think) that comes with i5/OS.

There is no way to convert SQL statemnts in an SQLRPGLE program to free form. They have to be in C+ specs bounded by /EXEC-SQL and /END-EXEC. Therefore, it's technically fixed format.

Many programmers just put the SQL statements in their own subroutines. The cose looks better that way.

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
Looked through all the stuff I installed from the WDSC disks, but haven't identified lpex yet.

Checked the CODE IDE though, and it does the conversion also. Looks pretty good, so far. (CODE/VARPG is also a separate installation disk among the WDSC install set.)

Found it interesting that ENDSR converts to /free, but not a tagged ENDSR.
 
For the tagged ENDSR, make sure that there are no GOTOs referencing that tag, then delete the tag from Factor 1. Then it should convert. The reason it doesn't convert is that it's theoretically possible for a GOTO to reference that tag even if it's not in that subroutine (why anybody would do something like that is beyond me).

If there are GOTOs in the same subroutine as a tagged ENDSR, replace them with LEAVESR.

You found lpex - it is the CODE IDE.

Feles mala! Cur cista non uteris? Stramentum novum in ea posui!

 
Aha! Then I'm liking lpex!!

The only purpose the tag serves is legibility. I got rid of GOTOs long ago, but like being able to tell, at a glance, which subroutine's ending - especially if it spans a couple printed pages.
 
Actually lpex is NOT part of CODE. It's the replacement for CODE (which IBM says they will not longer update).

lpex is the editor that is used by RSE (Remote System Explorer), and is installed in the first part of WDSc. Start WDSc, open the RSE perspective, then create a "iSeries object" for one of your libraries. Lpex has most all the features that CODE had, plus more. There is a bit of a learning curve, but (I think) its worth it.

WDSc is pushed by IBM for its WebFacing features, but its also a great editor for RPG and COBOL. I like the "verify" option that checks your pgm for errors before you compile it, and bring you right to the line in error.

The RSE setup is not as intuitive as it could be, but once setup, it works easily. Give it a try !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top