3

I red the following article and it seems like I should be able to define a variable of type varying that's size limit will be 16mb instead of 65535 characters.

http://www.mcpressonline.com/programming/rpg/v6r1-rpg-enhancements.html

This forum post suggests that it is posible to do this in V6.1.

http://www.code400.com/forum/forum/iseries-programming-languages/rpg-rpgle/11426-character-string-max-length

D BigVarying      S               a   Len(25000000) Varying(4)

When I try to implement this I get the following errors and it seems like I cannot use Len(25000000) Varying(4) enter image description here

Maybe I don't understand what exactly is meant by V6.1 but I checked on the Green screen using the command DSPSFWRSC and get the following Release V6R1.. enter image description here

I also checked by using I systems navigator and I checked the servers properties and it is : i5/OS version Version 6 Release 1 Modification 0.

The IDE I use to compile is IBM Websphere development studio

Version: 7.0.0
Build id: 20070202_0030

Trying to compile a RPGLE function.

Am I checking the correct version or is there a RPG version and how do you check it.

can you please help me out of my confusion.

ᄂ ᄀ
  • 5,669
  • 6
  • 43
  • 57
Renier
  • 1,738
  • 3
  • 24
  • 51
  • Your link says that it's possible to declare a "Len(10000000) Varying(4)" variable, but you show an attempt to declare one as `Len(25000000)`. The linked example is good because it's within the 16MB limit. Do you somehow need a variable that is 25MB long? – user2338816 Aug 25 '16 at 09:22

2 Answers2

4

V6.1 is your operating system version and you can refer to the V6.1 ILE RPG Language Reference here to see if it's possible. I think what you're looking for is on page 185.

I've just tested this in 7.2 and I am not getting the same errors.

 D BigVarying      S               a   Len(25000000) Varying(4)
 RNF0501E Length of character item exceeds 16773104; length defaults to 16773104.
 RNF0231E Length of varying length character item exceeds 16773100; length defaults to 16773100.
   //Dcl-S BigVarying Varchar(25000000);

   BigVarying = 'Hello world';

   Return;

So, as the (duplicate) error mentions

Length of character item exceeds 16773104; length defaults to 16773104.

If you'd like a bigger length you'll need to update to a newer version of IBM i - but the max length is also 16773104, meaning 25000000 is invalid.

Barry
  • 448
  • 5
  • 10
3

While RPGLE supports 16MB variables from 6.1 forward and you are on 6.1..

You have two problems:

  • 25000000 (23.8MB) is bigger than 16773104 (~16MB)
  • Websphere Development Studio v7 (WDSc) is older than IBM i 6.1 (your build date is 2007, the article you're referencing came out in 2008). So your IDE doesn't recognize the new keywords and new max size.

Problem #2 isn't a deal breaker, you can simply ignore the errors in the IDE and compile on ther server successfully. If you were using the green screen editor SEU, you'd have to do the same as IBM stopped enhancing SEU at 6.1.

Charles
  • 21,637
  • 1
  • 20
  • 44