× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Subfield lenght cannot exceed 256 bytes
  • From: "Scott Klement" <infosys@xxxxxxxxxxxx>
  • Date: 24 Oct 1999 23:22:36 -0500

Hi,
     First, I'd like to say (just to get it out of the way) that the
silly 256-max length restriction was removed in RPG IV (ILE RPG/400)
and unless its NOT an option, I'd strongly suggest using RPG IV, its
a far more robust language.

Assuming that you can't use RPG IV:

Although a single field's length is limited to 256, data structures
and arrays are not.  This provides with some simple workarounds to
your problem.

You did not mention WHY you're using a data structure.  Depending on
what else you're doing with the data structure, you can simply define
multiple subfields in the DS, like so:

     ** Example for a 400 byte record length:
     IDSREC       DS
     I                                        1 256 PART1
     I                                      257 400 PART2
     .... then later in the program ...
     C                     CALL 'MYPGM'
     C                     PARM           DSREC

If for some reason, you can't do it that way, another method is to
use an array instead of a data structure:
     E                    REC       400  1
     I            DS
     I                                        1 400 REC
     .... then later in the program ...
     C                     CALL 'MYPGM'
     C                     PARM           REC


Good Luck...


Sanjiv Hati <hattys@yahoo.com> wrote:
>
> Hi all
>
> I am using a DS structure in RPG/400 to store a record
> from a physical file . The length of the record is
> more than 256 bytes. But when I declare the length of
> the subfield of the data structure as 9999 and then
> compile my program it give compilation error i.e.
> subfield length can't exceed 256. The basic purpose is
> to pass this subfield as parameter to another pgm.
>
> I want to pass charater data as parameter with length
> 9999 to another pgm (or more than 9999) specifically
> in RPG/400.
>
> Can anyone provide with a solution.
>
> Thank you in advance.
>
> Sanjiv Kumar Hati
> BFL software
> Bangalore
> India.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.