Archive

Posts Tagged ‘RPG’

RPGPGM.COM - From AS400 to IBM i › Getting off the RPG cycle

March 25th, 2015 Comments off
no rpg cycle with main and no main procedures

The cycle is still a part of RPG, and while you are not using it in your RPG programs it is still there lurking. I have always wished there was a way to be able to turn it off, and allow RPG to be linear. In recent releases this has started to happen.

With the file definitions in all free RPG it is not possible to code a file as primary or secondary, or to define matching records and level break indicators. But the cycle is still there. For example, the program below uses the cycle to read all the records from a file:

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: ,

RPGPGM.COM - From AS400 to IBM i › Char built in function added to CL

March 18th, 2015 Comments off
%char in clp clle and rpg

IBM i 7.2 introduced a number of new built in functions, BIFs, to CL. One of them is %CHAR, convert to character format. When I found it my first thought was this the same as the RPG %CHAR BIF.

The syntax for the two BIFs is similar:

CL :
CHGVAR VAR(&ALPHA) VALUE(%CHAR(&NBR))
RPG :
Alpha = %char(Nbr) ;
Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: , ,

Alan Seiden Consulting: PHP and IBM i Expertise › Vote for a Mac edition of RDi

March 8th, 2015 Comments off

Rational Developer for i (RDi), the modern editor for IBM i RPG, COBOL and other languages, runs on Windows and Linux, but not Mac.

IBM has shown some willingness to port the product to Mac. They have posted a poll to allow users to vote for this enhancement or to comment on the proposal: https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=13454

Those wishing to vote will find a “vote” link near the bottom of the poll page.


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

RPGPGM.COM - From AS400 to IBM i › Changing Case using SQL

February 25th, 2015 Comments off
select upper and lower case conversion translation

Last week I discussed how to change the case of alphabetic characters using the new %UPPER and %LOWER BIFs, built in functions, added to CL in IBM i 7.2, you can read it here. I mentioned the limitations of using the %XLATE BIF in RPG to accomplish the same. But there is an easier way using embedded SQL in the RPG to emulate the functionality of CL's %UPPER and %LOWER do.

RPG's %XLATE requires that you need to give all of the characters that should be replaced with what you need them to be replaced by. This is useful for so many situations. But when converting case most programs I have seen many that just have the following:

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: ,

Alan Seiden Consulting: PHP and IBM i Expertise › Video promo for WMCPA IBM i conference: March 10-12, 2015

February 22nd, 2015 Comments off

Join me and 20 other speakers at the Wisconsin Midrange Computer Professional Association (WMCPA) spring technical conference, March 10-12, 2015, at the Lake Lawn Resort on the shores on Delavan Lake.

Speakers: Aaron Bartell, Rob Bestgen, Larry Bolhuis, Tom Cremieux, Floyd Del Muro, Raymond Everhart, Margaret Fenlon, Susan Gantner, Charles Guarino, Scott Klement, Chris Koppe, Jon Paris, Mike Pavlak, Jim Ritchhart, Debbie Saugen, Alan Seiden, Dr. Frank Soltis, Robert Swanson, Robin Tatam, Jeff Tickner, Steve Will

Details: http://wmcpa.org/index.php/conference-2015/ibmi-conference-2015


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

RPGPGM.COM - From AS400 to IBM i › Reading a SQL table in RPG

January 28th, 2015 Comments off
reading sql table in rpg

This idea for this post comes from a Comment posted on Creating a SQL table on the fly. Anonymous posed the question "Now how do you use that table in your RPG program?".

The post I describe how it is possible to use the SQL CREATE TABLE to build a SQL table extracting data from another file. I have mainly used this in processes that extract data and then send the extracted data to the requester via email. But there is no reason why I cannot read the table created in a RPG program.

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: ,

Alan Seiden Consulting: PHP and IBM i Expertise › Free webinars sponsored by COMMON Europe (open to all)

January 23rd, 2015 Comments off

Starting January 27, 2015, I’ll be giving three free Tuesday webinars:

  • January 27: Strategic Modernization with PHP
  • February 17: Bring RPG/COBOL business logic to the web with the PHP Toolkit
  • March 10: Speedy PHP on IBM i

All three one-hour webinars will be held at 14:00 Central European Time (CET). That’s 8 AM Eastern Standard Time (EST). The registration page includes a time zone converter.

Details and to register: http://www.data3.se/?p=5287

Thanks to Torbjörn Appehl of Data3 (COMMON Sweden) for organizing these.


Read the original at Alan Seiden Consulting: PHP and IBM i Expertise.

RPGPGM.COM - From AS400 to IBM i › How to replace Key Lists

January 21st, 2015 Comments off
replace klist with %kds key data structure or key field list

As we now have all free RPG we need to find ways to move from familiar fixed format definitions to free format equivalents. Key lists, KLIST, are a good example. I still see new programs written in RPGLE with free form calculations, but with fixed format Key lists.


C KeyTestfile klist
C kfld wkFld1
C kfld wkFld2
C kfld wkFld3

The solutions was provided back in V5R2:

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: ,

RPGPGM.COM - From AS400 to IBM i › Trim in CL and its Second Parameter

January 14th, 2015 Comments off
trim (%TRIM, %TRIMR,%TRIML) is now in CL. And did you know that there is a second parameter to state which characters you want trimmed?

I am sure I am not the only person who has been using the Trim built in functions (BIFs) in their RPG code to remove leading and trailing blanks from strings. Trim BIFs were introduced into CL with IBM i release 7.1, and function in the same way as their RPG brethren.

Were you aware that the Trim BIFs have a second parameter that can be used for removing characters other than blanks? I have Miguel Cordova to thank for bringing this to my attention. Using the second parameter I can remove any character using the Trim. Below I will show examples in RPG and in CL, and discuss what I found in using them in both languages.

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: , ,

RPGPGM.COM - From AS400 to IBM i › Which Control options/H-specs do you use?

January 7th, 2015 Comments off
rpg control specification

In my many years of experience working for various companies I have found that just a few programmers define Control specifications in their RPG programs. The Control specification is commonly known as the Header specification, or H-spec, as in fixed format RPG the specification character, in the sixth position of the line, is 'H'. In all free RPG the Control specification was replaced by the Control options, 'CTL-OPT'.

In my opinion this was the most cryptic of the specifications in RPG III as you had to know what each column stood for, as it would only reveal its meaning when F4 was pressed to prompt the line.

Read more »


Read the original at RPGPGM.COM - From AS400 to IBM i.

Categories: Blogs Tags: ,
css.php