Hi! I'm new to cobol programming. What I was asked to do is to create 2 programs to manage some files. Program "A" is calling Program "B" using CALL "ProgramB" USING Param1 Param2. Everything is working well if I do this. My problem is that I must be able to run Program "B" as a "stand alone" program (user must be able to call it from the shell without passing any parameters to it). When I try to execute this program, I get this error: 203 CALL parameter not supplied.
What I want to do in Program "B" is to check if some arguments where "passed" to the program or not. Here's an example of what I tried:
IDENTIFICATION DIVISION.
PROGRAM-ID PROGRAM-B.
...
LINKAGE SECTION.
01 PARAM1 PIC 9(03).
01 PARAM2 PIC S9(01).
...
PROCEDURE DIVISION USING PARAM1 PARAM2
1000-MAIN SECTION.
1000-START.
* initialize the variables?
IF PARAM1 = LOW-VALUES OR HIGH-VALUES
MOVE ZERO TO PARAM1
END-IF
IF PARAM2 = LOW-VALUES OR HIGH-VALUES
MOVE ZERO TO PARAM2
END-IF
* check if program was called or executed as stand alone
IF PARAM1 NOT ZERO
...
ELSE
...
END-IF.
Any idea on why I get this error? I want to set PARAM1 to 0 if the program isn't called from another program or use param1 and param2 value in my program if it was called by another one. Thanks for your help (and reading this all ;-) )
What I want to do in Program "B" is to check if some arguments where "passed" to the program or not. Here's an example of what I tried:
IDENTIFICATION DIVISION.
PROGRAM-ID PROGRAM-B.
...
LINKAGE SECTION.
01 PARAM1 PIC 9(03).
01 PARAM2 PIC S9(01).
...
PROCEDURE DIVISION USING PARAM1 PARAM2
1000-MAIN SECTION.
1000-START.
* initialize the variables?
IF PARAM1 = LOW-VALUES OR HIGH-VALUES
MOVE ZERO TO PARAM1
END-IF
IF PARAM2 = LOW-VALUES OR HIGH-VALUES
MOVE ZERO TO PARAM2
END-IF
* check if program was called or executed as stand alone
IF PARAM1 NOT ZERO
...
ELSE
...
END-IF.
Any idea on why I get this error? I want to set PARAM1 to 0 if the program isn't called from another program or use param1 and param2 value in my program if it was called by another one. Thanks for your help (and reading this all ;-) )