Wednesday, November 26, 2014

Using Alias for longer field names

 

The original contents of this page have become obsolete, go to this page for up-to-date information.

 

Wednesday, November 19, 2014

Data Areas in the all free RPG

rpg

I have a couple of communications asking about how to "correctly" code a data structure to receive the data from and update a data area in the latest, all free, RPG. One of person even sent me their code, which I will be using for the basis for my examples.

While I am not sure if there is just one "correct" way to do this I will be giving my version of the following three scenarios:

  1. Receive data from a data area into a data structure
  2. Update the data area with data from a data structure
  3. Equivalent of UDS

I am not going to describe the basics of how to code Data Structures in free format in this post, as I covered this in Defining variables in RPG all free.

Wednesday, November 12, 2014

Getting a list of files in IFS directory

 

The original contents of this page have become obsolete, go to this page for up-to-date information.

 

Wednesday, November 5, 2014

More about subprocedures

subprocedures in modules

In my earlier post Subroutines versus Subprocedures I described some of the advantages of using subprocedures rather than subroutines. In it showed how you could use, what I call "open" subprocedures. An "open" subprocedure does not have a procedure interface specifications, therefore all of the variables defined in the main line/body are available in the subprocedures, and if you change the contents of one of those variables the changed value is seen in the main line/body.

The other type of subprocedure I call "closed". The subprocedure can be passed parameters and can return a single variable, which can be data structure with multiple subfields. A "closed" subprocedure is should be placed in a separate module, therefore, they are now available for multiple program to use. As the main line/body can only change the variables they pass to the subprocedure and the subprocedure can only return one pre-defined variable there is no accidentally changing to the values of the variables.

Many people commented on that post explaining the advantages of the "closed" subprocedure. I do agree and below I will describe how I code them and their advantages, including one potential gotcha.

Monday, November 3, 2014

Two user groups from France

I was recently browsing a French IBM i website when I found links to two User Groups in France:

They share at forum at www.volubis.fr/forum/

I have added these links to 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.

Are there other user groups/clubs in France or anywhere else in the world? If you know of any not on the user groups page please use the Contact form to send me their details.