× 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: R: Non-Join Multi PF Logical File Format
  • From: Finucci Domenico <finucci@xxxxxxxxxxxx>
  • Date: Thu, 25 May 2000 09:12:01 +0200

Hi, Dave. Here it is what happens on my AS/400.
File PF1
    R RPF
    A  C001
    A C002
    A C003
File PF2
    R RPF
    A  C001
    A C002
    A C003
Please note that you must use the same name for the record format of PFs.
LF looks like that:
A        UNIQUE
A    R RPF     PFILE(PF1 PF2)
A    K    C001
The COBOL program looks like:
SELECT LF ASSIGN TO DATABASE-LF
             and so on
FD  LF.    
    COPY DDS(or DDR) -ALL-FORMAT and so on REPLACING  == 05 == BY == 01==
 
The compiler expands the statement as follows:
01 LF-RECORD    pic X(99)
01  RPF REDEFINES LF-RECORD
    06 C001    PIC
    06 C002   PIC
01  RPF REDEFINES LF-RECORD   (a second time)
    06 C001    PIC
    06 C002   PIC
The COBOL program (ILE) compiles, but i don't think it 'll work and suit your needs (as you may see, the two PF share the same phisical area in memory).
 
I think you should design your database file in a more relational - compliant model instead.
Bye

Domenico Finucci

-----Messaggio originale-----
Da: David Keck [mailto:dkeck@idt.net]
Inviato: mercoledì 24 maggio 2000 21.56
A: COBOL400-L@midrange.com
Oggetto: Re: Non-Join Multi PF Logical File Format

Thanks Dave, but I seek the answer to the question with the constraint that the LF be unchanged in it's definition, and no override applied prior to compile or execution. -Dave K.
----- Original Message -----
From: David Shea
Sent: Wednesday, May 24, 2000 8:24 AM
Subject: Re: Non-Join Multi PF Logical File Format

In RPG you would do your example as follows:
     A          R AREC                      PFILE(A)
     A          K FLD1                                
     A          R BREC                      PFILE(B)
     A          K FLD1                                
 
This sorts the records properly, but returns different record formats.
 
I'll be _very_ curious to know if Cobol can actually do what I _wish_ RPG could.
 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Time share a current model AS/400 over the internet!
Individual developers, company development and testing, or full outsourcing.
Get access to RPG, Cobol, C, SQL, Java and more for a low monthly fee.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
----- Original Message -----
From: David Keck
Sent: Wednesday, May 24, 2000 12:06 PM
Subject: Non-Join Multi PF Logical File Format

Can a COBOL program work with a non-join logical file record format which references more than one PF (more than one PF in the DDS PFILE entry) ?  I know RPG programs can NOT compile if they reference such a file.  For example ...
 
Physical File named "A"
     A          R AREC              
     A            FLD1           1A 
Physical File named "B"  (In this case the entire record format for file AA is identical to that of file A)
     A          R BREC             
     A            FLD1           1A 
Logical File named ABLF
Non-Join Multi-PF Logical File Format (in this case the only format in the LF)
     A          R AREC                      PFILE(A B)
     A          K FLD1                                

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.