The Entry Point Mapping facility enables you to specify entry points in COBOL programs so that the application can find them at run time. You need to do this for any entry points in programs which will not have been loaded prior to them being called.
To appreciate the functions that this facility performs, you need to understand how calls to entry points are normally resolved using the run-time system.
When a program makes a call to an entry point in which the entry point has not been resolved by statically linking the program, the run-time system looks for the entry point to resolve it dynamically.
When a program is loaded, the name of the program and all the entry points in the program are recorded in a table. When a call to an entry point is made, the run-time system searches the table for the entry point-name. If it does not find the entry point-name, it looks on disk for an executable file of the same name. If it does not find one it returns an error.
Consequently, if your program calls an entry point that is not the name of an executable file or is not an entry point in a previously loaded program, the run-time system cannot find the entry point and your program fails. This is the only case where you need to use the Entry Point Mapper.
This problem often occurs when you take code that has been downloaded from a mainframe to the PC for further development. Mainframe programs often have several entry points in a single program. On the mainframe, entry points are resolved by linking, so calls can be made to a program and the entry point located whether or not the program has been called.
Using Net Express, if the program containing the entry point has not already been called, the call to that entry point fails.
To get round this problem, you need to create an entry name map file containing an entry point table and make it available to the run-time system.
You create your map file with a text editor. For each entry point you need to enter the following three lines:
[ENTRY-POINT] entry-point-name [PROGRAM-NAME] main-program-name [SUBPROGRAM-NAME] subprogram-containing-entry-point
Consider a run unit with a main program A and subprogram C. Within the run unit, A calls entry point B which is in program C. The table entry in the entry name map file is:
[ENTRY-POINT] B [PROGRAM-NAME] A [SUBPROGRAM-NAME] C
Notes:
You use the entry_name_mapper tunable to indicate to the run-time system that you want to use entry name mapping. If entry_name_mapper is set, how the run-time system searches for entry name map files depends on whether the ENTRYNAMEMAP environment variable is set:
In either case, the run-time system could find more than one entry name map file, which means that the same entry point could be defined differently in different files. If this happens, precedence is given to the definition in the entry name map file that was found first. To change the order in which the run-time system finds entry name map files you need to change the order in which the files appear in the COBDIR or ENTRYNAMEMAP environment variable paths.
Related Topics:
To create an alias you use the Entry Point Mapper to emulate the alias function of an IBM mainframe linkage editor, which redirects the system to execute a program accessed via an alias name. To do this you must edit the entry name map file using a text editor.
At run time, Net Express first looks for a program with the original name. If it finds one, it does not invoke the Entry Point Mapper.
Enter the alias on the [ENTRY-POINT] line and the actual program name on the [SUB-PROGRAM] line.
Consider a run unit with a main program named progroot. Within the run unit, progroot issues a call using the name pacct001. The actual name of the subprogram required is tacct001. The table entry in the mfentmap.dat file is:
[ENTRY-POINT] pacct001 [PROGRAM-NAME] progroot [SUBPROGRAM-NAME] tacct001
Consider the situation where you want to load a program by using a different name to that given to the source program. For example, your JCL might contain an instruction to load myprogx, whereas the actual name of the program is myprog. On the mainframe, you could achieve this by linking the program and giving it the required name. However, you cannot link COBOL programs in Net Express; you therefore need to use the Entry Point Mapper to make an association between the name used to load the program and the actual program name.
For example, suppose your program is called myprog, but you instead want to use myprogx as the name to load to the program. The table entry required in the mfentmap.dat file is:
[ENTRY-POINT] myprogx [PROGRAM-NAME] * [SUBPROGRAM-NAME] myprog
where [ENTRY-POINT] defines the alias name and [SUBPROGRAM-NAME] is the name of the executable program.