Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1745630
  • 博文数量: 335
  • 博客积分: 4690
  • 博客等级: 上校
  • 技术积分: 4341
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-08 21:38
个人简介

无聊之人--除了技术,还是技术,你懂得

文章分类

全部博文(335)

文章存档

2016年(29)

2015年(18)

2014年(7)

2013年(86)

2012年(90)

2011年(105)

分类: 系统运维

2013-06-08 23:03:00

The Customer Information Control System, or CICS, is designed to control information in a modern
online environment by providing database and data communication functions.
tran --------task 
Each transaction is identified by a unique, four?character identifier called a transaction identifier, or
trans?id. To start a transaction, the user enters its transaction identifier at a terminal.

Transactions are defined in a CICS table called the Program Control Table (PCT). Each trans?id in
the PCT identifies the program CICS should execute when the transaction is invoked.

Programs are defined in the Processing Program Table (PPT). This table keeps track of which
programs are already loaded into storage. If a program has not been loaded into storage, it's loaded
when its associated transaction is invoked.
services :
CICS provides many services that are available to an application program through its Application
Programming Interface, or API. This API insures that all the services are invoked in a consistent
manner.

The data communication services allow users to communicate with programs through their terminals. ? 
The data management services let programs access data stored in files or databases. ? 
The CICS management services provide a variety of services for managing the execution of
application programs.

BMS的引入:
Terminal control is CICS's interface with the operating system's telecommunication access method. Terminal
control lets you send text to or receive text from the terminal that initiated the task. Although terminal control
handles most of the details of working with the access method, it is still difficult for your application program
to use it directly. For instance, an application program that uses terminal control directly must process
complicated strings of control characters and data sent to and received from the terminal.
To relieve you of the task of building and decoding complicated strings of control characters and data, basic
mapping support, or BMS, was developed. As this figure shows, BMS is an interface between application
programs and terminal control. BMS lets you create a map that specifies the format of data as it appears on the
terminal display. To receive data from or send data to a terminal, an application program issues a BMS
request. After BMS retrieves the specified map, it creates a terminal control request that will process the data
according to the format specified by the map.
A special CICS table called the Terminal Control Table, or TCT, is used to define each terminal to the CICS
system. In the TCT, each terminal is given a unique one to four?character terminal identifier, or term?id.
These definitions make it possible for CICS to direct program output to the correct terminal and any input

erminal control provides the interface between CICS and the operating system's telecommunication
access method. It lets you send text or receive text from the terminal that initiated the task.

The most common telecommunication access methods are VTAM (the Virtual Telecommunication
Access Method), SNA (Systems Network Architecture), and TCP/IP (Transmission Control
Protocol/Internet Protocol). Some of these access methods can also be used in combination with each
other.

Basic mapping support (BMS) provides the interface between application programs and terminal
control. It lets you create maps that specify the position and the characteristics of the individual
display elements on the terminal screen. As a result, you can create interfaces that are easy for users to
work with.

Each terminal in the CICS system must be defined in the Terminal Control Table (TCT). Each
terminal in this table is assigned a unique one? to four?character terminal identifier, or term?id.

/************************************************************/
How pseudo?conversational programming works
Like a conversational program, it starts
by sending its initial map to the terminal. Unlike a conversational program, though, a pseudo?conversational
program ends after it sends the map. Then, when the user presses one of the terminal's attention identifier
(AID) keysthe Enter key, a PF key, a PA key, or the Clear keyit signals CICS to restart the program. At that
point, the task is loaded back into storage, the data is retrieved from the terminal and processed, output is sent
back to the terminal, and the program ends again. This continues until the user indicates that the program
should end.
/***********************************************************/
bms ----> assemble--- >  physical map
                            ---->symbolic map 
A symbolic map is a COBOL copy member that's created when you assemble a mapset. The fields in
a symbolic map represent the data that's sent to and received from a terminal by a COBOL program.

A symbolic map includes two 01?level items: one for input and one for output. Because the second
item contains a Redefines clause (see the next page), it occupies the same storage space as the first
item. That way, different Picture clauses can be used for input to a field and output from it.

For each input field in the mapset (I), the symbolic map contains a field that indicates the length of the
data in the field (L), a field that indicates if the user made changes to the field (F), and a field that
contains the display attributes (A)
/*********************************************************************/
EIB
he EIB is inserted into the Linkage Section of a program, and its fields provide information about the current task.
The two EIB fields you'll use most often are EIBAID and EIBCALEN.
The EIBCALEN field contains the
length of the data that is passed to the program through its communication area. A program can use this area
to store the data that it will need the next time it's executed. That's necessary because the contents of the
working?storage fields are lost when a pseudo?conversational program ends. If the length of this area is zero,
it means that no data was passed to the program. In other words, the program is being executed for the first
time in a pseudo?conversational session
In contrast, the EIBAID field gives the value of the last AID key that was pressed. You can use it to determine
the processing the user has requested.
communication area= 

communication area. As you'll recall, this area can be used to store the
data that's passed to and from the program. To use the communication area, you need to provide two
definitions for it in your program: one in the Working?Storage Section and one in the Linkage Section. The
working?storage definition in this program is named COMMUNICATION?AREA, and the Linkage Section
definition is named DFHCOMMAREA. Although you can use any name for the working?storage field, you
must use the name DFHCOMMAREA for the Linkage Section field.
When a CICS program starts, the data in the CICS communication area is available through the
DFHCOMMAREA field. The program can then use this information to determine the processing to be done
Then, when the program ends, it can specify that the data in the working?storage communication area be
stored in the CICS communication area so it's available for the next program execution.
/**************************************************/
source compile:

cics  程序流程控制:



说明:
When a program is invoked by entering a trans?id from CICS like Program A above, the invoked
program executes at the logical level below CICS. Then, when the program ends by issuing a
RETURN command, control returns to CICS.

When a program is invoked by executing a LINK command from another program like Program B
above, the invoked program executes at the logical level below the program that invoked it. Then,
when the invoked program ends by issuing a RETURN command, control returns to the program that
invoked it.

When a program is invoked by executing a XCTL command from another program like Program C
above, the invoked program executes at the same logical level as the program that invoked it. Then,
when the invoked program ends by issuing a RETURN command, control returns to the program at
the next higher level, not to the program that invoked it.
关于RETURN:
You can use this command to return control to
CICS and set up the next execution of the program in a pseudo?conversational session. When you use it for
that purpose, you include the TRANSID option to specify the trans?id of the program. You also include the
COMMAREA option to name the area of working storage that will be stored in the CICS communication area
between program executions. In fact, this is the only case in which you can specify the TRANSID and
COMMAREA options. If you use them in any other situation, an error will occur and the program will
terminate abnormally

WORK-STORAGE/LINK-STORAGE ---TEMPORAL STOAGE:

It's important to realize that the working?storage and Linkage Section fields define two distinct areas of
storage. The working?storage area represents storage that's freshly allocated each time your program starts. In
contrast, the Linkage Section area (DFHCOMMAREA) represents storage that's saved from the previous
execution of the program. (That's true for each execution except the first, in which case the Linkage Section
area receives null values.) Each time your program ends, the storage held by DFHCOMMAREA is released,
and the contents of the working?storage area are saved in the temporary communication area. Then, the next
time the program is executed, the contents of the temporary communication area are made available through
DFHCOMMAREA. To access the data in DFHCOMMAREA, you typically move it to the newly allocated
storage defined in the Working?Storage Section.

LINK  USAGE
As you can  see, the syntax of the LINK command is similar to the syntax of the XCTL command. When you
use the LINK command, though, the program you specify on the PROGRAM option is executed at the next
lower logical level. In addition, if you pass data to the linked program using the COMMAREA option, the
linked program receives a pointer to that data rather than a copy of the data itself. In other words, both
programs refer to the same area of storage for the data. That means that any changes you make to the data
through the DFHCOMMAREA field in the invoked program will be reflected in the working?storage
definition of the data in the invoking program. If you want to work with the data in the linked program
without affecting the data in the invoking program, though, you can move that data from DFHCOMMAREA
to a working?storage area. Later, you can move the working?storage area back to DFHCOMMAREA if you
want the changes reflected in the invoking program.
ref:

Murach-CICS-for-COBOL-programmer.pdf
阅读(2131) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~