FALSE

Page Nav

HIDE

Grid

GRID_STYLE

CICS FAQ's part3

STORAGE CONTROL IN CICS   1.     How is dynamic memory allocated within a CICS program? Dynamic memory is allocated in CICS using the GETMAI...

STORAGE CONTROL IN CICS

Dynamic memory is allocated in CICS using the GETMAIN command.

Yes dynamic calls can be used in CICS.

The free main command is used to release the storage, which has been acquired .If the acquired storage area is not freed, it will be freed when the task terminates.

EXEC CICS FREEMAIN
DATA (WS-AREA)
END-EXEC

The CWA, CSA, TWA, TCTUA are accessed by using the BLL-Cells defined in Linkage area and the ADDRESS command. Ex. EXEC CICS ADDRESS CWA(BLL-CWA) END-EXEC. SERVICE RELOAD BLL-CWA. Under COBOL II BLL Cells needn't be used. Ex. Exec CICS ADDRESS CWA (Address of Comm-area) End-exec.


CSA - Common System Area. There is exactly one CSA in memory at any given time, It records which task it is executing and generally, the state of the system as a whole.
CWA - Common Work Area, is an extension of CSA, individual installations define it's own way to use CSA, normally it contains security tables and other global data.
TCTUA - Terminal Control Table User Area is created for each terminal. This installation defined control block contains the user's security level as user-id, and other info to keep running one task to the next.
TCA - Task control Area. For every task running in the system, there is one TCA with information, such as running a Program and whether or not a terminal is connected to the program, i.e. about the execution environment.
TWA - Task work area is an extension to TCA, used by program to record data associated with the task. TWA is used by System utilities for inter-program communication with-in a task.
The Control blocks which are to be accessed are to be defined in the Linkage section of the COBOL program. To access the control blocks, their addresses are to be established, which involves two steps: Find out where the block of storage is located in memory (as CICS knows but not your program) and associate it with control block item defined in the linkage section. The CICS command to initiate the loading of the address of control block is ADDRESS. Ex. EXEC CICS ADDRESS TCTUA(Terminal-BLL-Pointer) END-EXEC. The Terminal-BLL-pointer needs to be defined as S9(8) COMP field, after DFHEIBLK,& DFHCOMMAREA and just before the Block Item definition in the Linkage section. The order of Address-list should match the order of Block definitions.

Use GETMAIN command. Define a BLL-pointer and define a data block in Linkage section (as for control block). However if the Address space needed for dynamic allocation is more than 4 KB, a second Address locator (BLL) is to be defined, and is assigned the value based on the first address received by using the GETMAIN command. EXEC CICS GETMAIN SET(ADDRESS OF ls-area) LENGTH(nnn) INITIMG(HEX-00) END-EXEC. Where ls-area is product recordname, and HEX-00 is 1-byte init value.

FREEMAIN command with the name of the block.

Whenever a entry is changed in the address list, you need to inform the program by using the SERVICE RELOAD statement, so that it can update its internal registry pointers, if not informed unpredictable results arise. The Service Reload statement immediately follows the statement that changes an address list item. Many programmers code the first line as the SERVICE RELOAD ADDRESS-LIST end-exec.

There is no longer a need to define the Address list before the Control Block definitions in Linkage section, The addressing is entirely handled by CICS. The Length command need not be defined, as CICS checks the data item defined for it. The SERVICE RELOAD statement is no longer required as each time the address variables change the internal register automatically get updated.

CEMT is used by operator to control CICS by Open or Close files, Control tuning parameters, Diagnose terminal problems (is it available for use), disable or enable transactions, Shut the CICS down.

PROGRAM CONTROL IN CICS

XCTL –to transfer control and data to another CICS program, which is in the same logical level. A return from the called program to the calling program is not expected. It is a program control command.

LINK –to transfer control and data to another CICS program, which is in a lower logical level. A return from the called to the calling program is expected.

START – This is a command to start a transaction in the CICS region. It is a interval control command.
The CICS Terminal control is at the highest level and is considered to be running at logical level 0. The first Task initiated by entering a Trans-id is considered to be logical level 1, as this is first program stored in the main storage.

If a ProgramA from level one calls another ProgramB using a LINK command, the ProgramB is said to be in logical level 2 as both ProgramA and ProgramB are stored in main storage.
However if ProgramC is called by using the XCTL command from ProgramA, then ProgramC is said to be logical level 1, as the ProgramA is removed from the main storage after loading ProgramC. The options used with LINK and XCTL commands are PROGRAM, COMMAREA and LENGTH. RETURN command is used to pass control from one logical level to the one above it.

A RETURN command at level 1 can have the options TRANSID, COMMAREA, and LENGTH, to initiate a new transaction, once the control is passed to the CICS. The RETURN command at all the other logical levels should be issued with no options.

There are three ways.1) use COBOL call statement to invoke a subprogram. This is transparent to CICS which sees only one load module.2) an EXEC LINK is similar to a call, it invokes a separate CICS program and ends with a return to the invoking program.3) an EXEC XCTL which transfers control to another CICS program an does not get the control back.

Yes, the called routine must be defined in PPT and the calling program must use CALL identifier...

No. No. Yes.

Commarea is the communication area that is used to transfer information between application programs that are in the same logical level or in different logical levels.

Yes, if B tries to access bytes 31-50.

The format of the return command is as follows

EXEC CICS RETURN

TRANSID (---)
      COMMAREA (---)
      LENGTH (---)
      END-EXEC

  If the TRANSID option is used, the specified transaction identifier will be the transaction identifier for the next program to be associated with the terminal. This is allowed only in the program at the highest logical level. If the transid option is specified, the COMMAREA and the LENGTH option can be used to pass data to the next task in the same manner.

The LOAD command retrieves an object program from disk and loads it into main memory. It is primarily used for a constant table that will be available system wide. It's used to handle large static tables. It could use a number of pointers for each 4096K size of data. It's a storage control command such as GETMAIN.

Junk will be moved. Will encounter storage violation

Zero
Evaluate EIBCALEN variable to determine the first execution of a program in a pseudo-conversational session. If it's value is zero then it's the 1st execution of the program. The communication area is a special field, which must be at least of one byte long and is used to pass data from one program execution to the next. The next field defined after the communication area in the working-storage section is the Response field, a full-word binary item (S9(8) comp). This field is used to test the completion status of CICS (READ) command with the option RESP(Response field).

No a new task is not created. Yes it causes an implicit syncpoint.

No comments