× 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: Ext-desc I/O using data structures (was:Field record relatio
  • From: Lorne Sturgeoff <lgs@xxxxxxxxxxx>
  • Date: Fri, 3 Apr 1998 13:28:43 -0500

Hello, Greg.  Thanks for your comments.

I must be missing something.  Seems to me that what you want to do can quite 
easily be done using currently available RPG constructs.  Use an externally 
defined data structure to define the same externally defined file in the pgm.  
When you do a normal input from the database file, the DS will contain all the 
data from the input record because the subfields represent the same storage as 
the compiler-generated input fields.  You can then reference the entire record 
by the data structure name.  True, the subfield names must be the same as the 
external file so that you cannot use the 'prefix' keyword on the data 
structure.  But, you could define a second data structure based on the same 
file using the prefix keyword and move the first data structure into the second 
one, if that was a requirement.

Lorne Sturgeoff, Sr.Programmer/Analyst, Allied International Credit Corp.
Phone: (905) 513-3517     Fax: (905) 470-8155    e-mail: lgs@aiccorp.com
 

-----Original Message-----
From:   Greg Thielen [SMTP:gregt@isda.com]
Sent:   Friday, April 03, 1998 11:34 AM
To:     MIDRANGE-L@midrange.com
Subject:        RE: Ext-desc I/O using data structures (was:Field record relatio

Lorne,

Data structure IO for externally described files comes in handy if you want to 
manipulate an entire record with one operation, as opposed to one operation for 
each field (and what happens when you add more fields?).  You could externally 
describe the data structire and program describe the file, but you lose the 
ability to use keyed IO with key lists, partial keys, etc.  Consider that you 
could:

1) Define an externally described file.
2) Define an externally described data structure using the same file def.
3) Define a stand-alone field "like" the previous data structure.
4) Specify the DS name on an input instruction.
5) Copy the contents of the ext DS to the "like" field with one MOVE.
6) Copy the contents back with one MOVE.

This cannot be done now with externally described files, meaning, for example,  
that I could not use a composite key for the input operation.  This also allows 
me to not have to change the program if fields are added or removed from the 
file--just recompile.  IMHO, this would be a very welcome feature.



application/ms-tnef


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.