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!

Referencing error

Status
Not open for further replies.

Uvaiz

MIS
Jun 13, 2003
38
CA
Hello everyone,

I have developed a COBOL program on AS400 to screen display certain information. This is the first time I am using the Procedure Division using a parameter as under.

PROCEDURE DIVISION
USING LK-PARM-FIELDS.

The program was successful in compiling but caused running error with the following message.

Cause . . . . . : You attempted to reference an external or internal
parameter for which the calling program did not pass a corresponding
argument.

A gist of my code is as follows:


LINKAGE SECTION.

01 LK-PARM-FIELDS.
05 LK-ACCT LIKE A-NO OF DEALER-RECORD.
05 LK-LAST-FUNCTION-KEY PIC X(2).

4000-START-FILE.
MOVE LK-ACCT TO A-NO OF DEALER-RECORD
START DEALER-FILE
KEY NOT < EXTERNALLY-DESCRIBED-KEY
INVALID KEY
SET END-OF-DATA TO TRUE
NOT INVALID KEY
SET START-OF-DATA TO TRUE
PERFORM 5000-CLEAR-SUBFILE.

Would very much appreciate if someone could enlighten me what could be the problem please.

Thanks
Tony
 
Sounds like the program that is calling your program is either:

1) not passing any linkage data to your program,

Code:
CALL "MYPROG"

2) passing data with the wrong linkage

Code:
CALL "MYPROG" USING ACCT-NO CODE


&quot;Code what you mean,
and mean what you code!
But by all means post your code!&quot;

Razalas
 
When writing a subroutine (Procedure using) it would indicate that another process will be calling your program. The message you are getting appears to me to indicate that the calling program (program calling your routine) does not call your program with matching parameters.

Your program has:

PROCEDURE DIVISION USING LK-PARM-FIELDS.

The calling program must have:

CALL YOURPROGRAM USING LK-PARM-FIELDS.

Sounds like the calling program did not call using the same parameter you were expecting.

etom.
 
Thanks Razalas and Etom,

The program worked when called using the expected LK-PARM-FIELDS.

Very much appreciated.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top