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



Hi,

try the following:
1. Add an externally described datastructure for your file
2. Define a subfield that overlays the external datastructure

Let's assume, we have a physical file where on position 30 the Object Name
is defined (10A) and on position 40 the library name (10A). You want to
combine Object Name and library name into a single field with the length of
20A.

Example:
FMyFile    IF   E             DISK
 *-----------------------------------------------------------
D DSMyFile      E DS                  ExtName(MYFILE)
D   NameQual                    20A   Overlay(DSMyFile: 30)
 *-----------------------------------------------------------
 /Free
    Read MyFileF;
    Dsply NameQual;
    *INLR = *On;
 /End-Free

Mit freundlichen Gru?en / Best regards

Birgitta

"Shoot for the moon, even if you miss, you'll land among the stars."
(Les Brown)

-----Ursprungliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]Im Auftrag von Willie J. Moore
Gesendet: Freitag, 23. Juni 2006 23:48
An: Midrange-RPG (E-mail)
Betreff: Defining two fields as one.


I am converting some old RPG programs with internally defined files to
RPGIV.

What I have run across is two fields defined as one in the old RPG program.
Ex:     1       5       lot1
        6       10      lot2
        1       10      lotall
Then lotall is used though out the program.

I know that I can do this with DS (Data Structures). Chain to file then move
fields in the DS.  But that seams like a lot of work and extra programming.

I would like to know if there is an easier way to do this that would not
require the use of the DS. I would prefer that whenever a chain/read is done
on file that lotall is build and ready.

Thanks in advance for the help,
William Moore
Cal Fine Wire


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.