Compaq COBOLExample 1. One of the. separately compiled programs, MAIN- PROGRAM (), has two. SUB1 and SUB2 ( and. Image execution begins and ends in the main. Procedure Division. The program contains one or more CALL. The subprogram may or may not contain CALL statements. If a. subprogram contains a CALL statement, it is both a calling and a called. If the subprogram does not contain a CALL statement, it is a. This RTL routine is needed to make a. KICKS KooKbooK recipe Simple KICKS COBOL programs, part III Accessing external data – Pointers & BLL cells (peek/poke for mainframer’s!) Last time you saw how to. Calling and Sharing Data Between ILE COBOL Programs. Sometimes an application is simple enough to be coded as a single, self-sufficient program.
Micro Focus COBOL for UNIX COBOL User Guide Mixing C and COBOL Programs The Micro Focus COBOL system provides a number of C functions and COBOL library routines to. Hi, can any one help me how to use the pointer concept in CObol. COBOL - Pointers in Cobol - Mainframe forum - Mainframe Mainframe IBM tutorial, tutorials, material, materilas, faq, faqs, interview questions, COBOL,CICS,DB2,JCL. CALL data- name statement (or. Your program main must supply the necessary. Data and files in a COBOL program can. EXTERNAL clause. This ensures that it will be. Any item whose description does not include a VALUE clause will. For example. IDENTIFICATION DIVISION. A file connector can also be external or internal to. This. clause is specified only in File Description entries in the FILE. SECTION or in Record Description entries in the WORKING- STORAGE. Section. The EXTERNAL clause is one method of sharing data between. For example, in the following Working- Storage Section entry. RECORD- 1 are available to any program in the image. RECORD- 1 and its data items as EXTERNAL. RECORD- 1 EXTERNAL. Refer to the Compaq COBOL Reference Manual for the CALL statement format. Thereafter, each time it is called its state is. INITIAL clause, or (2) the calling program. This technique is. CALL statement nesting. For example, Figure 1. CALL statements from three. Image execution begins in MAINPROG with message. It ends in MAINPROG with message number 1. The image's. message sequence is shown following the program listings. MAINPROG has control first. MAINPROG transfers control to SUB1 . MAINPROG has control last. MAINPROG terminates the entire image upon . SUB1 transfers control to SUB2. SUB1 regains control . SUB2 returns control to SUB1 . MAINPROG has control first. MAINPROG transfers control to SUB1. CALL. SUB1 transfers control to SUB2. SUB2 returns control to SUB1. EXIT PROGRAM statement. SUB1 regains control. MAINPROG has control last. MAINPROG terminates the entire image upon. STOP RUN statement. For example. IF A = B DISPLAY . In Example 1. 2- 6 with 3 files (C1. COB, C2. COB, and C3. COB). there is no link- time reference to C3, but the C3 module must be. C3. reference can be dynamically resolved at run- time. The calling program. To access a calling program's Data Division, use a CALL statement in. Procedure Division USING phrase in the called. The USING phrases of both the CALL statement and the Procedure. Division header must contain an equal number of data names. For example, the. Data Name in MAINPROG (Calling Program) Corresponding Data Name in SUB (Called Subprogram). The CALL statement can make data available to the called program by the. REFERENCE- -- The address of (pointer to) the argument (arg) is. This is the default mechanism. Refer to the. Compaq COBOL Reference Manual, the CALL statement.). OMITTED- -- A value equivalent to BY VALUE 0 is passed to the called. BY VALUE. OMITTED, and BY DESCRIPTOR are Compaq extensions and will not work as. COBOL program. These argument- passing. Run- Time Library Routines and. Chapter 1. 3. This mechanism ensures that the. The called program references a separate storage. This mechanism ensures that the called program. USING phrase. However, the called program can change the value of the. Procedure Division header. For example. CALL . This allows the subprogram to return a. GIVING phrase. For example. CALL . However, the GIVING phrase uses the return value by. Use of this mechanism requires that the. GIVING result (ITEMC) be an elementary integer numeric data item with. COMP, COMP- 1, or COMP- 2 usage and no scaling positions. The correspondence is by position, not by. Compatibility with the Mainframe Environment. This chapter describes facilities provided by Mainframe Express. Mainframe pointers for COBOL programs. Entry point mapping for COBOL and Assembler programs To provide compatibility with mainframe- style pointers in COBOL. Mainframe Express: You need the AMODE directive for any program module which: Creates mainframe- style pointer items (using SET. TO ADDRESS OF data- item syntax). Uses mainframe- style pointer items (using SET ADDRESS OF. TO pointer- item syntax). Contains a Working- Storage item passed to a subprogram that creates a. Working- Storage item. Mainframe Express also provides and sets the DATA compiler. Data Division of a program. AMODE compiler directive. Mainframe Express sets the directives as follows: COBOL Dialect. Directive. COBOL 3. AMODE(3. 1) DATA(3. VS COBOL II (all releases)AMODE(3. DATA(3. 1)OS/VS COBOLAMODE(2. Note: You cannot see the directives in the Build. Build Settings dialog box as they are set. For more details of the. AMODE and DATA directives, see the topics for these directives in the. Help Topics on the Mainframe Express Help menu. Contents tab click Reference, Development. Environment, Compiler Directives. On the mainframe, a COBOL program can continue to use the data defined. Data Division of a subprogram even after that subprogram has been. This facility has been emulated in Mainframe Express though we. You can enable this facility by checking Enable access to canceled. Data Divisions on the General page of the Execution. Project Settings dialog box. Before the subprogram is canceled, you should set pointer variables in. Then, after the subprogram is canceled, you. Mainframe Express releases the. Working- Storage of the canceled subprogram. This can occur if: There is insufficient storage available to satisfy a new storage. The canceled subprogram is reloaded. In this case, the old. Working- Storage area is released and a new area allocated and. When a call to an entry. If it does not find the entry point- name, it looks on disk for. If it does not find one it returns an. Consequently, if your program calls an entry point that is not the name. 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. PC for further development. Mainframe programs. On the mainframe. Using Mainframe Express, if the program containing. To get round this problem, you need to create an entry- name map file. There are two methods of creating an entry- name map file: The Entry Point Mapping facility provided in the IDE. We recommend. this method if the programs in your application are in COBOL. Create the file using a text editor. This is the only method. Assembler. If you have an application with a mixture of COBOL and Assembler. COBOL programs using. Entry Point Mapping facility and add the table entries for the. Assembler programs using the text editor. The entry point map file is called mfentmap. For example, if your project. The Entry Point Mapping facility automatically creates the file in the. To create an entry name map using Entry Point Mapping, click Alternate. Entry Points on the Build menu. You see the Entry Point. Mapping dialog box. Use this dialog box to specify the programs for which. If you create your map file with an editor you must manually enter all. For each entry point you need to enter the following. A calls entry point B which is in program C. The table entry in. If Mainframe Express. For Assembler programs you can use the ALIAS. For example, to create an alias. Assembler (. lin) file command line is: ALIAS pacct. For COBOL programs you must use the manual method. To do this you. can use the Entry Point Mapper to emulate the alias function of an IBM. To enter aliases manually, you must edit the. You cannot enter aliases. Entry Point Mapping dialog box. At run time, Mainframe Express first looks for a program with the. If it finds one, it does not invoke the Entry Point Mapper. Enter the alias on the . Within the run. unit, progroot issues a call using the name pacct. The actual name of. The table entry in the mfentmap. All rights reserved. This document and the proprietary marks and names.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2016
Categories |