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



Willie, please re-read Birgitta's post.  That correctly describes how to do it. 
 It cannot be done by the database without resorting to a view or logical file.

Eric DeLong
Sally Beauty Company
MIS-Project Manager (BSG)
940-297-2863 or ext. 1863



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Willie J. Moore
Sent: Tuesday, June 27, 2006 1:45 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Defining two fields as one.


Peter,
I did not wan tot add another file (logical). Looks like I will have to 
do a concatention inside the program.
Thanks,
William...

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Peter Dow (ML)
Sent: Sunday, June 25, 2006 1:27 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Defining two fields as one.


Hi Willie,

 From the sound of it you have externally defined the PF.  Does the PF 
have two fields, or one?

For the particular program you're talking about, if the PF has one field 
(lotall), then forget about the two subfields (lot1 and lot2).  If the 
PF has two fields, you can concatentate them in code as lot1 + lot2.  Of 
course the data structure is more efficient than concatenation.

Another solution, that would handle the program you're converting, or 
other programs that use those 3 fields would be to define a logical that 
has them all, for example:

Physical file FILE1
A          R FORMAT1         
A            LOT1           5A
A            LOT2           5A

Logical file FILE1LF
A          R FORMAT1                   PFILE(FILE1)   
A            LOT1                                      
A            LOT2                                      
A            LOTALL                    CONCAT(LOT1 LOT2)

Keep in mind that the order of the fields in the logical file is 
important.  If your program does the following:

    LOT1 = 'ABC';
    LOT2 = 'DEF';
    LOTALL = '1234567890';

what you'll end up with in the physical file is:

    LOT1='12345'
    LOT2='67890'

hth,
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
pdow@xxxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxxx> /




Willie J. Moore wrote:
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


  


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.