Logical file Error.

230 pts.
Tags:
AS/400 DB2
Logical File
i try to create Multiple-format Logical File but i getting compile time error.
i have two PF dds is as follow..
A          R RDEPTMST               
A            DEPTNAME      15       
A            DID            5       
A            LNAME         15       
******************************
A          R RBIODATA            
A            FNAME         10A   
A            LNAME         10A   
A            DID            5    
A            MNAME         10    
**********************************
i created  Multiple-format Logical File for above two PF 
DDS is as follow
A          R RBIODATA                  PFILE(BIODATA)   
A          K FNAME                                      
A          R RDEPTMST                  PFILE(DEPTMST)   
A          K DEPTNAME                                   
******************************
when i try to compile above LF getting error
    ID      Severity  Number                                                                                                       
* CPF3238      40        1      Message . . . . :   Key field DEPTNAME not same as previous formats.                               
how to solve this error?


Software/Hardware used:
i-series

Answer Wiki

Thanks. We'll let you know when a new response is added.

You must include name field in logical file description:
A R RBIODATA PFILE(BIODATA)
A FNAME 10A
A LNAME 10A
A DID 5
A MNAME 10
A K FNAME

A R RDEPTMST PFILE(DEPTMST)
A DEPTNAME 15
A DID 5
A LNAME 15
A K DEPTNAME

Discuss This Question: 9  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Wow, can not imagine how you plan to use this file with a single key on Fname from one file and Dept from another. Put your data into a spreadsheet with each record from either file being a row and the Fname from one file and the dept from the other in column A and then sort it on column A. What can you do with the result?. The file won't compikle because the key structure in multi-format must be consistant between the fromats. You've defined the first key column as 10A in one format and 15A in the other. Phil
    49,730 pointsBadges:
    report
  • CharlieBrowne
    Are trying to setup a Join File When you do that use use the JFILEm HOIN, and JFLD keywords at the beginning of the file.
    41,370 pointsBadges:
    report
  • NickHutcheson1
    We have a logical based over two physicals but as Phillip stated, the keys are the same for both. And the pf keys are the same. It is kinda grouping different types of records. Purchased parts and Manufactured parts. A UNIQUE A R STKMMR PFILE(STKMM) A K AVPART A R STKMPR PFILE(STKMP) A K AWPART
    1,380 pointsBadges:
    report
  • TomLiotta
    You can't have keys that aren't defined the same. How would the system know which definition to use when you use a value to select with? If the keys are different, why would you even want these accessed through the same logical file? The two files don't match up at all. It looks more like this should be a JOIN rather than a multi-format logical file. Tom
    125,585 pointsBadges:
    report
  • MDratwa
    A R RBIODATA PFILE(BIODATA) A K FNAME A K *NONE A R RDEPTMST PFILE(DEPTMST) A K *NONE A K DEPTNAME Check out the DDS manual for physical/logical file under pos 19-28 (Name FIeld) for more info about the "*NONE" used for different format/key field(s) setup.
    785 pointsBadges:
    report
  • philpl1jb
    Yes, MDratwa, a multi-format logical file could be made as you showed. But, I think, the file would be rather useless.. Phil
    49,730 pointsBadges:
    report
  • TomLiotta
    But, I think, the file would be rather useless. I agree; and I think some others might agree as well. Since the files have almost no similarities and the keys won't match at all, there seems to be no use in having them combined this way. A basic JOIN would at least seem reasonable. But I can't think of any useful way to use this file as the question wants it to be. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Useless, but it actually answers the original question "how to solve this error?"
    49,730 pointsBadges:
    report
  • MDratwa
    All I was doing was answering the original question. I would not have done it that way but it shows the flexible of the AS400.
    785 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following