Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS/400 COBOL Complilation errors

Status
Not open for further replies.

Uvaiz

MIS
Jun 13, 2003
38
CA
Hello Friends,

I received the following message when compiling my AS/400 COBOL program


Message . . . . : 'F0002 OF RECORD OF ACCT-CHG' not defined in
'RECORD'. RECORD-KEY with EXTERNALLY-DESCRIBED-KEY ignored.

The following is my statement in DATA DIVISION

DATA DIVISION.
FILE SECTION.

FD ACCT-CHG.

01 ACCT-CHG-RECORD
COPY DD-ALL-FORMATS OF NOMCHGLF.

The following is the DDS for my logical file

********************************************************
* REPMOVN1 PHYSICAL File *
* Logical File NOMCHGLF *
* KEY Account Number (F0002) *
***********************************************************


A R RECORD PFILE(USERDEV/REPMOVN1)
A K F0002
************* End of data ***************************

I was successful in comipiling my logical file NOMCHGLF.

Would someone kindly enlighten me the reason for this message please.


Thank you in anticipation.

Tony
 
Code:
01   ACCT-CHG-RECORD             
COPY DD-ALL-FORMATS OF NOMCHGLF.
Shouldn't there be a period at the end of the 01 level?
 
Hi Dimandja,

Sorry there is a period at the end of of the 01 level as follows.


FD ACCT-CHG.

01 ACCT-CHG-REC
COPY DD-ALL-FORMATS OF NOMCHGLF.

 
01 ACCT-CHG-REC[highlight].[/highlight]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I believe that the real problem is that 'RECORD' is a reseverd word. Since your record format is named 'RECORD', the copied in definition is being rejected and therefore the field 'F0002' is not defined.

You should have another message that precedes this one and it should be similar to :
"MSGID: LNC1106 SEVERITY: 30 SEQNBR: 001600
Message . . . . : File 'DATA-FILE' not externally described, keyed file. External key specification ignored. "

Hope this helps.
 
Thanks David,

You are indeed right. The name RECORD is a COBOL reserved name. Created a physical file with a different record name and it worked||||||||||


Thanks everyone

Tony
 
Doesnt the logical file have to have some fields?
Looks like it is length Zero
In your discription you have

A R RECORD PFILE(USERDEV/REPMOVN1)
A K F0002

The K disignated reference is the key, but you do not discribe the field F0002. Dont you have to describe the fields? Looks like you have no fields but F0002 is the key.

I have limited knowledge of logical file processing.


If you do not like my post feel free to point out your opinion or my errors.
 
If you explain what you are describing someone may have a clue.

If this logical file describes an existing file and you are just saying a certain field is the key where is your description of the file?

If you do not like my post feel free to point out your opinion or my errors.
 
When a logical file has the same record format name as the physical file it is based on, at compilation time it (the logical file) inherets all of the physical file's fields, so they do not need to be specifically listed.

If, however, you specify any fields in the logical file source, only those fields will be included in your logical file.

If you use the same record format name and specify some of your fields, the physical file and the logical file will have different format level identifiers ( possible level check) even though they have the same format name.
 
Thanks for useful discussion on the error that I encountered. David was right the error occured due to the RECORD format name defined as RECORD which is a reserved name by COBOL hence the error. I did circumvent this problem by creating a physical file and using copy file command and appended the subfile data and the program works. Thanks for everyones inputs and the exchange of ideas were very informative and productive.

Thanks everyone.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top