The NoteBook of EricKong

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

          When the user types Input text Data on the CICS GUI Input Screen – say he presses Option 1 on the MAIN MENU Screen, and hits ENTER, the COBOL Program starts from the top at the PROCEDURE DIVISION, processes the data, and sends the next CICS Output Screen say BOOK MENU Screen, and gets killed(terminated). This is called one Invocation of the COBOL Online Program.

          The User stares at the BOOK MENU screen, decides what Input to type, and then after filling in the passenger details on the BOOK MENU Input Screen, hits ENTER. The COBOL Online Program restarts all over again from the PROCEDURE DIVISION, processes the Passenger Details and reserves a ticket, and sends the next CICS Output Screen say CONFIRMATION TICKET Screen, and gets killed. This is the second invocation of the COBOL Online Program.

          Every time, the COBOL Program starts from the PROCEDURE DIVISION, receives data from the Input Screen, processes the data, and sends the next output screen, and finally stops running. The Start-Receive Input-Process-Send Output-Stop cycle keeps repeating till you are done with your task. Each time you type data and hit ENTER, you invoke or run the COBOL Program to process your inputs.

          Sometimes, you need to save(remember) data between two successive runs, or invocations of the COBOL Online Program. Such data cannot be stored in Working Storage Areas of the COBOL Program. Working Storage Areas are created when the COBOL Program starts, and deleted when the COBOL Program stops. Working Storage Areas are rough-work areas(scratch-pad) of the COBOL Program, that live only as long as the COBOL Program runs.

          The requirement however, is to store(save) data across multiple invocations(runs) of the COBOL Online Program. When you want to store(save) data which is globally accessible across several runs a COBOL Program, you use Linkage Section Storage Areas
          .
          Given below is a simple picture that depicts how Linkage Section Storage areas differ from Working section storage areas. You’ve got a simple Storage Area A containing the value 0. You write a COBOL Program to ADD +1 TO A.

          Case 1: If A were to be a Storage Area in the WORKING-STORAGE SECTION.

          Image196[1]

          Each time the COBOL Program starts WS-A Storage Area is created with value 0, and the COBOL Program adds +1 to WS-A, so WS-A becomes 1. After the COBOL Program stops, WS-A is deleted. So, this doesn’t offer you memory of the past feature, with working storage areas you don’t remember, what was stored in WS-A previously, the last time the COBOL Program ran.

          Case 2: If A were to be a Storage Area in the LINKAGE SECTION.

          Image197[1]

          Here WS-A Storage which  is globally accessible and shared across the 1st run, 2nd run and the 3rd run of the COBOL. WS-A is a Linkage section Area, so this Storage area is independent of the COBOL Program. It helps to remember data of the past, pass data from one invocation(run) to the next successive invocation(run).

          DFHCOMMAREA is a Linkage Section Storage Area that helps to store(save) data, pass data around from one invocation(run) to another invocation of a COBOL Online Program in CICS. Thus, Linkage-section storage area DFHCOMMAREA plays an important role to remember and retain data between two successive invocations.

          posted on 2011-12-21 12:25 Eric_jiang 閱讀(364) 評論(0)  編輯  收藏 所屬分類: Mainframe
          主站蜘蛛池模板: 和林格尔县| 利津县| 清涧县| 界首市| 翁牛特旗| 毕节市| 肇源县| 玉山县| 辽阳市| 高邮市| 普陀区| 山东省| 明光市| 武陟县| 达日县| 石景山区| 海原县| 惠水县| 合川市| 宁乡县| 长兴县| 定边县| 新野县| 屯留县| 万荣县| 安化县| 南陵县| 临夏县| 清新县| 翁牛特旗| 同德县| 古田县| 深圳市| 汾阳市| 邵阳市| 鄂托克前旗| 嘉义县| 南平市| 珠海市| 增城市| 丰顺县|