|
|
The Free RPG/i5 (AS400) Tools Mission
|
These tools are intended to be used for your reference & are licensed as freeware.
They are not meant to be end all, be all utilities. You may use these tools in
anyway you wish. Commercial or other non-personal use is ok, just as long as you leave
the copyright & author information intact.
Most of them have been written using Free Format RPG IV/ILE (RPG Free) & many of them
utilize my own service program (
ISTPRCR
). This service program is contains several
common procedures that I have written. Some of the procedures that are included are:
- Center - Center text in a variable
- ObjText - Retrieve the text of an object
- LCase - Convert Text to lower case (Using the system language)
- UCase - Convert Text to upper case (Using the system language)
- ExecuteCommand - Run an RPG/i5(AS400) command using the QCAPCMD API
- CheckCommand - Validate & return the proper syntax of a command using the QCAPCMD API
- SystemValue - Return an oprerating system value using the QWCRSVAL API
- SndPgmMsg - Send a Program Message using the QMHSNDPM API
- SndUsrMsg - Send a User Message using the QMHSNDM API
- MbrText - Retrieve a member's text using the QUSRMBRD API
- RtvSysName - Retrieve the RPG/i5(AS400) system name using the QWCRNETA API
- FileInfo - Retrieve physical file information (records, size, etc..) using the QUSRMBRD API
|
These are just some of the procedures that are included with each download. Plus
more are always being added.
These RPG source samples/examples are designed to be generic in nature & very little
hard coding has been used. In all cases I have used RPG IV & in most I have
used Free Format RPG.
I have tried to take advantage of the AS400 system APIs & built in RPG IV/ILE functions (BIFS)
wherever possible. You are encouraged to modify the source to suit your needs &
to learn from my mistakes. If you do make any enhancements, by all means
upload
).
them back to this site, I will be glad to post them. Also, If you have any
suggestions for new tools or enhancements, please send them to me as well.
Please remember, the primary purpose of this site is not just to give away free software. It is to share knowledge! That knowledge
is primarily directed at the RPG/i5 (AS400) platform & RPG, but as you can see from my other downloads section, I am willing to
share any knowledge that is helpful.
I would highly reccomend that you download the
CMPANYSRC
command. This command will make a lot easier to use the Free RPG/i5 (AS400) Tools
. This command can also be very useful in your own environment when trying to establish standards
for compiling objects.
Just a Note: If you have some time on your hands (Like I wish I did) & you would
like to make an enhancement to one of these tools. The
indent utility
is in desperate need of an upgrade. It needs to be able to indent Free Format RPG
& there are a few tweaks it could use for the other forms of RPG as well dealing with
longer field names & things like the eval statement. I haven't had the time to do this
myself, so if you are interested I would be willing to offer a free membership to anyone
who does it. Please send me an e-mail if you are interested.
Please keep in mind, (as it is with all freeware/shareware) this software is
supported by you (hence the reason I give you the source). I will be more than
happy to answer your e-mails (if I can), but I do have a day job. So please do
not be disappointed if your e-mails don't get answered right away.
|
Some of the more popular utilities you will find here are:
|
-
CALCDATE - Calculate Date with RPG Date Fields
-
CHGCURUSR - Change the currently signed on user
-
CMPANYSRC - Compile Any Source Member
-
CVTRPGEND - Convert RPG End Statements
-
CVTSPLF - Convert an RPG/i5 (AS400) Spool File to PDF or HTML document.
-
DLTOSPLF - Delete old Spool Files
-
FTPGEN - Generate FTP Script to Allow Re-Upload
-
FTPSRC - Download Source Members VIA FTP
-
GETFFD - Get/Display Field Field Layout
-
POPMSG - Display Message in a Popup Window
-
RECORDS - Show Number of Records in a File
-
RTVSRC - Retrieve Source from ILE Modules
-
SETDBG - Set Source Debug Screen to 132 Columns
-
SQL - Run any SQL Command
-
SRDESC - Save & Restore Member Text
-
WRKDBF - Work with Database File V10.11.03
|
|
Show your support of RPG/i5 (AS400) open source & use these links on your website to link to us.
|
|
Have you become a member yet?
|
When you become a member of the Free RPG/i5 (AS400) Tools
club, you get the privilege of being able to download the newest tools
before anyone else. Plus by becoming a member you will be eligible to
receive a %50 discount on next year's membership dues.
You can become a member for only $14.95
by pressing the Order Now button.
|
Remember you can get even more when you get a copy of the
Free RPG/i5 (AS400) Tools on CD-ROM.
Any new tools that are added will only be available for download by
Free RPG/i5 (AS400) Tools members until the next volume
of the CD-ROM comes out next year. That means that if you are not a member &
an new tool is added, you may have to wait an entire year before you can
download it!. Plus just think of the time you will save not having to
download all of the tools one at a time. You can get your CD & membership for
only $24.95 by pressing the Order CD button.
|
Press the Proceed to Downloads button to get a list of Free RPG/i5 (AS400) Tools that can be downloaded.
|
|
Upload RPG/i5 (AS400) Utilities
|
|
|
The only required field is the file itself. If you really want me to
publish it, you need to enter everything. Whatever you put in the
name field will be placed with the utility on my web site. Your
e-mail address will not be made public. I will only use it to forward
inquiries from people who download your utility.
You may upload any software that you have the right to freely distribute.
I would prefer that you upload RPG/i5 (AS400) source, but if you have or find some
truly unique or outstanding software that is not from the AS400 (from any platform)
that may be of interest to people using the RPG/i5 (AS400) system then
by all means upload it.
Also if you include your website address
in the description I will place a link in the text. Also I will include a link to it on
the Free RPG/i5 (AS400) Tools web blog
.
|
The Free RPG/i5 (AS400) Tools Frequently Asked Questions
|
|
Q:
|
How do you return (output or In/out) values from an RPG program in a stored procedure
to an external system (ie.. PHP or java)?
|
|
A:
|
Although I'm sure there are many techniques, the one I use is to
select the stored procedure results in a SQL & display them. You
can use a second stored procedure as sort of a wrapper procedure.
Click
at:
HERE
to see an example.
|
|
Q:
|
How do I chain to a file in RPG Free Format without defining a
KLIST?
|
|
A:
|
There Two methods:
- Define a data-structure (equal to the key list) &
use the %KDS bif to chain to the file.
- List each field on the chain statement ie..
chain (field1:field2:field3) filename;
|
|
Q:
|
How can I make all output from a specific program be listed under a
single user?
|
|
A:
|
Since the output is generated for the user that is currently
running the job, the only way would be to submit the job for
the specific user. Another way would be to change the user
that is currently signed on. This can be accomplished by using
the QSYGETPH api (to retrieve the specific userid inforation) &
the QWTSETP api to actually change the current user that is signed
on. I have created a utility to automate this, you can download
it
at:
Free RPG/i5 (AS400) Tools
|
|
Q:
|
How do I show the interactive source debugger screen in 132 column
mode like it does when you debug a program VIA a service job?
|
|
A:
|
You have to add an environment variable (ILE_DEBUGGER_1) with a
value of ALLOW_WIDE_SCREEN. This is set for each job & will
only remain active until you sign off. You can also remove the
variable go back to 80 column mode. I have created a command
that will toggle this variable back & forth. You can download
it
at:
Free RPG/i5 (AS400) Tools
|
|
Q:
|
How do I convert non-Free RPG to RPG Free?
|
|
A:
|
IBM hasn't given us any free (good) solutions & I have not found any myself, but
I have found a couple of other options:
- There is an option in the WebSphere Development Studio Editor to convert RPG C-Specs to Free Format.
- Linoma Software has a pretty good tool to convert RPG to Free Format (I have used it myself). You can
download a free trial
here .
- I have also found a very useful resource
here . Craig Rutledge's website has always been a good resource for me.
- I will add more as I find them, otherwise I would say your best be is to re-write them.
|
|
Q:
|
How do create/use a FTP script on the RPG/i5 (AS400)?
|
|
A:
|
Essentially the FTP command on the AS400 works the same way it does on any other platform.
All of the FTP functions are the same. You just need to understand how/where the FTP command
gets/uses the script file(s). By default the FTP command on the AS400 will expect to find a
file called INPUT that it will use for it's script and a file called OUTPUT that it will use
for an output log. If the OUTPUT file does not exist, it will create it in QTEMP.
What you want to do in order to create a script for the FTP command is:
- Create a source member to use as a FTP script.
- Create a source member to use as a FTP log.
- Add FTP commands to your script member (an example can be found
HERE
).
- Override the INPUT file/member to your script member
OBRDBF FILE(INPUT) TOFILE(QGPL/QFTPTXT) MBR(YourMember)
- Override the OUTPUT file/member to your log member
OBRDBF FILE(OUTPUT) TOFILE(QGPL/QFTPTXT) MBR(YourMember)
- Run the FTP Command (Pointing at the appropriate system)
You can look at your log file/member to debug any problems. I have created a
tool
that will automate this process. It uses mostly CL, but it does
have an RPG component that prompts for the target system. This tools also utilizes the
edtsrc
tool to create/build the script member.
|
|
Q:
|
How do I keep Windows XP from treating Zip files as folders? (Ok so this has nothing to do with the i5(AS400), It just annoys the crap out of me!)
|
|
A:
|
Turn it off:
- Select Run from the Start Menu.
- Type regsvr32 /u %windir%\system32\zipfldr.dll at the prompt, and click Ok.
- The change will take effect immediately, but you may have to restart Windows for all traces of the built-in ZIP support to disappear.
If, at any time, you wish to re-enable Windows XP's built-in ZIP support, just follow these steps:
- Select Run from the Start Menu.
- Type regsvr32 %windir%\system32\zipfldr.dll at the prompt, and click Ok.
- The change will take effect immediately, but you may have to restart Windows for all features of the built-in ZIP support to be available.
This and many more windows tips can be found at:
Annoyances.org
|
|
Q:
|
How do I verify the contents of a field is numeric in RPG Free without using the TEST(N) opcode?
|
|
A:
|
Since the TEST(N) is not supported in RPG Free, the best way I have found to accomplish the same thing is to,
use the %Check BIF. You can do this with the following code:
if %Check('0123456789':YourField:1) <> 0;
"DO SOME CODE";
endif;
In this example, "YourField" is the variable name and the "012345679" are the valid characters. The
function will start searching from position one. If any character is found that does not exist in the
valid character list, it will return the position of the invalid character. The example assumes that any
value other than zero is invalid without regard to what/where it is.
|
|
|
RPG/i5 (AS400) Links:
|
|
|
|
|
Other Links:
|
|
|
|
This page contains links to sites that operate independent of Free RPG/i5 (AS400) Tools & we
are not responsible for their content. Although we attempt to maintain a high standard
for the sites we partner with, occasionally things change without our knowledge. Please
inform us if a link is broken or the content of a website no longer fits the description
that is represented here.
|
Show your support of RPG/i5 (AS400) open source & use these links on your website to link to us.
|
|
Free Software Downloads
|
|
|
|
About FREE RPG/i5 (AS400) Tools.
|
These iSeries/i5 (AS400) Tools are a collection of tools that I have gathered over the past
20+ years. Some of them can trace their roots all the way back to the S/34. Many of them
were written the the AS400 was the AS400 and not the i5 as they are calling it today. I have
steadily improved and added to all of them as the AS400 grew into the iSeries and now to the i5.
Most of them I have written myself, some of them were written by friends & co-workers.
These tools are provided for free & are distributed as source only. You'll need some
knowledge of ILE & service programs in order to compile many of these programs. I have
included a readme file with each tool that gives basic instructions on how to compile the
software, but each environment is different & you may need to make some modifications
(depending on your AS400/OS400 operating system version) to make the tools work for you.
Some of these tools are very specific for a single AS400 need, but most are pretty broad.
I have always tried to make the code as generic as possible (using variables instead of hardcoding)
when I wrote them. I usually try to use APIs & I almost never use CL (I have nothing
against CL, I just prefer RPG on the AS400). Over the years I have tried to keep the
tools updated with the latest code changes(ie..RPG ILE, BIFs, AS400, iSeries, i5), but
some of the tools are just not worth spending the time. I have tried to name the
commands with different than OS/400 commands(ie.. GET instead of RTV) to avoid any
conflicts. Many of these tools duplicate the functions that were once done by
the old TAATOOL (which were free on the AS400) utilities. Because those tools are now
licensed, I have since replaced their function (at least the ones I was using) with
my own utilities. In some cases, the tool names are still the same as the ones
that TAATOOL used & therefore could cause issues if you still have those tools
on your AS400 system. Please remember that these tools are meant as reference &
to help you create your own software. They can of course be used as is, but please make
sure that you understand what they are doing before you try to use them. No one is
perfect & programs can have bugs, protect your system at all times with backups!
|
Most of the tools/programs on this site are for the iSeries (AS400), but some are for
other platforms such as Windows & DOS. They are for the most part related in some
way to the iSeries (AS400), but not always. Any tool/utility that I put on the site
for the iSeries (AS400) is always in source. In some cases I have found software that I
just have found particularly useful and put on the site.
You are welcome to
upload
any software you wish. I would prefer it to be iSeries (AS400) related &
to be in source not object (so others can learn from it). Please remember if you do
upload
something, if you don't give me your name & other pertinent information I won't be able
to give you credit for it.
|
Show your support for FREE RPG/i5 (AS400) open source & use these links on your website to link to us.
|
This site is protected by the bad robot trap!
|
|
|