what is the difference between static call and dynamic call?
Answer / ravi
Here is the difference between static and dynamic calls, it
is mentioned very clearly in IBM COBOL Manual, read it
carefully, it should clear all your doubts regarding calls
WORKING-STORAGE SECTION.
01 PGM-NAME PIC X(08).
PROCEDURE DIVISION.
BEGIN-PARA.
MOVE “SUBPROG” TO PGM-NAME.
* Dynamic call
CALL PGM-NAME USING RECORD-1. ****** Here PGM-
NAME is called as identifier*******
*Static Call
CALL “SUBPROG” USING RECORD-2. ****** Here it is
CALL literal where literal is SUBPROG*******
If you do not know the program-name to be called until run
time, use the format CALL identifier, where identifier is a
data item that will contain the name of the called program
at run time. For example, you could use CALL identifier
when the program to be called varies depending on
conditional processing in your program. CALL identifier is
always dynamic, even if you use the NODYNAM compiler option.
Making static calls
When you use the CALL literal statement in a program that
is compiled using the NODYNAM and NODLL compiler options, a
static call occurs. With these options, all calls of the
CALL literal format are handled as static calls. In the
static CALL statement, the COBOL program and all called
programs are part of the same load module.
Making dynamic calls
When you use a CALL literal statement in a program that is
compiled using the DYNAM and the NODLL compiler options, or
when you use the CALL identifier statement in a program
that is compiled using the NODLL compiler option, a dynamic
call occurs.
Making both static and dynamic calls
You can use both static and dynamic CALL statements in the
same program if you compile the program with the NODYNAM
compiler option. In this case, with the CALL literal
statement the called subprogram will be link-edited with
the main program into one load module. The CALL identifier
statement results in the dynamic invocation of a separate
load module. When a dynamic CALL statement and a static
CALL statement to the same subprogram are issued within one
program, a second copy of the subprogram is loaded into
storage. Because this arrangement does not guarantee that
the subprogram will be left in its last-used state, results
can be unpredictable.
Performance considerations of static and dynamic calls
Because a statically called program is link-edited into the
same load module as the calling program, a static call is
faster than a dynamic call. A static call is the preferred
method if your application does not require the services of
the dynamic call.
Statically called programs cannot be deleted using CANCEL,
so static calls might take more main storage. If storage is
a concern, think about using dynamic calls. Storage usage
of calls depends on whether:
The subprogram is called only a few times. Regardless of
whether it is called, a statically called program is loaded
into storage; a dynamically called program is loaded only
when it is called.
You subsequently delete the dynamically called subprogram
with a CANCEL statement.
You cannot delete a statically called program, but you can
delete a dynamically called program. Using a dynamic call
and then a CANCEL statement to delete the dynamically
called program after it is no longer needed in the
application (and not after each call to it) might require
less storage than using a static call.
| Is This Answer Correct ? | 32 Yes | 9 No |
I have one GDG. Everyday One new version is being created.Now I want to split this created version in different files each having 1000 records. Here Problem is I don't know How many records will be there in new version of GDG? that's why I don't know How many Out files we need to use . Interesting??????????????
Are all (i), (ii), (iii), (iv) of the below are VALID to reference a temporary dataset ? STEP2 DD1 DD DSN = &&TEMP STEP3 DD2 DD (i) DSN = TEMP (ii) DSN = *.TEMP (iii) DSN = *.STEP1.DD1 (iv) DSN = *.STEP1.DD1.ONE
How are datasets concatenated?
i have 3 steps in my jcl, where i want to run only one step at a time depending on the variable. How should i give the condition statement... I have tried this with two steps which is working but not able to add condn for the 3rd step. can anyone help me... I want to know the cond stmt which i can code in step 3 and step4, so that only either step2 or step3 or step4 executes
i have records from 1 t0 100 . i need to open records from 10 to 18 and change the values in tht ? how can i do tht ?
What are the common jcl syntax errors you get? This is not abends?
A. Job Abended in STEP03. Now run job again to execute STEP03, STEP04 (STEP01,STEP02 should not execute again)
3 Answers Cap Gemini, CSC, Xchanging,
How do you submit JCL via a Cobol program?
How can the submitting users racf authority be overridden in a job stream?
is step name is compulsory in jcl ?
what is the meaning of 'sysin dd dummy'
a input file contains 1000 records, how to move the first 500 record into one out put file and how to move to second 500 records to anothere output file