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
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
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.
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
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
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.
Yes, MDratwa, a multi-format logical file could be made as you showed.
But, I think, the file would be rather useless..
Phil
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
Useless, but it actually answers the original question
“how to solve this error?”
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.