Go Back   System iNetwork Forums > Archived Forums > RPG > General RPG

 
 
Thread Tools Display Modes
  #1  
Old 08-16-2000, 01:33 AM
Giovanni Cosmi
Guest
 
Posts: n/a
Severity level in compiling RPG bound pgm

Hello,

Does anyone already encounter the problem of compiling an RPG IV bound
pgm for lookup on an array with high indicator that doesn't have sequence
definition. This RPG IV that we're compiling was converted from RPG III
in which we used to compile with severity error 11 to get away with the problem.
Now the RPG IV compiler is giving us a severity error of 20 which I'm not sure
why IBM changed it from severity 10 to 20. We don't want to change the
compiler option to 20 because this may cause another problem and surely
we don't want to change the program either. Do we have an alternative
solution on how to fix this kind of problem?

Here's the error message:
RPG III compiler error message for lookup - QRG5058 severity 10
RPG IV compiler error message for lookup - RNF5058 severity 20

Thanks in advance for any help or insights that I can get.

Regards,
Giovanni
  #2  
Old 08-16-2000, 04:00 AM
Bruno roudot
Guest
 
Posts: n/a
We have already got this compile error : only adding keyword <B>ASCEND</B> or <B>DESCEND</B> in statement where array is declared can resolve this when using HI or LO indicator in <B>LOOKUP</B>.<BR><BR>Maybe RPG4 needs explicit declaration for sort sequence...
  #3  
Old 08-16-2000, 04:10 AM
Giovanni Cosmi
Guest
 
Posts: n/a
Not doable

Thank you guys for your quick responses but I got a question now on how
its going to work. The array definition is just an overlay to a field that's coming
from a file and we don't want this to be resequenced by putting ASCEND. If
I put this keyword, does it change the sequence value of the field as well? I
know that this kind of logic doesn't make sense and I'm still confused as to
why it was written this way (written early 80's) but I'm stuck with it and I need
some option to handle it.

Here's the snippet of the code:

D DS
D BL 1 6 0
D DIM(6)
D BLLAEX 1 6 0
D BLLARC 1 3 0
D BLLEXC 4 6 0

Regards,
Giovanni
  #4  
Old 08-16-2000, 04:16 AM
Barbara Morris
Guest
 
Posts: n/a
Severity level

To get the same behaviour, define the array with ASCEND. To recover from this error, the RPG III compiler doesn't just allow the operation; it changes the array to be ascending. (The RPG IV compiler recovers from the error by ignoring the HI indicator, so changing the severity of the compile won't get what you want anyway.)

The severity of the message changed because the default "create a program" threshhold changed. Sev 10 messages for RPG III were enough to get the compile to fail by default. With RPG IV, a sev 10 message is just a warning, so the compile succeeds.

You're right in your decision not to change the compile severity to 20. (For the same reason, you shouldn't really change the RPG III compile severity to 10 ...)

The RPG IV compiler does not guarantee compatibility for RPG III programs that were compiled with a severity higher than the default. For many errors, the action taken by the compiler when it finds an error is different in RPG III and RPG IV.

Barbara Morris, IBM Toronto Lab, RPG Compiler Development
  #5  
Old 08-16-2000, 08:41 AM
Barbara Morris
Guest
 
Posts: n/a
ASCEND keyword

Giovanni, don't worry. Coding ASCEND doesn't cause the array to be resequenced. That only happens if you do a SORTA. The RPG III compiler was doing the equivalent of adding the ASCEND keyword anyway. (Your RPG III program would behave exactly the same if you coded an A for the array.)

When the compiler does a lookup for the HI or LO indicator, it assumes the array is sorted. I'm not sure that you'll always get the results you want. This is true of both the RPG III and RPG IV compilers.

Barbara Morris, IBM Toronto Lab, RPG Compiler Development
  #6  
Old 08-16-2000, 08:50 AM
Giovanni Cosmi
Guest
 
Posts: n/a
Just what I thought...

Thanks for the clarification Barbara and I agree with you that I may not get
the right result everytime I do the lookup.

Regards,
Giovanni
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 07:23 AM.