200 pts.
 Logical file Error.
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
ASKED: April 10, 2012  6:20 AM
UPDATED: April 17, 2012  3:49 PM

Answer Wiki:
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
Last Wiki Answer Submitted:  April 17, 2012  3:48 pm  by  nuccio   290 pts.
All Answer Wiki Contributors:  nuccio   290 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 44,610 pts.

 

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.

 33,595 pts.

 

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

 

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

 109,985 pts.

 

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.

 675 pts.

 

Yes, MDratwa, a multi-format logical file could be made as you showed.
But, I think, the file would be rather useless..
Phil

 44,610 pts.

 

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

 109,985 pts.

 

Useless, but it actually answers the original question
“how to solve this error?”

 44,610 pts.

 

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.

 675 pts.