Wednesday, February 26, 2014

PDM user defined options

pdm user defined options defaults wrkmbrpdm wrkobjpdm wrklibpdm

When using PDM have you ever wanted to have your option do something different from the default way of doing it. For example if you want to use your own values in certain parameters for creating a RPGLE program. You can do so using without changing the command by using PDM’s user defined options.

IBM announced when IBM i 7.1 6.1 was launched that PDM and SEU would no longer be updated, they are still very popular (for more details see here). Over the years I have found that many developers do not use the options within PDM. In this post I am going to describe how to change the defaults for your PDM and how to configure user-defined options.

Wednesday, February 19, 2014

Defining variables in RPG all free

 rpg free tr7 dcl-s dcl-c dcl-ds end-ds dcl-subf

Prior to the new all free RPG variables (fields) would have been coded in the Definition specification, D-spec. With the new version of RPG the fixed format D-spec has gone. It has been replaced by new free form definition statements. At the time I am writing this post I have not found any other articles giving examples of how to code these new definition statements, therefore, I am going to give examples of how I have used them as I am starting to become this new version of the language.

The definitions I am going to discuss here are:

Monday, February 17, 2014

Technology Refresh Redbook now available

tr6 tr7 redbook

The draft Redbook for what is new in Technology Release 6 and 7, TR6 and TR7, update is just now available for download from IBM’s website.

The abstract for this manual is:

This IBM Redbooks publication introduces a technical overview of the new features, functions, and enhancements available in IBM i 7.1. It provides a summary and brief explanation of new capabilities and what changed in the operating system. This publication also describes many of the licensed programs and application development tools that are associated with IBM i. This publication includes all the enhancements that were delivered with the Technology Refresh 6 and 7 that were made available in 2013.

Wednesday, February 12, 2014

File definition in RPG all free

rpg free file sepecification dcl-f tr7

While I have been working with the new RPG all free (released in November 2013) I have unable to find examples comparing the pre-change to the post-change RPG code. Therefore, I thought I would give some examples of how to define files here.

When I first heard that RPG had gone completely free I was concerned that we could now intermix everything. This scared me as I had vision of people intermixing file definitions with the equivalent of calculations, etc. Fortunately what I have found is while you can intermix the new definition statements, you cannot insert them into the equivalent of the "calculation specifications".

Monday, February 10, 2014

How to tell if you have the PTF for RPG all free

dspptf rpg tr7 ptf si51094

I have been asked by several people how they can check if their IBM i has the necessary PTFs loaded to use the new RPG all free.

I thought it would be useful to create a quick post showing how I would check for the PTF.

Your server must be running IBM i version 7.1. If your server is running 6.1 then the RPG enhancements may be introduced with a future CUM PTF. If you are running on V5R4 or earlier you will not be able to use these enhancements.

Wednesday, February 5, 2014

Soft coding parameters used by Query

query qryfile output printer

In the environment I work there are many programs that produce "download reports". There are not paper reports, but extracts of file(s) that are sent, via email, to the requestor. Most of these use a Query to gather information together.

Many are coded like this:

   RUNQRY  QRY(QUERY1)

Which means that when the Query is run it will use the files that are hard coded in the Query’s definition. Therefore, if I want to perform a test and use files in a testing library I have to change the Query.

Or if I want to change which file or library the output file is in I have to change the Query.

Fortunately, there is an easy way to overcome these issues by using the parameters in the RUNQRY command.

Wednesday, January 29, 2014

Translating hexadecimal values using XLATE

XLATE translate hexadecimal hex rpg

As I have mentioned in previous posts there are several processes I have written and responsible for that takes data from a CSV (Comma Separated Values) files and updates files on the IBM i (AS400). One vendor has trouble sticking to the agreed standard of not having double quotes ( " ) in the description fields to denote inches.

The double quotes are interpreted as the start of an alphanumeric field which does not end until another double quote in encountered. This results in the extra fields being created at the end of the record or a loss of several records which are combined into one big field. I prevented this from happening by using the %XLATE built in function in RPGLE/RPG IV to replace all occurrences of the double quote with a space.

But this week they sent a right double quotation mark ( ” ), which were translated to some strange hexadecimal characters by the ASCII to EBCDIC translation table.

How can I replace these hexadecimal characters?

Sunday, January 26, 2014

Version 7.2 coming soon

operating system release upgrade 7.2 v7r2

Last week I learned from an IBM support person that the new release of operating system for the IBM i is imminent.

He told me that IBM i 7.2 will be released in Spring 2014, at a yet to be decided date.

By modifying the URL of the IBM i 7.1 website I have found an empty one at: http://pic.dhe.ibm.com/infocenter/iseries/v7r2m0/index.jsp. Perhaps this will be the help site for the new release.

Wednesday, January 22, 2014

Fun with Logical Files

logical file lf sst rename trntbl

This is not going to be an article on how to code Logical Files. It is about how you can use some of the less well known keywords/functions to do some pretty cool, and fun, stuff with the fields within them.

Before I start coding Logical files I need a Physical file. In this article I am going to use the following file:

   A..........T.Name++++++RLen++TDpB......Functions
01 A          R TESTPFR 
02 A            PFLD1          3A
03 A            PFLD2          2A
04 A            PFLD3         30A 
05 A            PFLD4          5P 0 
06 A            PFLD5         10A 
07 A            PFLD6           L 

I know I will not get any awards for originality for my choice of file and field names.

Monday, January 20, 2014

User Group: Common France

user group common france

Comme quelqu'un qui croit en la valeur des groupes d'utilisateurs d' IBM i, j'étais heureux de recevoir un message de Julie Gaubert m'informant de Common France de sites web.

Leur site est à l'adresse http://rse.common-users.fr.

Et ils ont un forum à http://forum.commonfr.org/forum/index.php.

J'ai ajouté ces liens pour sur ce site IBM i User Groups page. Vous trouverez un lien vers la page des groupes d'utilisateurs en haut de chaque page de ce site.

Merci Julie.

Si vous connaissez un groupe d'utilisateurs, peu importe où il est dans le monde et qui n'est pas sur la page groupes utilisateurs Utilisez le Contact form pour m'envoyer ses détails.

Thursday, January 16, 2014

New to IBM i from developerWorks

developer works new to ibm i

IBM has updated their developerWorks web site to include a New to IBM i zone.

This is an excellent place to start learning about the IBM i with links to many other parts of their developerWorks web site.

I have added this link to the Links to other sites section, on the right, or you can go there by clicking here.

Tuesday, January 14, 2014

Add key to SQL table in QTEMP

create table alter table create index key unique

In my last post I discussed how you could Create a SQL table on the fly, and Manuel Moreno posed the question if it was possible to create a table like this with a key?

I consider this an excellent question, therefore, I created this post in response to his question.

I will be using the same scenario as I did in the original post. There I create a SQL table in QTEMP by using the CREATE TABLE AS SQL statement:

   CREATE TABLE QTEMP/OUTFILE AS
          (SELECT SOURCE,ORDNO,CUSNO,PART,SPEC,ORQTY,DUEDT 
                  FROM INFILE
                  WHERE SOURCE = '04')
          WITH DATA