Search code examples
web-servicesibm-midrangerpglerpg

Why cant I use a Character length more than 65535 RPGIV


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.


Solution

  • 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.