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



I am writing to a file, and one of the fields is a 150 Alpha VARLEN
field.  This file will contain a large number of history records, and
I am doing this to conserve space:

     A            DMESSAGE     150A         TEXT('Denial Message')
     A                                      VARLEN

What I am trying to do is create a DS, using LIKEREC with the format
of the file which contains the VARLEN field, like this (this is just
some test code):

     FCBI1PF    O    E           K Disk

     D TheTest         DS                  LikeRec(RCBI1:*Output)
     D                                     Inz

The DS that gets created contains a field for the DMESSAGE field, and
it is set up as VARYING by the compiler.  Beautiful.

Unfortunately, when I eval something into the DMESSAGE field in the
data structure, then write to the CBI1PF file using that data
structure, like this:

TheTest.DMessage='This is a test message, created for testing purposes';
Write Rcbi1 TheTest;

In debug, I see that the DS has the correct length set (52) using %Len
to test the length.  But when I write, the field in the DB file
contains all 150 characters, with trailing spaces added.  Is there a
trick to making the WRITE op recognize the DS variable length, that
the compiler created for me, based on the file structure, or do I have
to eval %Trim from the DS to the actual file buffer fields?

-- 
"Enter any 11-digit prime number to continue..."

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.