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



Here is how I addressed this. This is from a program that uses a combined
logical (ARCREM2) over two files, ARCRE and ARCRU, with record formats CRE
and CRU, respectively.

The thing to remember is that you must SETLL and READE using the file name,
not the record format, if you want to read all of the records regardless of
which record format they are in. When it comes time to update, you need to
update the record format (if the file is externally described), and not the
file name. So you use the value in the *RECORD field in the INFDS to
determine which record format you have read (and need to update or delete).


     FArcrem2   UF   E           K Disk    Infds(Creds)
      * Combined logical over ARCRE and ARCRU          

      * Record format for ARCREM2 
     D Creds           DS         
     D  Crem2_Fmt        *RECORD   

FL01    ** Update any pending cash & unapplied cash records.

FL01 C     Klist7        Setll     Arcrem2

 

FL01 C                   Dou       %EOF(Arcrem2)

 

FL01 C     Klist7        Reade     Arcrem2

 

FL01 C                   If        %EOF(Arcrem2)

FL01 C                   Leave

FL01 C                   Endif

 

FL01    * Was the record in Cash or Unapplied Cash? Look at *INFDS to see
which 
FL01    * file format, and process accordingly.

FL01 C                   Select

 

FL01    * Record found in Cash.

FL01 C                   When      Crem2_Fmt = 'CRE'

 

..... Do record format CRE processing here ....
FL01 C                   Update    Cre              
          
                                                    
FL01    * Record found in Unapplied Cash.             
FL01 C                   When      Crem2_Fmt = 'CRU'

..... Do record format CRU processing here ....
FL01 C                   Update    Cru        
FL01 C                   Endsl 
                               
FL01 C                   Enddo 

Francis Lapeyre
IS Dept. Programmer/Analyst
Stewart Enterprises, Inc.
E-mail: flapeyre@xxxxxxxx 



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of steema@xxxxxxxxxxxxx
Sent: Thursday, December 22, 2005 4:28 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: multi format logical.

HI I have to use a logical that is composed of 2 files (PF), let us call it
Logfile. The names of the fields that are designated as Keys, are the same.
I am not sure as to process this in RPG. Do I use the READ LOGFILE method,
am I going to get all records. Is there a better way to obtain the data,
perhaps via SQL?

I will need to allow the users to either Change some of the fields in this
file, or to Delete a record ( but no add).

Thanks,Steve
--
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 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.