Friday, April 18, 2014

User Group: GSLMUG becomes UPIIPA

utah ibm i professionals association

The Greater Salt Lake Midrange User Group has changed their name and have launched a new website.

The Salt Lake City, Utah, based group have changed their name to the Utah IBM i Professionals Association and created a new web site at uiipa.org.

I have changed the name and the link on this site's IBM i user groups page. You will find a link to the user groups page at the top of every page of this website.

If you know of a user group, no matter where it is in the world, which is not on the user groups page use the Contact form to send me its details.

Wednesday, April 16, 2014

Add 1 to A to get B, your code

Last week I discussed how I had created a program to maximize the number of values I could have in a 3 character field. I did this using the values 000 – ZZZ. As we all know it is not possible in RPG to just to add 1 to A to get B. I gave the program of how I did it here, and I asked if anyone had another way to do it so send it me.

Several people did, and I am grateful to them for their submissions. If you would like to send one please sent it via the Contact form as the formatting in the comments section will do strange things to it.

Wednesday, April 9, 2014

Add 1 to A to get B

rpg xlate increment alphanumeric

My colleagues and I came up with an interesting problem earlier: I have a 3 long field and I want to increment the value in it. We need to have the maximum possible number of values in the field before it returns to the initial value.

If I use numbers I have 1,000 values, 0 – 999.

If I used alphanumeric values for a range of 000 – ZZZ I would have 46,656 values. But how can I add 1 to the letter A?

Tuesday, April 8, 2014

Technical Refresh 8 announced

technical refresh 8, tr8

IBM announced today their latest Technical Refresh for IBM i, Technical Refresh 8 or TR8. Unlike previous technical refreshes it would appear that this release will only be for version 7.1.

While their does not appear to be any enhancements to RPG or CL, there are enhancements to DB2 for i (aka SQL).

The planned availability date is June 6, 2014.

You can learn more about TR8 from the links below.

Wednesday, April 2, 2014

Initializing variables with special values

rpg inz field variable

While skimming the updated RPG manual I found something that I had not seen before, I can initialize variables with special values. What do I mean by special values? Basically system type values that start with an asterisk. When I went back and looked at older documentation I found that this has been available since IBM i 6.1.

I no longer have to go to the Program Status Data Structure, PSDS, to get the user id of the person running the program, or to initialize a date field with the system date.

In this post I am going to give examples of how to use this in both fixed and all free format RPGLE.

Wednesday, March 26, 2014

Creating PDF files from spool files

ovrprtf cpysplf pdf transform services

I have times when a user will request that a report be emailed to them, rather than printed and sent to them via the inter company mail. The easiest way would be to create a PDF file from the spool file and then email it to the requestor.

There are many third party tools that allow you to be able to convert a spool file to PDF, but how can I do it just using native IBM i features?

The method I am going to describe can only be used IBM i servers with either version 6.1 or 7.1 installed.

Wednesday, March 19, 2014

Run SQL statements in your CL

cl clp sql runsql clle

IBM i 7.1 brought us the RUNSQL command. This allows me to run SQL statements within the CL.

Prior to IBM i 7.1 I would have to use the RUNSQLSTM command. To use this command I need to have the SQL statement in a source member. The way I knew to run build a SQL statement in CL program was to write it to a source member that could then be used by the RUNSQLSTM command. I always considered it too much work and either used a SQLRPGLE, RPGLE with embedded SQL, or a QMQRY, Query Management Query.

While I do not see the RUNSQL command replacing my use of SQLRPGLE, I do see it eliminating most of my use of QMQRYs.