Pages

Friday, June 14, 2013

Moving programs from one release to another

This post comes from a question I was asked this week.

In our scenario the company has two IBM i (AS400) servers, the development and testing server we will call DEV400, and the “live” server will be LIVE400.

DEV400 was upgraded from IBM i 6.1 to 7.1 to allow for the purchased ERP application and home-grown programs to be tested that they are compatible with the new release. LIVE400 is currently 6.1, and will be upgrade to 7.1 “sometime this summer”.

The programmers have found that they cannot just compile programs on DEV400 and use the SAVRSTOBJ command to copy them to LIVE400. When they do they get the CPF3743 error informs them that “The file was saved from a more recent release of the operating system”. What to do?

When creating programs or modules it is possible to compile them to be compatible with previous releases, using the TGTRLS parameter of the compile or create statement. On DEV400 it is possible to create these objects for the following releases of IBM i:

  • *CURRENT, which is 7.1 and is the default value.
  • *PRV, which is 6.1.
  • V5R4M0.
  • V6R1M0, otherwise known as 6.1 .
  • V7R1M0, otherwise known as 7.1 .

                   Specify Value for Parameter TGTRLS

 Type choice, press Enter.

 Type . . . . . . . . . . . . . :   SIMPLE NAME
 Target release . . . . . . . . . > *PRV    

 *CURRENT
 *PRV
 V5R4M0
 V6R1M0
 V7R1M0

When the programmer is compiling a program or module they can simply press the F10, for “Additional parameters”, and find the “Target release” parameter and change it to *PRV. This will create an object that is compatible with 6.1 .

Or the Change Command Default (CHGCMDDFT) command could be used to change the TGTRLS. But this could be changed back to *CURRENT when the next release is applied, or possibly PTFs too. In this scenario I did not recommend this approach.

The most commonly used commands that have the TGTRLS parameter are:

CRTBNDRPG (RPGLE)
CRTPRGMOD (RPGLE)
CRTSQLRPGI (SQLRPGLE)
CRTBNDCL (CLLE)
CRTCLMOD (CLLE)
CRTCLPGM (CLP)
CRTRPGPGM (RPG)1
CRTPPRTPGM (RPG)1
CRTSQLRPG (SQLRPG)1
CRTPGM
CRTSRVPGM
SAVOBJ
SAVLIB
SAVRSTOBJ
SAVRSTLIB

1 Why modify old RPG source? See the post “RPG III let it rest in peace”.

COBOL compiles probably have a TGTRLS too. But who programs in COBOL on an IBM i anymore?

None of the create commands for files (physical, logical, display, printer) have the TGTRLS parameter. Neither does the CRTQMQRY command. These can be just compiled on DEV400 and copied to LIVE400.

There was a software company I worked for who always changed the compile commands to TGTRLS(*PRV), then they could support their customers on the current and previous releases.

You can learn more about the TGTRLS parameter on the IBM website here»

And the Change Command Default (CHGCMDDFT) command on the IBM website here».

Notes:

  • From 1988 – 2000 the IBM i server was known as the AS400.
  • From 1988 – 2003 the IBM i operating system was known as OS400.
  • April 2, 2008, IBM changed the version identifier format from VxRxMx to the more common format x.x . For example, the current release at the time this post is written is IBM i 7.1, not V7R1M0.

 

This article was written for IBM i 7.1, and it should be compatible with earlier releases.

3 comments:

  1. Hi Simón I Got this problem:
    Two enviroments Developer and Production.
    Recently Developer was updated from 6.1 to 7.2, production still on 6.1.
    When i try to compile i Got this error related to a Stgmdl compilation Parm With every rpgile sources only.
    Do you know why?

    I'm a loyalty reader.

    Best Regards

    ReplyDelete
    Replies
    1. Use the Contact Form, on the right, to send me a message as there is a lot more information I need before I can answer any question.

      Delete
  2. Hi Simon, i see some of the program objects with "Release program created for" in DSPPGM as blanks or some value say V00R0R.. any idea
    how is this possible?

    ReplyDelete

To prevent "comment spam" all comments are moderated.
Learn about this website's comments policy here.

Some people have reported that they cannot post a comment using certain computers and browsers. If this is you feel free to use the Contact Form to send me the comment and I will post it for you, please include the title of the post so I know which one to post the comment to.