Midrange News for the IBM i Community


Posted by: neilrh
A/P
Jackson, MI
Did IBM recently "FIX" the RPG compiler?
has no ratings.
Published: 02 Aug 2012
Revised: 23 Jan 2013 - 4105 days ago
Last viewed on: 19 Apr 2024 (7750 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Did IBM recently "FIX" the RPG compiler? Published by: neilrh on 02 Aug 2012 view comments(11)

When I modify a program or write a new program, I have gotten into the habit of moving the *ENTRY PLIST to a PI.  Normally I don't have a care whether the program is compiled as a OPM or ILE unless I am adding procedure calls to it.

So I have here a little utility program which accepts some parms (from a CMD interface) and does some operations to a file.  The parms are defined in a PI, and the program is entirely standalone (no external procedures required), so I originally created it as an OPM.  Now many months later I need to alter a couple of lines of code (change some calculations), and the program will not compile: 

001300 d USSTLLDPR3      pi                                                     
*RNF0203 30                THE PROCEDURE CANNOT BE DEFINED WITH DFTACTGRP(*YES).
001400 d  InstDate                      7s 0                                    

 Now the EXTPGM function cannot be added to a PI, and we're at V7.1 so I do not need a PR, though I doubt adding a PR will help. (note - apparently adding the PR does allow it to compile - WTF?!)

So what's IBM's plan here - force me to go back in time and add the PR's for *ENTRY PLISTs defined as PI's, or when compiling main application programs change them to DFTACTGRP(*NO) and risk various overrides and openscopes not working as expected???

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: DaleB
Premium member *
Reading, PA
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 16 hours 22 minutes ago

You have a cycle-main (no MAIN keyword)? Looking at current version of 7.1 ILE RPG Ref, Ch. 3, section titled Cycle Module. Reads to me like your PI needs an EXTPROC if the prototype is not specified.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 16 hours 11 minutes ago
Edited: Thu, 02 Aug, 2012 at 09:58:12 (4279 days ago)

Neil,

You've always had to use DFTACTGRP(*NO) anytime a Procedure call is in your RPG IV program source. Always been that way. Nothing has changed.

In v7.1 the did remove the requirement for Prototypes for in-line subprocedures, but that's all. If you do use MAIN (which Dale suggested) you still need the Prototype. Although IBM has shown the EXTPGM keyword on the PI line, in practice, I've never been able to get that to work. But I don't think that's your issue.

Perhaps your CRTBNDRPG command had DFTACTGRP(*NO) specified as its default?

Oh, and here's how I handle this issue in my code:

 

 /IF DEFINED(*CRTBNDRPG)                                 
H DFTACTGRP(*NO) ACTGRP(*NEW) FIXNBR(*ZONED:*INPUTPACKED)
 /ENDIF                                                  

 

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 15 hours 37 minutes ago

I know how to handle the problem guys, it's just disconcerting when a program you've compiled many times over suddenly doesn't compile due to a change in the compile and not the code.

 

h option(*nodebugio : *srcstmt)
h copyright('CORPORATION WHAT I WORK FOR')
 *************************************************************
 *    
 *  Program:  USSTLLDPR
 *  Author:   Neilrh                        
 *  Date:     04/19/2011
 *  De!--script--ion:
 *    This program loads pricing for a customer into a price file.
 *
 *************************************************************
 *  *entry parameters
d USSTLLDPR3      pi
d  InstDate                      7s 0
                                                              
d SndMsg          pr                  extpgm('QMHSNDPM')
d  MsgId                         7a   const         
d  MsgfName                     20a   const         
d  MsgDta                      128a   const         
d  MsgDtaLen                    10i 0 const         
d  MsgType                      10a   const         
d  MsgQ                         10a   const         
d  MsgQNbr                      10i 0 const         
d  MsgKey                        4a                 
d  Error                              likeds(APIErr) 

 

 

 This has compiled many times as an OPM program, it doesn't need to be ILE, the only external stuff I'm doing is sending messages using IBM API.  Today it does not compile without one of the following actions:

  • Add a PR - and include the EXTPGM('USSTLLDPR3') bit.
  • Change the H-specs to include keywords DFTACTGRP(*no) ACTGRP()
Posted by: DaleB
Premium member *
Reading, PA
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 15 hours 20 minutes ago

I wasn't suggesting; I was asking. Code shows no MAIN, so cycle-main is implied.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 13 hours 48 minutes ago

Neil,

This is NOT a change in the compiler. Did you guys upgrade and have your compiler defaults reset?

USSTLLDPR3 is a PI. Hence it is a subprocedure that you probably call. That has ALWAYS required DFTACTGRP(*NO).

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 13 hours 21 minutes ago

We've installed cumulative PTF packages, but we haven't reset anything.  The code as listed has compiled many times under V7.1 as an OPM program, now it looks like this:

 *  *entry parameters
d USSTLLDPR3      pr                  extpgm('USSTLLDPR3')
d  InstDate                      7s 0

d USSTLLDPR3      pi
d  InstDate                      7s 0
Posted by: BrianR
Premium member *
Green Bay, WI
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 17 days 10 hours 5 minutes ago
Edited: Thu, 02 Aug, 2012 at 16:02:04 (4279 days ago)

Are you trying to add the EXTPGM keyword to the PI using SEU?  If so, SEU will complain about that because it is frozen at 6.1 and doesn't understand the 7.1 enhancements.  If you ignore the error, it should compile OK (I just tried it), but that's a pain in the ***.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 16 days 19 hours 21 minutes ago
Edited: Fri, 03 Aug, 2012 at 06:51:12 (4278 days ago)

No extpgm does not work on PI, even in RDp, extproc does work, but this isn't an external procedure.  My complaint is that a program I have been compiling for over a year, now won't compile unless I add a PR with EXTPGM or change it to an ILE compile.

Hmmm, but maybe I'll try add the EXTPGM anyway and see if that works.

Huh! Well that actually works - so, the EXTPGM on a PI is required now for an OPM programs *entry parameters, even when your source editor complains about it.

Posted by: clbirk
Premium member *
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 16 days 14 hours 37 minutes ago

have you worn out the punch cards compiling it so often

 

(some old timers on the forum will know exactly what I am talking about, the rest won't have the foggest idea).  You see if you compiled a deck of cards (punch cards) over and over, you could depending on the reader, etc. begin to wear the cards a bit, causing misfeeds, etc.

 

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 16 days 14 hours 17 minutes ago

Neil,

Did you watch my RPG Report video on this topic?

Jump to 7:25 in the video and you'll see that EXTPGM is required on v7r1 on the PI statement for program Entry/PList parameters.

Posted by: neilrh
Premium member *
Jackson, MI
Comment on: Did IBM recently "FIX" the RPG compiler?
Posted: 11 years 8 months 16 days 13 hours 34 minutes ago

I think we discussed this in the class earlier this year, at that time the EXTPGM was required on the PI, but the compiler thought it was optional.  You said at the time it was good practice to get into in case they corrected the compiler - this program was written over a year ago, before we had the discussion, and well before IBM matched the compiler requirements to the documentation.