× 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: Variable Length Fields In V3R7 ILE RPG
  • From: "Reger, Bill" <breger@xxxxxxxxxx>
  • Date: Thu, 13 Jul 2000 13:36:14 -0400

This is from the ILE RPG Reference manual:

2.3.11 Converting Database Variable-Length Fields
 
The ILE RPG compiler can internally define variable-length character or
graphic fields from an externally described file or data structure as 
fixed-length character fields. Although converting variable-length character
and graphic fields to fixed-length format is not necessary, CVTOPT 
remains in the language to support programs written before variable-length
fields were supported.
 
You can convert variable-length fields by specifying *VARCHAR (for
variable-length character fields) or *VARGRAPHIC (for variable-length 
graphic fields) on the CVTOPT control specification keyword or command
parameter. When *VARCHAR or *VARGRAPHIC is not specified, or 
*NOVARCHAR or *NOVARGRAPHIC is specified, variable-length fields are not
converted to fixed-length character and can be used in your ILE 
RPG program as variable-length.
 
The following conditions apply when *VARCHAR or *VARGRAPHIC is specified:
 
   If a variable-length field is extracted from an externally described
file or an externally described data structure, it is declared in an ILE RPG

    program as a fixed-length character field.
 
   For single-byte character fields, the length of the declared ILE RPG
field is the length of the DDS field plus 2 bytes.
 
   For DBCS-graphic data fields, the length of the declared ILE RPG field
is twice the length of the DDS field plus 2 bytes.
 
   The two extra bytes in the ILE RPG field contain a unsigned integer
number which represents the current length of the variable-length field. 
    Figure 95 shows the ILE RPG field length of variable-length fields.
 
   For variable-length graphic fields defined as fixed-length character
fields, the length is double the number of graphic characters.

William K. Reger
Senior Project Manager
Levitz Furniture Corporation
Phone:  (561) 994-5114
E-mail:  breger@levitz.com <mailto:breger@levitz.com> 

                -----Original Message-----
                From:   Gary Monnier [mailto:GaryMon@powertechgroup.com]
                Sent:   Thursday, July 13, 2000 12:37 PM
                To:     Midrange List Server
                Subject:        Variable Length Fields In V3R7 ILE RPG

                We have a customer running OS/400 V3R7 and wishs to utilize
variable length
                fields in a data file.  Anyone know if, and how, they can
use ILE RPG to set
                variable length fields from ILE RPG?

                +---
                | This is the Midrange System Mailing List!
                | To submit a new message, send your mail to
MIDRANGE-L@midrange.com.
                | To subscribe to this list send email to
MIDRANGE-L-SUB@midrange.com.
                | To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
                | Questions should be directed to the list owner/operator:
david@midrange.com
                +---
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-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-Ups:

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.