Professional Documents
Culture Documents
Version 2.0
10th Oct. 2000
System Components.....................................................................................................................1!
Characteristics Of CICS................................................................................................................32
CICS Transactions......................................................................................................................131
/ppendi:1/................................................................................................................................133
,+. /ssi%nment 1........................................................................................................................................................133 ,8. /ssi%nment 2........................................................................................................................................................13! ,,. /ssi%nment 3........................................................................................................................................................13# 1 . /ssi%nment !........................................................................................................................................................13# 1 1. /ssi%nment #........................................................................................................................................................136 1 2. /ssi%nment 6........................................................................................................................................................13+
/ppendi:1B................................................................................................................................138
1 3. Sample COBO41CICS $ro%ram...........................................................................................................................138
/ppendi:1C................................................................................................................................1!2
1 !. Bi-lio%raphy.........................................................................................................................................................1!2
/ppendi:1.................................................................................................................................1!3
1 #. Ta-le Of "i%ures...................................................................................................................................................1!3
Intro&uction To CICS
'atch an& Online systems
Characteristics of batch an& online systems
There are t6o types of computer application systems. One is the -atch application system and the other is the online application system. The -atch system has a system en3ironment 6here Do-s run one -y one in a con3entional 6ayE 6hereas the online system has the system en3ironment 6here many transactions run concurrently. Batch System Off1line Se=uential in -atch /t specific inter3al ;ot shara-le ;ot critical $rinted reportsE output filesE ?ser must 6ait for -atch Do-s to produce reports Simple Simple ;ot al6ays current In -atch Online System On1line 2andomE concurrent Instantaneous Shara-le Critical To terminalE ?pdated filesE system lo%E Instant feed-ac) Comple: Comple: /l6ays current Immediate
.ata Collection Input Fo- Schedule 2esources 2esponse Time Output Security 2eco3ery Information ?pdation
Interacti)e +ro*rams
"our types of pro%rams are common to all interacti3e systems. They areC 1. .ata1entry pro%rams 2. In=uiry pro%rams 3. "ile1maintenance pro%rams !. &enu pro%rams Data,entry +ro*rams The most critical pro%rams in most interacti3e systems are data1entry pro%rams. These pro%rams accept input data from operator and use it to update the files after 3alidatin% the data entered. / typical data1entry pro%ram re=uires three stepsC 1. The operator enters data for one transaction 2. The pro%ram updates any related master files 3. The pro%ram 6rites the transaction to a transaction file In-uiry +ro*rams /n in=uiry pro%ram is desi%ned to pro3ide a response to a userBs in=uiry. / in=uiry pro%ram re=uires three stepsC 1. The operator enters the )ey of the record to -e displayed 2. The pro%ram retrie3es the appropriate record from the master file 3. The pro%ram displays the record at the terminal .ile,maintenance +ro*rams / file1maintenance pro%ram can update a file -y addin%E chan%in%E or deletin% records. / file1maintenance pro%ram re=uires fi3e stepsC 1. The operator enters the record )ey 2. The pro%ram reads the appropriate record +
1rior to CICS
?ntil the late 1,6 sE all online systems 6ere de3eloped on a custom1made -asis for each application for each installation. Ho6e3erE de3elopin% an online system is a comple: proDect in3ol3in% the operatin% system 'OS(E telecommunication access methodsE data access methodsE and applications pro%rams.
"unctionallyE all of these CICS products are compati-le 6ith each otherE 6ith certain e:ceptions caused -y the differences amon% the correspondin% operatin% systems.
CICS4/VS
CICS7&>S 3ersion 2 2elease 1 is the current 3ersion of the mainstream CICS productE replacin% its older 3ersionE CICS7Os7>S >ersion 1 2elease +. It runs under the &>S7@/ operatin% system and pro3ides comprehensi3e ser3ices as a %eneral purpose .B7.C control system in the 3irtual en3ironment.
Data,Communication .unctions The Component of data1communication functions pro3ides an interface -et6een CICS and terminals or other systems. The follo6in% CICS ser3ices are offeredC To interface to telecommunication access methodsE such as >T/&E TC/&E BT/&. To free application pro%rams from terminal hard6are throu%h &asic &appin% Support 'B&S(E 6hich pro3idesC .e3ice independence "ormat independence To pro3ide &ulti12e%ion Operation '&2O(E throu%h 6hich more than one CICS re%ion in a system can communicate. To pro3ide Intersystem communication 'ISC(E throu%h 6hich a CICS re%ion of a system can communicate 6ith other CICS re%ions in other systems or other non1 CICS systems.
Data,0an&lin* .unctions The component of data1handlin% functions pro3ides an interface -et6een CICS and data. The follo6in% CICS ser3ices are offeredC To interface 6ith data access methodsE such as >S/& and B./&. To interface 6ith data-ase access methodsE such as .B2E S047.SE and .47I. To maintain data inte%rity -yC Control of simultaneous record updates $rotection of data as tas) /B8;.s $rotection of data at system 'CICS or OS( failures
(++lication 1ro*ram Ser)ices The component of application pro%ram ser3ices pro3ides an interface -et6een CICS and application pro%rams. The follo6in% CICS ser3ices are offeredC To interface 6ith COBO4E $47IE /ssem-ler pro%rams Command le3el translator 8:ecution dia%nostic facility '8."( Command interpretater 'C8CI( Screen definition facility 'S."( Trace and dump facilities
System Ser)ices The component of system ser3ices pro3ides an interface -et6een CICS and the operatin% system. The follo6in% CICS ser3ices are offeredC $ro%ram controlE such as load and release of application pro%rams 11
/onitorin* .unctions The component of monitorin% functions monitors 3arious e3ents 6ithin CICS and pro3ides a series of statistics to -e used for system tunin%. Other Systems
Operatin% System '&>S7@/(
Terminals
.ata1handlin% "unctions
&onitorin% "unctions
.ata1Comm. "unctions
12
.eatures Of CICS
1.D'4DC
CICS ma)es data communication much easier -y supplyin% all the -asic components needed to handle data communication. This allo6s system desi%ner and pro%rammers to concentrate on de3elopin% application pro%rams 6ithout ha3in% to concern 6ith the details of data transmissionE -uffer handlin% or the properties of indi3idual terminal de3ices.
2. /ulti+ro*rammin*
/s far as the operatin% system is concernedE CICS is an application pro%ram that is it runs as a Do- in one of the systemBs partition or re%ionE 6hich is a 3irtual address space. Therefore CICS ta)es part in multipro%rammin% en3ironment of the operatin% system. CICS is a lon%er runnin% Do- therefore it remains up durin% the day time collectin% on1 line transactions and at ni%ht -atch Do-s are e:ecuted for master file updation etc.
3. /ultitas6in*
&ultitas)in% means that the operatin% system 'OS( allo6s more than one tas) to -e e:ecuted concurrentlyE re%ardless of 6hether the tas)s use the same pro%ram or different pro%rams. ThereforeE this is not a uni=ue concept of CICS. ButE CICS mana%es multitas)in% of CICS tas) 6ithin its o6n re%ion. That is CICS pro3ides a multitas)in% en3ironment 6here more than one CICS tas) run concurrently.
. Sche&ulin*
Ahen user re=uests a transactionE normally -y lo%%in% on and )eyin% in a transaction codeE CICS chec)s the status of the user and the terminal. This ensures the 3alidity of userE terminal and transaction1id. Then tas) control creates a tas) for the transaction. CICS tries to %i3e the -est response times to the most important or ur%ent 6or). ?suallyE se3eral tas)s are competin% for resourcesE so a transactionE an operatorE and a terminal are each assi%ned a priority related to the importance of the function they carry out. CICS sums these priorities to %i3e the o3erall priority of the tas) and uses this priority to decide the order in 6hich to process competin% tas)s. Since transactions are not normally
13
Chapter 2
System Com+onents
The CICS7&>S system consists of &ana%ement &odules Ta-les Control Bloc)s
&ana%ement modules are the CICS7&>S pro%rams that interface -et6een the operatin% system and the application pro%rams. 8ach mana%ement module performs a particular function. "or e:ampleE 6hen an application pro%ram issues a re=uest to read recordE the "ile Control $ro%ram mana%ement module processes the re=uest. Input7output re=uests are made to CICS7&>SE instead of the operatin% system as they are in -atch processin% en3ironment. CICS ta)es o3er the difficult part of I7O operationsE lea3in% only the e:ecution lo%ic to the application pro%ram. Ta-les define the CICS7&>S systemBs en3ironment. The ta-les are functionally associated 6ith the mana%ement modules. "or e:ample all file definitions are in the "ile Control Ta-le. So definition may -e shared -y all application pro%rams and tas)s. "or this reasonE the files are not defined in the application pro%ram as they are in a -atch pro%ram. The Terminal Control Ta-le defines each terminal in the net6or)J thus the application pro%ram need not -e concerned 6ith the physical attri-utes of 3arious terminals in the system. ;ot all mana%ement modules ha3e associated ta-les. Control Bloc)s contain system type information. Ahen a transaction is initiated a control -loc) called a Tas) Control /rea contain information pertinent to the tas). "or e:ample Tas) Control area contain pointers to the application pro%ram and to the terminalBs entry in the Terminal Control Ta-le.
1!
CICS
Terminal Control
1#
Customer Information Control System (CICS) Tas6 Control 1ro*ram /ana*ement /o&ule (7C1)
Tas) control )eeps control of the status of all CICS tas)s. &any of them 6ill -e processed concurrently and tas) control allocates processor time amon% them. This is called multitas)in%. Ahen an operator re=uests a transactionE normally -y lo%%in% on and )eyin% in a transaction codeE CICS chec)s the status of the operator and the terminal. This ensures that the operator in )no6n to the system and that the transaction is 3alid for that user and the terminal. Tas) Control then creates a tas) for that transaction. Transaction re=uest can -e made either -y enterin% transaction1id at the terminal or -y another CICS transaction. / transaction is processed up to an instruction in3ol3in% input from a file or a terminalE for instance. Then 6hile the transaction 6aits for its inputE another 6aitin% tas)s -e%ins or resumes e:ecution.
16
Tables
The ta-les define the resources that CICS controls. "or e:ampleE Terminal Control ta-le 'TCT( defines the terminals in the net6or). "ile Control Ta-le descri-es the data files the CICS application pro%rams access. Ta-les also define the operatin% en3ironment. "or e:ampleE limits may -e defined for the num-er of transactions CICS handles concurrently in System InitialiGation Ta-le 'SIT(. The ta-les are -rou%ht into stora%e 6hen CICS is initialiGed. Ahene3er an application pro%ram re=uires access to a resourceE CICS chec)s the appropriate ta-le to %et the information necessary to process the re=uest. There are si:teen ta-les used to descri-e the CIC8 en3ironment. $CTE $$TE SITE TCT are re=uired. Others are optional.
1+
Control 'loc6s
In e:ecutionE CICS is dynamic. To )eep trac) of 6hat is %oin% on in the system CICS uses se3eral different control -loc)s. &ost of these control -loc)s are dynamically mana%ed. They are created 6hen needed and disposed of 6hen no lon%er needed. $rimarily CICS mana%ement modules access the Control -loc)s. They pro3ide 3arious )inds of information. "or e:ampleE a control -loc) called Tas) Control /rea 'TC/(
18
.e3ice Independence /pplication pro%rams can -e de3eloped 6ithout any concern for physical characteristics of the terminals B&S prepares the messa%e -ased on the terminal type -ein% used
'/S /a+s
/ Screen defined throu%h B&S is called a HmapI. There are t6o types of mapsC a physical mapE 6hich is primarily used -y CICSE and a sym-olic mapE 6hich is primarily used -y the application pro%rams. B&S map is nothin% -ut a pro%ram 6ritten in the /ssem-ler 4an%ua%e. Ho6e3erE you do not ha3e to pro%ram the B&S map as suchE -ecause a set of assem-ler macros 'B&S macros( are pro3ided -y CICS for the B&S map codin%. Based on ho6 a map or a %roup of maps is lin)editedE there are t6o units of the mapC mapE 6hich represents a B&S codin% for a screen panelE and mapsetE 6hich represents a load module.
/ssem-ly 4O/.4IB
Symbolic /a+
The primary o-Decti3e of the B&S sym-olic map is to ensure the de3ice and format independence to the application pro%rams. ThereforeE throu%h the sym-olic mapE a layout chan%e in the formatted screen can -e done independent of the application pro%ram codin% as lon% as the field name and len%th remain same. It is used -y the application pro%ram 6hich issues a COBO4 CO$9 statement in order to include a sym-olic map in the pro%ram.
/a+set
/ %roup of mapsE 6hich are lin)1edited to%ether is called mapset. 8ach mapset must -e re%istered in $$TE since CICS considers the B&S mapset as a pro%ram coded in /ssem-ler. The mapset name consists of t6o parts as follo6sC <eneric ;ameC 1 to + characters Suffi: C 1 character /pplication pro%ram uses only the %eneric name. The suffi: is re=uired at the mapset definition time in order to distin%uish the de3ice types if the same mapset is used for different types of terminals. Ahile the application pro%ram uses only the %eneric name of the mapset nameE CICS automatically inserts the suffi: dependin% on the terminal in useE there-y ensurin% the de3ice independence to the application pro%ram.
21
Com+onents Of ( Screen
CICS identifies screen into three componentsC 1. &apset 2. &aps a. $hysical &ap -. Sym-olic &ap 3. "ields a. ?nnamed '4iterals( -. ;amed '.ata "ields( c. Stopper The first step in desi%nin% screen layout is to di3ide the screen into functional areas such as title areaE application data area and messa%e area. The title area of a screen should identify the pro%ram that displayed data. The application data area comprises the main portion of the screen. Three )inds of field are usually found in this areaC 1. *ey6ord7unnamed7literal K contains constant data sent -y pro%ram to identify the contents of the data field. 2. .ata field7named K contains data that the application pro%ram retrie3es from files and displays. The data may appear e:actly as stored in a fileE or it may -e editedE or it may -e left -lan) for operator to enter data. 3. Stopper field K On data entry screen restricts the len%th of the data field. Stopper field containin% no data is used to stop operator from enterin% too many characters in a field.
Intensity 1
&.T 'it Settin*s ?nprotectedE /lphanumeric ?nprotectedE ;umeric $rotected /utos)ip ;ormal ;ormal
1 1 11 !1# Intensity 1
22
6 +
&ust -e &.T
/ttri-utes -ytes can con3ey the follo6in% field attri-utes. "ield $rotection ?nprotectedC can enter any )ey-oard character into unprotected field. $rotectedC .ata cannot -e entered in a protected field. If the operator attempts to enter dataE the )ey-oard is loc)ed. /utos)ipC /n autos)ip field is a protected field that automatically s)ips the cursor to the ne:t unprotected field. "ield Intensity ;ormalC a normal intensity field displays the data at the normal operatin% intensity. Bri%htC a -ri%ht intensity field displays the data at a -ri%hter than normal intensity. This is often used to hi%hli%ht )ey6ordsE errorsE or operator messa%es. ;odisplayC / nodisplay field does not display the data on the screen for operator 3ie6in%. This mi%ht -e used to enter security data Shift
23
9eneral .ormat
The B&S map definition macros are purely /ssem-ler macros. ThereforeE the follo6in% codin% must -e maintainedC
Col!mn 1 Symbolic name Col!mn 1" Opco e Col!mn 1# Col!mn 1$ Parameter%s& %separate by commas& ' itional parameters (g.).1: Format o* BMS macros Col!mn $2 Cont. Char.
8:ampleC
M(+, -F.MST/P(01S/SP'2M3 4 MO-(0I+O,T3 5'+60COBO53.. (g.).2: (7ample o* BMS macros
Or&er of /acros
2!
2#
Print +ogen 88889 'ssembler Comman 5abel -F.MS- 88889 Mapset -e*inition 5abel -F.M-I 88889 Map -e*inition -F.M-F 88889 Fiel -e*inition 5abel -F.M-F 88889 Fiel -e*inition : : : -F.M-F -F.M-I -F.M-F : : : -F.M-F -F.MS- Type 0 Final 889 Mapset -e*inition (n 88888888888888888889 'ssembler comman
D.0/SD /acro
.unction
The ."H&S. macro is used to define a mapset and its characteristics or to end a mapset definition. Only one mapset definition is allo6ed 6ithin one assem-ly run.
.ormat
5abel -F.MST/P(0-(S(CT : M'P : 1S/SP'2M : FI+'5 ;3 MO-(0I+ : O,T : I+O,T< ;3 5'+60'SM : COBO5 : P5I < ;3 STO2'6(0',TO : B'S(0name< ;3 CT250%;F2((=B< ;3 '5'2M< ;3 F2S(T<&< ;3 .I6.5I6.T0OFF : B5I+= : 2(V(2S( : ,+-(25I+(< ;3 V'5I-+0M,STFI55 : M,ST(+T(2< ;3 T(2M0T/P( : 3 S,FFI40n< ;3 TIO'PF40/(S : +O< ;3 -'T'0FI(5- : B5OC=< (g.).>: Format o* -F.MS- Macro
26
D.0/DI /acro
.unction
The ."H&.I macro is used to define a map and its characteristics in a mapset.
.ormat
5abel -F.M-I ;SI?(0%5I+( 3 CO5,M+&<
;3 5I+(0n!mber : +(4T : S'M(< ;3 CO5,M+0'SM : COBO5 : P5I < ;3 STO2'6(0',TO : B'S(0name< ;3 CT250%;F2((=B< ;3 '5'2M< ;3 F2S(T<&< ;3 .I6.5I6.T0OFF : B5I+= : 2(V(2S( : ,+-(25I+(<
2+
The 4/B84 must -e specified as the sym-olic name to the ."H&.I macro. SIM8'llE cc( is used to define the siGe of the map -y the line siGe 'll( and column siGe 'cc(. 4I;8 and CO4?&; indicates the startin% position of the map in line and column num-ersE respecti3ely. In additionE the ."H&.I macro has the same options used in the ."H&S. macroE such as C;T4 and TIO/$"@. If the ."H&.I macro has the same options specified in the ."H&S. macroE the options specified in the ."H&.I macro o3erride the ones specified in the ."H&S. macro.
D.0/D. /acro
.unction
The ."H&." macro is used to define a field in map and its characteristics. The ."H&." macro can -e issued as many times as you 6ish 6ithin one ."H&.I macro.
.ormat
5abel -F.M-F POS0%line : col!mn& ;3 5(+6T.0n!mber< ;3 A,STIF/0%;5(FT : 2I6.T<& ;3 'TT2B0%'S=IP : P2OT : ,P2OT ;3 +,M<< ;3 B2T : +O2M : -2=< ;3 IC<;3 FS(T<& < ;3 .I5I6.T0OFF : B5I+= : 2(V(2S( : ,+-(25I+(< ;3 V'5I-+0%;M,STFI55 : M,ST(+T(2<& ;3 OCC,2S0n!mber< ;3 I+ITI'50BCal!eB< ;3 PICI+0BCal!eB< ;3 PICO,T0BCal!eB< (g.).#: Format o* -F.M-F Macro
If the field name is re=uiredE the name of the field '1 to + chars( must -e specified as the sym-olic name to the ."H&." macro. $OSL'lineE column( indicates the startin% position of the field in the line and column num-er includin% the attri-ute character. I;ITI/4 defines the initial 3alue of the field 'if any(. 48;<TH indicates the len%th of 28
2,
name"C name/C
"2 -,MM/5 COMP PIC SD%>&. "2 -,MM/F PICT,2( 4. "2 FI55(2 2(-(FI+(S -,MMF. ") -,MMI PICT,2( 4. "2 -,MMI PIC 4%1&. "1 MO2M'P1" 2(-(FI+(S MO2M'P11 "2 FI55(2 PIC 4%12&. "2 FI55(2 PICT,2( 4%)&. "2 'MO,+TO PIC 4%E& "2 FI55(2 PICT,2( 4%)&. "2 /('2SO PIC 4%2& "2 FI55(2 PICT,2( 4%)& "2 2'T(O PIC 4%>&. "2 FI55(2 PICT,2( 4%)&. "2 P'/M(+TO PIC ??3??D.DD. "2 FI55(2 PICT,2( 4%)". "2 M(SS'6(O PIC 4%$D&. "2 FI55(2 PIC 4%)&. "2 (22O2O PIC 4%$$&. "2 FI55(2 PICT,2( 4%)&. "2 -,MM/O PIC 4%"1&
31
Characteristics Of CICS
/ultithrea&in*
&ultithreadin% is the system en3ironment 6here the tas)s are sharin% the same pro%ram under the multitas)in% en3ironment. &ultithreadin% is a su-set of multitas)in%E since it concerns tas)s 6hich use the same pro%ram. ?nder the multithreadin% en3ironmentE a pro%ram is shared -y se3eral tas)s concurrently. "or each tas)E the pro%ram must 6or) as if it 6ere e:ecutin% instructions e:clusi3ely for each tas). ThereforeE it re=uires special considerations such as reentrancy. Contrary to the multithreadin% en3ironmentE under the sin%le threadin% en3ironmentE a pro%ram is used -y only one Do- 'or tas)( at a time. Sin%le threadin% is the e:ecution of a pro%ram from -e%innin% to completion. $rocessin% of one transaction is completed -efore another transaction is started. / typical e:ample is a -atch Do-. /lthou%h multithreadin% is not a uni=ue concept to CICSE CICS mana%es multithreadin% of CICS tas)s 6ithin its o6n re%ion. That isE CICS pro3ides the multithreadin% en3ironment 6here more than one CICS tas)E 6hich uses the same pro%ramE run concurrently.
;uasi,<eentrancy
In order to ma)e multithreadin% possi-leE an application pro%ram must -e HreentrantI. / completely reentrant pro%ram doesnBt chan%e itself in any 6ay i.e. a reentrant pro%ram cannot modify data in 6or)in% stora%e. /s a resultE any user can enter a reentrant pro%ram at any point 6ithout affectin% other users 6ho are also runnin% it. To ma)e thin%s easierE command le3el CICS allo6s you to use 6or)in% stora%e -y treatin% all pro%rams as =uasi1reentrant.
32
>irtual Stora%e $ro%ram / O-Dect code ?ser1 runnin% pro%ram / $ro%ram / Aor)in% Stora%e '?ser1( ?ser2 runnin% pro%ram /
"i%ure a-o3e sho6s ho6 =uasi1reentrant pro%rams 6or) under CICSE HereE t6o users are runnin% the same application pro%ramE $ro%ram /. They share the same stora%e for the pro%ramBs o-Dect code. i.e. the procedure di3isionJ -ut each is %i3en a separate 6or)in% stora%e area. That 6ayE each can use 6or)in% stora%e in the normal fashion. Ahen you 6rite a command le3el CICS pro%ramsE you donBt need to 6orry a-out a =uasi1reentrantE CICS handles that for you automatically.
1seu&o,Con)ersational 1ro*rammin*
/n interacti3e pro%ram that 6aits for data to -e input from the user on the terminal is called a Con3ersational pro%ram. On sin%le user system this is not a pro-lem. But 6ith the multi1user system it is a pro-lem. 8.%. In a 3 users systemE 6hen one pro%ram is acceptin% and processin% dataE the other 2, are 6aitin% ta)in% up space in main stora%e. Hence in multi user en3ironmentE con3ersational pro%rams can -e tremendously inefficient. The solution in $seudo1con3ersational pro%rammin% i.e. to return the control to CICS 6hen the pro%ram is 6aitin% for any i7o. /s a result the pro%ram remains in stora%e only 6hen it is processin% data.
33
Transaction Dri)en
/ transaction is a lo%ical unit of 6or) that a terminal user can in3o)e. CICS is called to -e transaction dri3enE -ecause e3ery transaction or pro%ram can -e in3o)ed 6ith the help of a transaction1id. In shortE transaction1id and the pro%ram to 6hich transaction1id is related are predefined in the $CT ta-le. 8ach trans1id is a uni=ue four character code. $ro%ram1name is the pro%ram1id as defined in COBO4 pro%ram.
Ahen the user enters the trans1id on the terminal and presses the enter '/I.( )eyE CICS locates the trans1id in $CT and refers to $$T. 4oads the pro%ram into stora%e and a
3!
3#
36
CICS Command formatC 8@8C CICS "unction Poption 'ar%ument( option 'ar%ument( 111111111 111111111 Q 8;.18@8C. H"unctionI descri-es the operation re=uired e.%. S8;.728C8I>8 etc. HOptionI descri-es any of the many optional facilities a3aila-le 6ith each function. Options can -e coded in any order -ut prefera-ly one option per line. Options may -e follo6ed -y an ar%ument in parentheses. H/r%umentI is a 3alueE can -e a data1name or literal.
Translator
COBO5 Compiler
ObGect Mo !le
5inH ( it
5oa Mo !le
3+
Separate translators are a3aila-le for /ssem-lyE COBO4 and $471 lan%ua%es 6ith em-edded CICS. The translator is e:ecuted in a separate Do- step. The Do- step se=uence is C Translate 111 Compile 'or assem-le( 111 4in) edit 8ach translator is host lan%ua%e oriented and accepts the source pro%ram as input from S9SI;. The translator 6rites the source listin% and error messa%es to S9S$2I;T. The translated source pro%ram is accepted as input -y the COBO4 compiler and lin) edited to %enerate a load module. The translator modifies the lin)a%e section -y insertin% the 8IB structure as the first parameter and inserts declaration of the temporary 3aria-les that it re=uires into 6or)in% stora%e section. "or COBO4 application pro%ramE each command is replaced -y one or more COBO4 mo3e statements follo6ed -y a COBO4 C/44 statement. &O>8 statement assi%n constants to COBO4 data 3aria-les. The constants are coded as ar%uments to options in the commands. .eclarations for 3aria-les in 6or)in% stora%e section is coded as copy file name ."HI>/2.
38
The e=ui3alent statements 'e:cept 2eport Ariter and Sort( are prepared in the form of CICS commands. The CICS application pro%ram must end 6ith the CICS 28T?2; command and7or <OB/C* statement. The C/44 statement is allo6ed if the called pro%ram does not issue any CICS commands or inhi-ited COBO4 statements mentioned a-o3e and if it is 6ritten as a reentrant pro%ram. The C/44 statement in this case can -e issued as the follo6in% e:ampleC
C'55 s!bprog ,SI+6 777 yyy III
3,
Some of the 8IB fields areC 8IB/I. Contains the attention identifier '/I.( associated 6ith the last input operation. 8IBC/48; Contains the len%th of the communication area passed to the application pro%ram. 8IBC$OS; Contains the cursor address 'position( associated 6ith B&S 8IB./T8 Contains the date the tas) is started. "ormatC
8IBTI&8 Contains the time at 6hich the tas) is started. "ormatC HH&&SS pic s,'+( comp13 8IB.S Contains the sym-olic identifier of the dataset referred to in a file control re=uest 8IB2CO.8 Contains the CICS response code returned after the function re=uested -y the tas) has -een completed
!1
!2
Installation Define&
"1 Fiel 8'ttrib!te8.efinition. # "/C1?;$2OT # "/C1?;$2OT1&.T # "/C1?;$2OT1B2T # "/C1?;$2OT1B2T1&.T # "/C1?;$2OT1./2* # "/C1?;$2OT1./2*1&.T # "/C1?;$2OT1;?& # "/C1?;$2OT1;?&1&.T # "/C1?;$2OT1;?&1B2T # "/C1?;$2OT1;?&1B2T1&.T # "/C1?;$2OT1;?&1./2* # "/C1?;$2OT1;?&1./2*1&.T # "/C1$2OT # "/C1$2OT1&.T # "/C1$2OT1B2T # "/C1$2OT1B2T1&.T # "/C1$2OT1./2* # "/C1$2OT1./2*1&.T # "/C1$2OT1S*I$ # "/C1$2OT1S*I$1&.T # "/C1$2OT1S*I$1B2T # "/C1$2OT1S*I$1B2T1&.T # "/C1$2OT1S*I$1./2* # "/C1$2OT1S*I$1./2*1&.T $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ $IC @ >/4?8 R R. >/4?8 R/R. >/4?8 RHR. >/4?8 RIR. >/4?8 RSR. >/4?8 R'R. >/4?8 R5R. >/4?8 RFR. >/4?8 R0R. >/4?8 R2R. >/4?8 RTR. >/4?8 R(R. >/4?8 R1R. >/4?8 R7R. >/4?8 R9R. >/4?8 RMR. >/4?8 RUR. >/4?8 RVR. >/4?8 R R. >/4?8 R#R. >/4?8 R8R. >/4?8 R,R. >/4?8 RWR. >/4?8 0?OT8.
!3
The ."H/I. mem-er contains such /I. codes asC ."H8;T82C 8;T82 )ey ."HC48/2C C48/2 )ey ."H$/113C $/1 to $/3 )eys ."H$"112!C $"1 to $"2! )eys The follo6in% is an e:ample of usin% /I. information in a pro%ramC
IF (IB'I- 0 -F.PF) P(2FO2M 21""8(+-82O,TI+( (5S( IF (IB'I- 0 -F.P'1 P(2FO2M 22""8C'+C(582O,TI+( (5S( IF (IB'I- 0 -F.(+T(2 P(2FO2M 2)""8+O2M'582O,TI+( (5S( P(2FO2M 2>""8K2O+682O,TI+(.
!!
Chapter +
('2CD Co&es
If an e:ceptional condition occurs durin% e:ecution of a CICS application pro%ramE and if pro%ram does not chec) the e:ceptional conditionE CICS 6ill -y default terminates the tas). This )ind of termination is )no6n as a-normal termination and CICS 6ill issue the a-normal termination '/B8;.( codeE 6hich is associated 6ith the e:ceptional condition on su-Dect. 8:ceptional conditions can -e handled usin% any of the follo6in%C H/;.48 CO;.ITIO; command I<;O28 CO;.ITIO; command ;OH/;.48 option
!#
The HconditionI represents an e:ceptional condition. If a la-el is specifiedE control 6ill -e passed to the la-eled para%raph of the pro%ram 6hen the condition specified occurs. If no la-el is specifiedE it has the effect of cancelin% the pre3iously set H/;.48 CO;.ITIO; re=uest and the default action 6ill -e ta)en. The %eneral error condition '822O2( can -e specified 6ithin the same list to specify that all other conditions cause control to -e passed to the la-el specified. /lthou%h more than one H/;.48 CO;.ITIO; command can -e issued in the pro%ramE not more than 16 conditions can -e specified in a sin%le H/;.48 CO;.ITIO; command. 2Bam+le
211"82(C(IV(8C.OIC( S(CTIO+. (4(C CICS .'+-5( CO+-ITIO+
!6
The HconditionI indicates an e:ceptional condition. ;o more than 16 conditions are allo6ed in the same command. 2Bam+le
(4(C CICS I6+O2( CO+-ITIO+ 5(+6(22 (+-8(4(C. (4(C CICS 2(C(IV( M'P%MM'P1B& M'PS(T%MM'P1B& I+TO%M'P1I& 5(+6T.%E"&
!+
CO0(CD32 O+tion
The ;OH/;.48 option can -e specified in any CICS commandE and it 6ill cause no action to -e ta)en for any e:ceptional condition occurrin% durin% e:ecution of this command. This option is 3ery useful to pre3ent a loop on the e:ceptional condition. Ho6e3erE this option should -e used for the special purpose onlyE -ecause the e:cessi3e use of this option defeats the purpose of the e:ceptional conditions and the H/;.48 CO;.ITIO; command. 2Bam+le
(4(C CICS S(+M'P%8888& M'PS(T%888888& F2OM%888888& 5(+6T.%888& +O.'+-5( (+-8(4(C.
<2S1 O+tion
The 28S$ option can -e specified in many CICS command. Its function is similar to the return code in the -atch pro%ram. If 28S$ option is specified in a commandE CICS places a response code at a completion of the command. The application pro%ram can chec) this codeE then proceed to the ne:t processin%. If the 28S$ option is specified in a commandE the ;OH/;.48 option is applied to this command. ThereforeE the H/;.48 CO;.ITIO; re=uests 6ill ha3e no effect in this case. The follo6in% are the procedures to utiliGe the 28S$ option in a CICS commandC 1. define a full6ord -inary field 'S,'8( CO&$( in the Aor)in% Stora%e Section as the response field. 2. $lace the 28S$ option 6ith the response field in a command 'any CICS command(. 3. /fter command e:ecutionE chec) the response code in the response field 6ith ."H28S$'::::(E 6here :::: isC 1. ;O2&/4 for normal completion. 2. /ny e:ceptional condition. 2Bam+leD
!8
CoteD ?se of 28S$ implies ;OH/;.48 ;OH/;.48 o3errides H/;.48 CO;.ITIO; and H/;.48 /I.. Hence $" )ey responses mi%ht -e i%nored if used 6ith 28C8I>8 command. ;OH/;.48 also suspends e:ecution till the specified resources -ecome a3aila-le 'e.%.C TS07T.0 etc.(.
Ahere Hla-elI is the para%raph name of the pro%ram to 6hich control is to -e passed. ?se of /I. )ey is detected -y 28C8I>8 &/$ command.
!,
Commonly use& O+tions /ny )ey name '$/1 to $/3E $"1 to $"2!E 8;T82E C48/2( /;9*89 '/ny of the a-o3e e:cept 8;T82 )ey(
#1
2I'(ID
The 32+ terminal transmits the /I. character to the 8IB/I. field of 8IBE at the time of tas) initiation. 8IB/I. can -e used to find 6hich /I. *ey has -een pressed -y user CICS copy -oo) ."H/I. fields are used to identify the )ey pressed I" 8IB/I. L ."H/I.'8;T82( O2 I" 8IB/I. L ."H8;T82 8IB/I. 3alue can -e chec)ed e3en 6ithout recei3in% map.
#2
"ollo6in% are some useful standard attri-ute characters in ."HB&SC/C ."HB&/S*C ."HB&"S8C ."H?;;?&C ."H?;I&.C ."H?;I;TC /uto1s)ip ?nprotectedE &.T on ?nprotectedE &.T onE numeric ?nprotectedE hi%h intensityE &.T on ?nprotectedE hi%h intensityE &.T onE numeric
9ou can assi%n a default attri-ute character in a B&S map. ButE in the cases li)e an edit error in a fieldE you mi%ht 6ish to hi%hli%ht the field indicatin% an error in a field. This can -e accomplished -y dynamically assi%nin% a ne6 attri-ute character for the field on su-Dect. "or the dynamic attri-ute character assi%nmentE you place the predefined attri-ute character to the fieldnameX/ of the field to 6hich you 6ish to dynamically assi%n the attri-ute character. The attri-ute character to -e dynamically assi%ned must -e chosen 3ery carefully -ased on the re=uirement and the characteristics of the field 'e.%.E alphanumeric or numeric(. Ahen the map is sent throu%h S8;. &/$ commandE the ne6 attri-ute 6ill -e in effect on the field on su-DectE o3erridin% the ori%inal attri-ute defined at the map definition time.
#3
2Bam+le
KO2=I+68STO2'6( S(CTIO+. 8888888 COP/ LM'PS(T'L. 8888888 COP/ L-F.BMSC'L. 8888888 P2OC(-,2( -IVISIO+. 8888888 MOV( -F.BMB2/ TO C,ST+O8'. MOV( -F.-MP2O TO C,ST+'M(8'. MOV( -F.-MP2O TO 'MO,+T8'. (4(C CICS S(+M'P %LM'P+'M(L& M'PS(T%LM'PS(T'L& (+-8(4(C. (.g. E.1: -ynamically attrib!te Cal!e assignment
Dynamic4<elati)e 1ositionin*
In this approachE you dynamically position a cursor throu%h an application pro%ram usin% the C?2SO2'data13alue( option in the S8;. &/$ command 6ith the 3alue of the relati3e position 'startin% from Gero( of the terminal. /t the completion of the S8;. &/$ commandE the map 6ill -e displayed 6ith the cursor at the specified positionE o3erridin% the static cursor position defined at the map definition time. .ata13alue is calculated asC 'ro6 K 1 ( T 8 X 'column 1 1( The follo6in% is an e:ample of the dynamic72elati3e cursor positionin%C
(4(C CICS S(+M'P%888888& M'PS(T%8888888& C,2SO2%1""& (2'S( (+-8(4(C. (.g. E.>: 2elatiCe C!rsor Positioning
/lthou%h this approach ma)es the application pro%ram a-le to position the cursor dynamicallyE since the relati3e position of the terminal is de3ice dependentE this approach is de3ice dependent and format dependent. Ahene3er the terminal type is chan%ed or the screen layout is chan%edE the application pro%ram 6ill ha3e to -e modified to reflect the chan%e. This lessens the pro%ram maintaina-ility.
##
Symbolic Map
BMS
O!tp!t +M-S
Terminal
Physical Map
-ata (ntry
Symbolic Map
BMS
Inp!t +M-S
Terminal
The follo6in% commands are a3aila-le for the -asic B&S input7output operationsC 28C8I>8 &/$ S8;. &/$ 28C8I>8 S8;. T8@T C C C C "ormatted data transfer. To recei3e a map "ormatted data transfer. To send a map ?nformatted data transfer. To recei3e a te:t ?nformatted data transfer. To send a te:t #6
&/$ defines the name of the mapE 6hich 6as defined in the correspondin% ."H&.I macro. &/$S8T defines the name of the mapset 6hich 6as defined in the correspondin% ."H&S. macro. If nothin% else is specifiedE the I;TO option is assumedE and B&S automatically finds the sym-olic map area to place the data from the terminal. This command 6hen e:ecuted 6ill place all modified data items in the sym-olic 6or) area. Common 2Bce+tional Con&ition &/$"/I4 This occurs If the data to -e mapped has the len%th of Gero. If user presses the 8;T82 'or any /I. )ey( 6ithout typin% data if no "S8T is specified in ."H&." macros. If map is recei3ed -y pressin% C48/2 or any of the $/ )eys.
#+
#8
&/$ .efines the name of the map defined in the correspondin% ."H&.I macro. &/$S8T .efines the name of the mapset defined in the correspondin% ."H&S. macro. "2O& 83en if not specifiedE this option is assumedE and B&S automatically finds the sym-olic map area to ta)e the data to the terminal.
#,
C?2SO2 &a)es the application pro%ram a-le to position the cursor dynamically on any part of the screen. 82/S8 If this is specifiedE the current screen 6ill -e erased -efore the map specified appears on the screen. If this is not specifiedE the map specified 6ill -e o3er6ritten onto the current screen. ThereforeE dou-le ima%e screen mi%ht appearE 6hich may -e useful for sendin% error messa%es into the current screenE -ecause the current screen 6ill -e )ept as it is. 82/S8/?$ To erase all unprotected fields. The protected fields or attri-ute fields remain as they are in the current screen. "288*B To free the )ey-oard. /4/2& To ma)e an alarm sound. "2S8T To reset &.T to Gero 'i.e.E not modified( for all unprotected fields of the screen. ./T/O;49 Only application pro%ram data in the sym-olic map is to -e sent to the terminal. &/$O;49 Only the default data from the physical map is to -e sent to the terminal. PIf the a-o3e t6o options are not %i3enE data from -oth the maps is sent to the terminal.Q 2Bam+le
KO2=I+68STO2'6( S(CTIO+. 8888888 COP/ M'P'. 8888888 P2OC(-,2( -IVISIO+ 88888888 (4(C CICS .'+-5( CO+-ITIO+ I+VMPS? %BI68M'P& (+- (4(C. 8888888 (4(C CICS S(+- M'P%LM'P'L& M'PS(T %LM'P'L& F2OM %M'P'I& (+-8(4(C. 88888888888888
61
2Bam+le
I-(+TIFIC'TIO+ -IVISIO+. 8888 KO2=I+68STO2'6( S(CTIO+. "1 MS685(+6T. PIC SD%>& COMP. "1 I+P,T8MS6. "2 T2'+S8IPIC 4%>&. "2 FI55(2 PIC 4%1&. "2 M(SS'6( PIC 4%@&. 8888 P2OC(-,2( -IVISIO+. MOV( 1" TO MS685(+6T. (4(C CICS .'+-5( CO+-ITIO+ 5(+6(22 %5(+6T.8(22O282T& (+-8(4(C 88888 (4(C CICS 2(C(IV( I+TO %I+P,T8MS6& 5(+6T. %MS685(+6T.& (+-8(4(C 8888 5(+6T.8(22O282T.
88888
62
63
2Bam+le
I-(+TIFIC'TIO+ -IVISIO+. 8888 KO2=I+68STO2'6( S(CTIO+. O,TP,T8M(SS'6(. 88888 "1 KS8M(SS'6( PIC 4%)"& Val!e Spaces P2O(-,2( -IVISIO+. 8888888 MOV( L(+- OF S(SSIO+L TO KS8M(SS'6(. (4(C CICS S(+- T(4T F2OM %KS8M(SS'6(& 5(+6T. %)"& (2'S( F2((=B (+-8(4(C. 8888888888
6!
(S7TI/2 Comman&
.unction The /S*TI&8 command is used to re=uest the current date and time. The 8IB./T8 and 8IBTI&8 fields ha3e the 3alues at the tas) initiation time. ?p on completion of this commandE these fields 6ill -e updated to ha3e the current date and time. .ormat
(4(C CICS 'S=TIM( ;'BSTIM(% ata8area&< (+-8(4(C. (g.1".1: Format O* 'S=TIM( Comman
/BSTI&8 option is re=uired if you 6ant to store current date and time for further processin%. Aithout this option /S*TI&8 6ill Dust update 8IB./T8 and 8IBTI&8 field. The data1area is defined in Aor)in%1Stora%e Section 6ith picture clause of S,'1#( CO&$. Hdata1areaI after the e:ecution %ets the 3alue in milliseconds.
6#
.O</(TTI/2 Comman&
.unction The "O2&/TTI&8 command is used to recei3e the information of date and time in 3arious formats. .ormat
(4(C CICS FO2M'TTIM( 'BSTIM(% ata8area& ;//---% ata8area&< ;//MM--% ata8area&< ;//--MM% ata8area&< ;MM--//% ata8area&< ;--MM//% ata8area&< ;-'T(S(P% ata8Cal!e&< ;-'/OFK((=% ata8area&< ;-'/OFMO+T.% ata8area&< ;MO+T.OF/('2% ata8area&< ;/('2% ata8area&< ;TIM(% ata8area& ;TIM(S(P% ata8Cal!e&<< (+-8(4(C.
Hdata1areaI for date and time are defined as @' 8(. Time separator -y default is HCI and date separator -y default is H7I'for this specify TI&8S8$ and ./T8S8$ options 6ithout ar%ument(. If these t6o options are omittedE no separator is pro3ided.
66
6+
<2T:<C Comman&
.unction The 28T?2; command is used to return control to the ne:t hi%her lo%ical le3elE or CICS itself. .ormat
(4(C CICS 2(T,2+ ;T2'+SI-%name& ;COMM'2('% ata8area& 5(+6T.% ata8Cal!e&<<< (+-8(4(C. (.g.11.1: Format O* 2(T,2+ Comman
If none of T2/;SI.E CO&&/28/E or 48;<TH is specifiedE and if CO&&/28/ had -een passed -y a callin% pro%ramE the 28T?2; command ma)es the data in CO&&/28/ a3aila-le to the callin% pro%ram. That isE the called pro%ram does not ha3e to use the CO&&/28/ option in the 28T?2; command. If the T2/;SI. option is usedE the specified transaction identifier 6ill -e the transaction identifier for the ne:t pro%ram to -e associated 6ith the terminal. . This is allo6ed only in the pro%ram at the hi%hest lo%ical le3el. If the T2/;SI. option is specifiedE the CO&&/28/ and 48;<TH option can -e used to pass data to the ne:t tas)
68
.ormat
(4(C CICS 5I+= P2O62'M%name& ;COMM'2('% ata8area&< ;5(+6T.% ata8Cal!e&< (+-8(4(C. (.g.11.2: Format O* 5I+= Comman
The name of the called pro%ram to 6hich control is passed must -e specified in $2O<2/&. .unction of ECT3 comman& The @CT4 command is used to pass control from one application pro%ram to another application pro%ram at the same lo%ical le3el. The callin% pro%ram does not e:pect control to -e returned. .ata can -e passed to the pro%ram throu%h a special communication area called CO&&/28/. Since this command re=uires less o3erheadE performance is relati3ely -etter in comparison to the 4I;* command.
CICS 5ogical 5eCel %"& Prog B 5I+= C 2(T,2+ Prog C 4CT5 2(T,2+ Prog 5I+= 77 2(T,2+ %2& %1&
6,
2Bam+le Of 3IC7
PCo e in ProgramBMen!B (4(C CICS .'+-5( CO+-ITIO+ P6MI-(22%>"""8P6M8+OT8F+-& (22O2%>"""86(+(2'58(22O2& (+-8(4(C. (4(C CICS 5I+= P2O62'M%MFI5(8M'I+TB& COMM'2('%KS8COMM8'2('& 5(+6T.%2"& (+-8(4(C. PCo e in Prorgram MFI5(8M'I+TB (4(C CICS 2(T,2+ (+-8(4(C. TaHes control bacH in MMen!B program
2Bam+le Of ECT3
PCo e in ProgramBMen!B (4(C CICS .'+-5( CO+-ITIO+ P6MI-(22%>"""8P6M8+OT8F+-& (22O2%>"""86(+(2'58(22O2& (+-8(4(C. (4(C CICS 4CT5 P2O62'M%MFI5(8M'I+TB& COMM'2('%KS8COMM8'2('& 5(+6T.%2"& (+-8(4(C. PCo e in Prorgram MFI5(8M'I+TB (4(C CICS 2(T,2+ (+-8(4(C.
+1
()ailable Comman&s "or random access of >S/& dataset follo6in% commands are a3aila-leC 28/.C A2IT8C 28A2IT8C .848T8C ?;4OC*C To read a record directly To ne6ly 6rite a record To update an e:istin% record To delete a record To release e:clusi3e control ac=uired for update.
+2
The system pro%rammer 'or application pro%rammer( defines the "ile Control Ta-le '"CT( to specify the characteristics of files to -e used under CICSE 6hile application pro%rammer codes application pro%ram usin% CICS commands. In this 6ayE it is almost transparent to the application pro%rammer 6hich data access method is -ein% used. 2Bclusi)e Control Durin* :+&ates If a tas) is updatin% a recordE the other tas)s must -e e:cluded from updatin% the recordJ other6ise data content 6ill -e updated incorrectly. This control is called e:clusi3e control o3er the resources durin% updates. This is important -ecause in the CICS en3ironmentE many tas)s mi%ht -e concurrently accessin% the same file 'possi-ly the same record(. CICS loc)s the entire control inter3al 6here that record under su-Dect is residin%. .ile O+en4Close Ahen an application pro%ram accesses a fileE the file must -e open under CICS. "or thisE "CT defines an initial file open7close status. If the file is closedE you must open the file usin% the &aster Terminal transaction 'C8&T( -efore you initiate an application pro%ram 6hich uses this file.
This is the -asic format for the 28/. command. /s the othe roptions are introducedE the format 6ill 3ary sli%htly.
+3
CICS 6ill read the record Y/ 1B and place the data in the I;TO field '"I481 /28/(. The actual record len%th 6ill -e placed in 48;.
+!
+#
+6
2Becution <esults Suppose that file "I482 has records in the follo6in% orderC BC .C .C ;9 ;9 ;9 $H $H 1 1 1 T 1 2 1 2 ( 6ill -e readE -ecause this is the first record of the %eneric )ey
Common 2Bce+tional Con&itions ;OT";. ;o record 6ith the )ey specified is found. 48;<822 The specified len%th is shorter than the actual record len%th. The record 6ill -e truncated at the len%th specified and mo3ed into the I;TO field. The actual len%th 6ill -e placed in the 48;<TH field I;>280 The )eylen%th specified is %reater than the actual )eylen%th of the record.
++
+8
2Becution <esults /t the completion of the 28/.7?$./T8 commandE record ;9 1 6ill -e read and reser3ed for the su-se=uent update. That isE e:clusi3e control o3er the record is maintained for this tas). /t the completion of the 28A2IT8 commandE the same record ;9 1 6ill -e re6ritten and the record 6ill -e released from e:clusi3e control.
2Bce+tional Con&itions I;>280 The 28A2IT8 command is issued 6ithout a prior 28/. command 6ith the ?$./T8 option.
:C3OC7 Comman&
.unction The 28/. command 6ith the ?$./T8 option normally maintains e:clusi3e control o3er the record read untilC The record is updated -y the 28A2IT8 command. The transaction is normally or a-normally completed.
Ho6e3erE there are occasions 6hen after readin% a record throu%h the 28/. command 6ith the ?$./T8 option. It is found that the update is no lon%er re=uired or if the 28A2IT8 command itself fails the e:ecution. In this caseE the application pro%ram should release e:clusi3e control from the recordE so that other tas)s can access the same record. "or this purposeE the ?;4OC* command is used. That isE the ?;4OC* command is used to release the e:clusi3e control from the record. .ormat The format of the ?;4OC* command is sho6n in the e:ample -elo6. ./T/S8T names the file from 6hich e:clusi3e control is to -e released. 2Bam+le
(4(C CICS ,+5OC= -'T'S(T%MFI5(2B& (+-8(4(C.
+,
><IT2 Comman&
.unction The A2IT8 command is used to 6rite a record directly into a file -ased on the )ey specified. .ormat
(4(C CICS K2IT( -'T'S(T%name& F2OM% ata8area& 5(+6T.% ata8Cal!e& 2I-F5-% ata8area& (+-8(4(C. (.g. 12.$: Format O* MK2IT(B Comman
2Bam+le
MOV( )@ TO K=85(+. MOV( M+/"">B TO 2(C8'8=(/. MoCe symbolic map *iel s to the recor areaQQ (4(C CICS K2IT( -'T'S(T%MFI5(2B& F2OM%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& 5(+6T.%K=85(+& (+-8(4(C. (.g. 12.E: (7ample O* MK2IT(B Comman
2Bce+tional Con&itions .?$28C The duplicate record is found. ;OS$/C8 ;o dis) space is a3aila-le for the record addition. 48;<822 The len%th specified is %reater than the ma:imum len%th specified in the >S/& cluster.
81
Customer Information Control System (CICS) ><IT2 Comman& =ith /(SSICS2<T O+tion
.unction The A2IT8 command 6ith the &/SSI;S82T option is used to add a %roup of records 6hose )eys are in ascendin% order into a file. If there are many records to -e added as a %roupE this option 6ill pro3ide hi%h performance in 6ritin% these records. Since the &/SSI;S82T option causes e:clusi3e control o3er the fileE the file must -e released -y the ?;4OC* command after the completion of the A2IT8 command. 1roce&ures The follo6in% are the procedures for the mass1insert operations usin% the A2IT8 command 6ith the &/SSI;S82T optionC 1. 2. 3. !. #. 8sta-lish the first record )ey. Issue the A2IT8 command 6ith the &/SSI;S82T option. Increment the )ey in the ascendin% order. repeat steps 2 and 3 until all records ha3e -een 6ritten. Issue the ?;4O/* command to release the e:clusi3e control o3er the file.
.ormat The format of the A2IT8 command 6ith the &/SSI;S82T option is sho6n in the e:ample -elo6. 2Bam+le
P2OC(-,2( -IVISIO+ QQ.. MOV( MT4"""B TO 2(C8'8=(/B. M'SS8I+S85OOP S(CTIO+. '-- 1 TO 2(C8'8=(/8S(F. QQ. %Prepare the recor content& QQ. (4(C CICS K2IT( -'T'S(T%MFI5(2B& F2OM%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& 5(+6T.%K=85(+& M'SSI+S(2T (+-8(4(C. IF 2(C8'8S(F R DD 6O TO M'SS8I+S85OOP. (4(C CICS ,+5OC=
-'T'S(T%MFI5(2B& (+-8(4(C.
82
D232T2 Comman&
.unction The .848T8 command is used to delete one record or a %roup of records from a file. There are three approaches to usin% the .848T8 command. D232T2 after <2(D4:1D(T2 (++roach In this approachE the .848T8 command is used 6ithout the record )ey information after the 28/. command 6ith the ?$./T8 option has -een completed. The record 6hich 6as read -y the 28/.7?$./T8 command 6ill -e deleted from the file. .ormat The format of the .848T8 command in this approach is sho6n in the e:ample -elo6. The only parameter re=uired is ./T/S8TE 6hich must name the same file used -y the prior 28/.7?$./T8 commandC 2Bam+le
MOV( )@ TO K=85(+. MOV( M+/""1B TO 2(C8'8=(/. (4(C CICS 2('-'T'S(T%MFI5(2B& I+TO%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& ,P-'T( 5(+6T.%K=85(+& (+-8(4(C. QQ (4(C CICS -(5(T( -'T'S(T%MFI5(2B& (+-8(4(C.
2Bce+tional Con&ition I;>280 The .848T8 command 6ithout the 2I."4. option is issued 6ithout a prior 28/.7?$./T8 command. Direct D232T2 (++roach
83
.ormat The format of the .848T8 command in this approach is sho6n in the e:ample sho6n -elo6. ./T/S8T must name the file from 6hich a record is to -e deleted. In additionE the full )ey data must -e pro3ided in the 2I."4. field for the record to -e deleted. 2Bam+le
MOV( M+/""1B TO 2(C8=(/. (4(C CICS -(5(T( -'T'S(T %MFI5(2B& 2I-F5-%2(C8'8=(/& (+-8(4(C.
0 reS!ire
2Bce+tional Con&itions .?$*89 There is more than one record 6ith same )ey. 'In the case of /lt. Inde:( ;OT";. The record specified is not found. 9rou+ <ecor& D232T2 (++roach In this approachE the .848T8 command is issued 6ith the <8;82IC option. / %roup of recordsE 6hich satisfy the %eneric )ey specifiedE 6ill -e deleted from the file. .ormat The format of the .848T8 command in this approach is sho6n in the e:ample sho6n -elo6. In addition to the re=uired parameter for the direct deleteE <8;82IC must -e specified as the option. The *8948;<TH indicates the len%th of the %eneric )ey. The hi%her part of the )ey information must -e supplied in the 2I."4. field. / half16ord -inary field 'S,'!( CO&$( should -e pro3ided to ;?&28CE 6hich 6ill contain the num-er of the records deleted -y this %eneric delete. 2Bam+le
P2OC(-,2( -IVISIO+. Q.. MOV( M+/B TO 2(8'8=(/. (4(C CICS -(5(T(
8!
Chapter 13
ST(<T'< Comman&
.unction The ST/2TB2 command is used to esta-lish a -ro6se startin% position for a file. This command is for esta-lishin% the position only. The actual record 6ill -e read -y the ne:t read command '28/.;8@T or 28/.$28>(. .ormat
(4(C CICS ST'2TB2 -'T'S(T%name& 2I-F5-% ata8area& 6T(FO(F,'5 ;=(/5(+6T.% ata8area& 6(+(2IC< 2B'O22+ (+-8(4(C (.g. 1).1: Format O* MST'2TB2B Comman
8#
86
2Bam+le
KO2=I+68STO2'6( S(CTIO+. $$ K=85(+ "1 FI5(8IO'2('. "@ 2(C8'8=(/. 1" 2(C8'8=(/8CIT/ 1" 2(C8'8=(/8S(F "@ 2(C8'8-(T'I5 P2OC(-,2( -IVISIO+. : : MOV( M+/"""B TO 2(8'8=(/. (4(C CICS ST'2TB2 -'T'S(T %MFI5(2B& 2I-F5-%2(C8'8=(/& 6T(F (+-8(4(C.
0 e*a!lt
2Becution <esults Suppose the file has the records in the follo6in% orderC B .C .C ;9 ;9 ;9 $H $H 1 1 2 1 2 3 1 2
1(.
2Bce+tional Con&itions .SI.822 The file specified is not found in "CT. ;OT";. The specified record is not found.
8+
<2(DC2ET Comman&
.unction The 28/.;8@T command is used to read a record of a file se=uentially for6ard. The ST/2TB2 must ha3e -een successfully completed prior to issuin% the 28/.;8@T command. .ormat
(4(C CICS 2('-+(4T -'T'S(T%name& I+TO% ata8area& 5(+6T.% ata8Cal!e& 2I-F5-% ata8area& 2B'O22+ (+-8(4(C. (.g. 1).): Format O* M2('-+(4TB Comman
2Bam+le
KO2=I+68STO2'6( S(CTIO+. $$ K=85(+ "1 FI5(8IO'2('. "@ 2(C8'8=(/. 1" 2(C8'8=(/8CIT/ 1" 2(C8'8=(/8S(F "@ 2(C8'8-(T'I5 P2OC(-,2( -IVISIO+. : : MOV( M+/"""B TO 2(8'8=(/. (4(C CICS ST'2TB2 -'T'S(T %MFI5(2B& 2I-F5-%2(C8'8=(/& 6T(F (+-8(4(C.
0 e*a!lt
MOV( )@ TO K=85(+. (4(C CICS 2('-+(4T -'T'S(T%MFI5(2B& I+TO%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& 0 reS!ire 5(+6T.%K=85(+& (+-8(4(C. (.g. 1).>: (7ample O* M2('-+(4TB Comman
88
2Becution <esults /t the completion of the pro%ram lo%icE the follo6in% actions 6ill occurC / record 6ill actually -e read into the I;TO area. That isE the record ;9 1 6ill -e placed in "I481IO/28/. CICS 6ill place the actual )ey into the 2I."4. area '28C1/1*89(. CICS 6ill place the actual record len%th into the 48;<TH area 'A*148;(. If the same 28/.;8@T command is issued a%ainE the record ;9 2 6ill -e readJ that isE the record 6ill -e read for6ard.
2Bce+tional Con&itions .?$*89 The )ey of the record is a duplicate of the ne:t recordBs )ey. 8;."I48 The end of the file is detected. 48;<822 The actual record len%th is %reater than the len%th specified.
<2(D1<2V Comman&
.unction The 28/.$28> command is used to read a record of a file -ac)6ard. The ST/2TB2 command must ha3e -een successfully completed prior to issuin% the 28/.$28> command. .ormat The format of the 28/.$28> command is sho6n in the e:ample -elo6. The options and parameters are the same as the 28/.;8@T command.
8,
2Bam+le
KO2=I+68STO2'6( S(CTIO+. $$ K=85(+ "1 FI5(8IO'2('. "@ 2(C8'8=(/. 1" 2(C8'8=(/8CIT/ 1" 2(C8'8=(/8S(F "@ 2(C8'8-(T'I5 P2OC(-,2( -IVISIO+. : : MOV( M+/"""B TO 2(8'8=(/. (4(C CICS ST'2TB2 -'T'S(T %MFI5(2B& 2I-F5-%2(C8'8=(/& 6T(F (+-8(4(C.
0 e*a!lt
MOV( )@ TO K=85(+. (4(C CICS 2('-P2(V -'T'S(T%MFI5(2B& I+TO%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& 0 reS!ire 5(+6T.%K=85(+& (+-8(4(C.
2Becution <esults /t the completion of this pro%ram lo%icE the follo6in% actions 6ill occurC 8:actly the same results of 28/.;8@T can -e applied. If the same 28/.$28> command is issued a%ainE the record .C read. That isE the record 6ill -e read -ac)6ard.
2 6ill -e
2Bce+tional Con&itions The e:ceptional condition common to the 28/.$28> command includes the same conditions mentioned in the 28/.;8@T command. In additionE the follo6in% conditions should -e 6atchedC ;OT";. The record positioned -y the ST/2TB2 command or the 28S8TB2 command is not found. The ST/2TB2 or 28S8TB2 command prior to the 28/.$28> command must specify an e:istin% record as the start )ey. Other6iseE at the 28/.$28> timeE the
0 Place a sHipping Hey 0 2ecor P.""" is rea into the *ile area.
,1
2Becution <esults 2ecord $H 6ill -e read 'that isE ;9 continued from there. Chan*in* Direction Of 'ro=se /fter the ST/2TB2 commandE the direction of -ro6se can -e chan%ed from for6ard to -ac)6ard -y simply s6itchin% the 28/.;8@T command to the 28/.$28> commandE or 3ice 3ersa. Ho6e3erE the first 28/.$28> 'or 28/.;8@T( command after the direction chan%e 6ill read the same record as the last 28/.;8@T 'or 28/.$28>E respecti3ely( commandE as illustrated -elo6C
ST/2TB228/.;8@T28/.;8@T28/.;8@T28/.$28>28/.$28>
'rec1(
'rec2(
'rec3(
'rec2(
<2S2T'< Comman&
.unction The 28S8TB2 command is used to reesta-lish another startin% point 6ithin the same -ro6se operation a%ainst the same file. The 28S8TB2 command performs e:actly the same function as the ST/2TB2 commandE e:cept that reposition is much faster -ecause the file is already in the -ro6se mode -y the prior ST/2TB2 command. That is 6ithout issuin% the 8;.B2 command. The 28S8TB2 command ma)es it possi-le to reposition the dataset for a ne6 -ro6se operation. Similar to the ST/2TB2 commandE the 28S8TB2 command does repositionin% only. The actual record read 6ill -e done -y the ne:t 28/.;8@T or 28/.$28> command. The 28S8TB2 command can also -e used for chan%in% the characteristics of -ro6seE for e:ampleE from %eneric )ey positionin% to full )ey positionin%E or 3ice 3ersa. .ormat The format of the 28S8TB2 command is sho6n in the e:ample -elo6. The options and parameters are the same as the ST/2TB2 command.
,2
2Bam+le
KO2=I+68STO2'6( S(CTIO+. $$ K=85(+ "1 FI5(8IO'2('. "@ 2(C8'8=(/. 1" 2(C8'8=(/8CIT/ 1" 2(C8'8=(/8S(F "@ 2(C8'8-(T'I5 P2OC(-,2( -IVISIO+. : : MOV( M+/"""B TO 2(8'8=(/. (4(C CICS ST'2TB2 -'T'S(T %MFI5(2B& 2I-F5-%2(C8'8=(/& 6T(F (+-8(4(C.
0 e*a!lt
MOV( )@ TO K=85(+. (4(C CICS 2('-+(4T -'T'S(T%MFI5(2B& I+TO%FI5(8IO'2('& 2I-F5-%2(C8'8=(/& 0 reS!ire 5(+6T.%K=85(+& (+-8(4(C. PP6o *or 2('-+(4T !ntil Hey matchesQ. PP2eset the Hey (4(C CICS 2(S(TB2 -'T'S(T%MFI5(2B& 2I-F5-%2(C8'8=(/& (F,'5 (+-8(4(C. : : (.g. 1).$: (7ample O* M2(S(TB2B Comman
2Bce+tional Con&itions I;>280 The 28S8TB2 command is issued 6ithout the prior ST/2TB2 command.
2CD'< Comman&
.unction /t the physical end1of file 'no record e:ists physically further( or lo%ical end1of file 'no rele3ant record e:ists further(E the -ro6se operation must -e terminated. The 8;.B2
,3
,!
2Becution <esult "or operation 1C ;9 6ill -e read "or operation 2C .C 1 6ill -e read "or operation 3C B 6ill -e read
,#
Camin* Con)ention for TS; ;ueue I& / TS0 identified -y the =ueue id '1 to 8 -ytes( can -e accessed -y any transactions in the same CICS re%ion. This means that TS0 could -e accessed -y any of the follo6in% transactionsC Same transactionC o "rom same terminal o "rom different terminal .ifferent transactionC
,6
dtttann
dC ttttC aC nnC
.i3ision id 'e.%.E / for /ccountsE B for Bud%et( Terminal id /pplication code '/E -E CEO..( 0ueue num-er'1E 2E O..(
Terminal I& in ;ID "or a terminal dependent tas) 'e.%.E pseudo1con3ersational tas)(E the terminal id should -e included in 0I. in order to ensure the uni=ueness of TS0 to the tas). TS; in /(IC Stora*e or (:EI3I(<A Stora*e TS0 can -e 6ritten in the main stora%e. In this caseE accessin% TS0 is a fast and con3enient operation. But TS0 in this mode is not reco3era-le. &utually e:clusi3e to the TS0 in the main stora%eE TS0 can -e 6ritten in the au:iliary stora%e. The au:iliary stora%e is an e:ternal >S/& file '."HT8&$( esta-lished -y the system pro%rammer. It is al6ays a3aila-le to application pro%ramsE 6hich implies that no file open7close is re=uired. TS0 in this mode is reco3era-le. If you 6hich to reco3er TS0 in this modeE you must specify so in the Temporary Stora%e Ta-le 'TST(.
()ailable Comman&s A2IT80 TSC 28/.0 TSC .848T80 TSC To 6rite or re6rite a record in a TS0. To read a record in a TS0. To delete a TS0. /ll records in the TS0 6ill -e deleted.
,+
2Becution <esults If TS0 6ith this 0I. does not e:istE a TS0 6ill -e created 6ith 0I.L/tttt& 1E 6here tttt is the terminal id. CICS 6ill 6rite a record in the TS0 identified -y the 0I.. CICS 6ill place the actual relati3e record num-er 'i.e.E item num-er( of the TS0 into TS0 KIT8&. 9ou may ha3e to remem-er this for later use if more than one record is in the TS0. If TS0 6ith this 0I. already e:istsE CICS 6ill simply 6rite a record in the e:istin% TS0 at the ne:t to the last e:istin% recordE and place the relati3e num-er of the record into TS01IT8&.
Common o+tions ;OS?S$8;.C 83en if the ;OS$/C8 condition is detectedE instead of suspendin% the tas)E CICS 6ill return control to the ne:t statement after the A2IT80 command.
,8
Commonly :se& O+tions ;?&IT8&SC If you 6ish to )no6 the num-er of items in the TS0E specify ;?&IT8&S 'data1area(E 6here the data1area is defined as $IC S,'!( CO&$. /t the completion of the 28/. commandE CICS 6ill place the actual num-er of records in the TS0 specified. ;8@TC &utually e:clusi3e to the IT8& optionE if the ;8@T option is specifiedE the tas) 6ill read the ne:t se=uential record in the TS0 specified.
,,
2Bce+tional Con&ition 0I.822 The specified 0I. is not found IT8&822 The specified item num-er is not found. If you are readin% TS0 se=uentiallyE this condition occurs at the end of the records of the TS0.
Note: The se=uential read of TS0 should -e done throu%h this approach. This approach is -etter than specifyin% the ;8@T option in the 28/.0 TS commandE 6hich %i3es the application pro%ram the ne:t record to the current record read -y any CICS transaction. This means that if the ;8@T option is specified in the 28/.0 TS command instead of the item option for a TS0E and if other tas)s ha3e read se3eral records of the same TS0 after the last read -y this tas)E then this tas) 6ould read a s)ipped record 'i.e.E not ne:t to the record this tas) read last(. ThereforeE the ;8@T option should -e used 3ery carefullyE if you ha3e to use it.
1 1
Note: The 28/.0 command does not hold e:clusi3e control o3er TS0E as you note that there is no ?$./T8 option in the 28/.0 command. ThereforeE if a TS0 is shared -y other transactionsE it is the application pro%ramBs responsi-ility to esta-lish e:clusi3e control o3er the TS0 durin% update. In this caseE you must use the 8;0 command -efore the 28/.0 command and the .80 command after the A2IT80 command 6ith the 28A2IT8 option
D232T2; TS Comman&
.unction The .848T80 TS command is used to delete a TS0 entirely. .ormat The format is sho6n in the e:ample -elo6. 0?8?8 names the =ueue id of TS0 you 6ish to delete. 2Bam+le
(4(C CICS -(5(T(F TS F,(,(%TSF8FI-& (+-8(4(C. (.g. 1>.@: (7ample O* -(5(T(F TS Comman
1 2
1 3
2Btra+artition TD; /n 8:trapartition T.0 is a %roup of se=uential recordsE 6hich interfaces -et6een the transactions of the CICS re%ion and the systems 'or -atch Do-s( outside of the CICS re%ion. This is 6hy the 6ord H8:trapartitionI is used. 8ach e:trapartition T.0 is a separate physical fileE and it may -e on the dis)E tapeE printerE or plotter. This implies that each file 'i.e.E 8:trapartition T.0( must -e open 6ithin CICS re%ion 6hen it is used -y the CICS transaction. The 8:trapartition T.0 is typically used for the follo6in% t6o applicationsC Interface to -atch 'or TSOE or $C( Do-s. CICS /ppl. $ro%. T.0 "ile Batch $ro%. Interface from -atch 'or TS0E or $C( Do-s. Batch pro%. "ile T.0 CICS /ppl. $ro%.
()ailable Comman&s A2IT80 T.C 28/.0 T.C .848T80 T.C To se=uentially 6rite a record in a T.0. To se=uentially read a record in a T.0. To delete an Intrapartition T.0.
It should -e noted that T. represents Transient .ata. If this is omittedE Temporary stora%e 'TS( 6ill -e assumed.
><IT2; TD Comman&
.unction The A2IT80 T. command is used to 6rite a record in a T.0. .ormat The format of the A2IT80 T. command is sho6n in the e:ample -elo6. 0?8?8 names the destination id '1 to ! characters(E 6hich must -e defined in .CT. "2O& defines the name of the area from 6hich the data is to -e 6ritten. 48;<TH indicates the len%th of the record.
1 !
2Bam+le
KO2=I+68STO2'6( S(CTIO+. "1 MS68'2('. "@ MS68TO85OC PIC %2& V'5,( M6(B. "@ FI55(2 PIC 4 V'5,( SP'C(. "@ MS68OP8F2OM PIC 4%@& V'5,( MAIMB. "@ FI55(2 PIC 4 V'5,( SP'C(. "@ MS68OP8TO PIC 4%@&. "@ FI55(2 PIC 4 V'5,( SP'C(. "@ MS68M(SS'6( PIC 4%>"&. $$ MS685(+ PIC SD%>& COMP. : P2OC(-,2( -IVISIO+. : MOV( MA'C=B TO MS68OP8TO. MOV( M.I3 T.IS IS ' T(ST M(SS'6( SKITC.I+6B TO MS68M(SS'6(. MOV( @@ TO MS685(+. (4(C CICS K2IT(F TF,(,(%MMS6SB& -estination I F2OM%MS68'2('& 5(+6T.%MS685(+& (+-8(4(C. (.g. 1@.1: (7ample O* K2IT(F T- Comman
2Bce+tional Con&ition 0I.822 The destination id specified cannot -e found in .CT. 48;<822 The len%th specified is %reater than the ma:imum record len%th specified in .CT. ;OS$/C8 ;o space is a3aila-le in the T.0.
1 #
<2(D; TD Comman&
.unction The 28/.0 T. command is used to read a particular record of a particular T.0. .ormat The format of the 28/.0 TS command is sho6n in the e:ample -elo6. 0?8?8 names the destination id '1 to ! characters(. I;TO defines the area to 6hich the record data is to -e placed. 48;<TH indicates the len%th of the record to -e read. 2Bam+le
(4(C CICS 2('-F TF,(,(%MMS6SB& I+TO%MS68'2('& 5(+6T.%MS685(+& (+-8(4(C. (.g. 1@.2: (7ample O* 2('-F T- Comman
2Bce+tional Con&ition 0I.822 The specified .estination Id is not found 48;<822 The len%th specified is shorter than the actual record len%th. The record 6ill -e truncated at the len%th specifiedE 6hile that actual len%th 6ill -e placed in th!e 48;<TH field. 0M82O The =ueue is empty. This often means the end of the file.
D232T2; TD Comman&
.unction The .848T80 T. command is used to delete an Intrapartition T.0 entirely. .ormat The format is sho6n in the e:ample -elo6. 0?8?8 names the destination id of T.0 you 6ish to delete. 1 6
T9$8LI;T2/ indicates that T.0 is the Intrapartition T.0. .8STI. defines the destination id '1 to ! characters(. 28?S8 option defines space a3aila-ility after a T.0 record has -een read. This is useful for -etter dis) space mana%ement. "or the /utomatic Tas) InitiationE T2/;SI. and T2I<48> must -e specified. T2/;SI. names the transaction id of the transaction to -e initiated. T2I<48> indicates the num-er of the records in T.0E 6hich tri%%ers the transaction to -e initiated. Note: One a record of Intrapartition T.0 is read -y a transactionE the record is lo%ically remo3edE -ut it still occupies the space. If 28?S8L98S is specifiedE this space for the lo%ically deleted record 6ill -e used for other T.0 records. ButE in this caseE records are
1 +
1 8
1 ,
0 Or I+T(2V'5%""1@""&
2Becution <esults Transaction YT2;1B 6ill -e started on terminal 'or printer( YT2&1B at 8C3 'if TI&8 is specified( or 1# minutes later 'if I;T82>/4 is specified(. Other O+tions
"2O&C To pass a field in the 6or)in% stora%e section
48;<THC 0?8?8C
To specify the len%th of the Y"2O&B field. To pass the =ueue id '8 -ytes( of a TS0 11
These data must -e retrie3ed -y the 28T2I8>8 command in the to1-e1initiated transaction.
<2T<I2V2 Comman&
.unction The 28T2I8>8 command is used to retrie3e the data passed -y the ST/2T commandE 6hich 6as issued in the other transaction in order to initiate this transaction. .ormat The format of the 28T2I8>8 command is sho6n in the e:ample -elo6. I;TO defines the field in the Aor)in% Stora%e Section to 6hich the data passed -y the "2O& option of the ST/2T command is to -e placed. 48;<TH indicates the len%th of the I;TO field. 0?8?8 defines the 0I. to 6hich the 0I. passed -y the ST/2T command to -e placed. 2Bam+le
1< (4(C CICS ST'2T T2'+SI-%MT2+1B& I+T(2V'5%""1@""& T(2MI-%MT2M1B& F2OM%-'T'F5-& 5(+6T.%1""& F,(,(%F+'M(& (+-8(4(C. 2< In the transaction %T2+1& Jhich is to be initiate by the ST'2T comman : (4(C CICS 2(T2I(V( I+TO%-'T'F5-& 5(+6T.%1""& F,(,(%2(TF,I-& (+-8(4(C.
2Becution <esults /t the completion of the ST/2T commandE the ori%inal transaction 6ill initiate the ne6 transaction 'T2;1( -ased on the time specified and the data ./T/"4.E 111
C(CC23 Comman&
.unction The C/;C84 command is used to cancel the Inter3al Control command ST/2TE 6hich ha3e -een issued. The Inter3al control commands to -e cancelled are identified -y the 280I. parameter of these commands. .ormat The format of the C/;C84 command is sho6n in the e:ample -elo6. 280I. defines the re=uest id 'up to 8 chars(E 6hich identifies the inter3al control command to -e cancelled. 2Bam+le
(4(C CICS ST'2T 2(FI-%MST'2T1B& 8888888888888888 (+-8(4(C. : : : (4(C CICS C'+C(5 2(FI-%MST'2T1B& (+-8(4(C. (.g. 1#.): (7ample o* C'+C(5 Comman
Note: 8ffecti3e only prior to the e:piration time specified in the ST/2T command.
112
S:S12CD Comman&
.unction The S?S$8;. command is used to suspend a tas). .urin% the e:ecution of this commandE the tas) 6ill -e suspendedE and control 6ill -e %i3en to other tas)s 6ith hi%her priority. /s soon as all hi%her priority tas)s ha3e -een e:ecutedE control 6ill -e returned to the suspended tas). .ormat
(4(C CICS S,SP(+(+-8(4(C. (.g. 1#.>: (7ample o* S,SP(+- Comman
(++lications Because of the =uasi1reentrancy of the CICS pro%ramsE if a C$? intensi3e processin% is performed in a pro%ramE it is a %ood practice to issue the S?S$8;. command from time to time in the pro%ram in order to allo6 other tas)s to proceed.
113
2Bam+le
(4(C CICS (+F 2(SO,2C( %TSF8FI-& (+-8(4(C. (4(C CICS 2('-F TS F,(,( %TSF8FI-& (+-8(4(C. : %,p ate the contents o* TSF& : (4(C CICS K2IT(F TS F,(,( %TSF8FI-& 2(K2IT( (+-8(4(C. (4(C CICS -(F 2(SO,2C(%TSF8FI-& (+-8(4(C. (.g. 1#.@: (7ample o* (+F an -(F Comman
Other O+tions 4en%thC If the resource is a character strin%E the 48;<TH parameter must -e specified in -oth 8;0..80 commands. ;OS?S$8;.C If this is specifiedE e3en if the 8;0B?S9 condition occursE control 6ill -e returned to the statement after the 8;0 command. 2Bce+tional Con&ition 8;0B?S9 The resource specified is reser3ed to another tas). The tas) 6ill -e suspended until the resource is freed -y the other tas).
11!
Other .acilities In additionE in order to facilitate effecti3e tests and production operationsE CICS pro3ides the follo6in% facilitiesC Transaction .ump 8:ecution .ia%nostic "acility '8."( Command 4e3el Interpreter 'C8CI( Temporary Stora%e Bro6se 'C8B2( &aster Terminal Transaction 'C8&T( .ynamic "ile Open7Close '."OC(
11#
.ormat
(4(C CICS .'+-5( 'B(+;P2O62'M%name&< : 5'B(5%label& : C'+C(5 : 2(S(T< (+-8(4(C. (.g. 1$.1: Format o* .'+-5( 'B(+- Comman
$2O<2/& or 4/B84 is used to acti3ate an e:it to a pro%ram or a para%raphE respecti3elyE for the /B8;. processin%. C/;C84 is used to cancel the pre3iously esta-lished H/;.48 /B8;. re=uest. 28S8T is to reacti3ate the pre3iously cancelled H/;.48 /B8;. re=uest.
('2CD Comman&
.unction The /B8;. command is used to terminate a tas) intentionallyE causin% an /B8;.. .ormat
(4(C CICS 'B(+;'BCO-(%name& < (+-8(4(C. (.g. 1$.2: Format o* 'B(+- Comman
/BCO.8 is used to specify the user a-end code '1 to ! characters(. 2Bam+le
(4(C CICS .'+-5( CO+-ITIO+ (22O2%(22O282T+& (+-8(4(C. : : (22O282T+. (4(C CICS 'B(+'BCO-(%M12)>B& (+-8(4(C.
116
11+
2Becution <esults If the %eneral error condition occursE control 6ill -e passed to 822O212T; throu%h the H/;.48 CO;.ITIO; command. /t the completion of the /B8;. commandE the tas) 6ill -e forcefully terminated 6ith the user /B8;. code 123!.
D:/1 Comman&
.unction The .?&$ command is used to dump the main stora%e areas related to the tas). .ormat
(4(C CICS -,MP -,MPCO-(%name& ;F2OM% ata8area& 5(+6T.% ata8Cal!e&< ;T'S=< : %Other options& : (+-8(4(C. (.g. 1$.>: Format o* -,MP Comman
.?&$CO.8 names the user dump code '1 to ! characters(. "2O& and 48;<TH are used to define the name of a particular area of the pro%ram 6hich you 6ish to dump and the len%th of the areaE respecti3ely. T/S* indicates that the tas)1related system areas are to -e dumped. There are other options for dumpin% system areas. If no option is specifiedE the option T/S* is assumedE in 6hich case the follo6in% areas 6ill -e normally dumpedC TCA, CSA, Trace Ta le, !rogra" Storage, #eneral Regi$ter$
118
11,
Dynamic Transaction 'ac6out (DT') The H/;.48 CO;.ITIO; command detects only a-normal status durin% the CICS command e:ecution. If an a-normal status occurs outside CICS commandsE since it cannot -e detected -y the H/;.48 CO;.ITIO; commandE the tas) usually 6ill -e a-normally terminated '/B8;.(. "or thisE some reco3ery mechanism is re=uired. In case a transaction /B8;. occursE CICS can automatically reco3er reco3era-le resources usin% information in the special data pool called Hdynamic lo%I. This is called H.ynamic Transaction Bac)outI '.TB(E and the CICS .ynamic Bac)out $ro%ram '.B$( mana%es it. The o-Decti3e of .TB is to restore automatically the reco3era-le resources after a transaction encounters an /B8;. to the state 6here they 6ere 6hen e3erythin% 6as %ood. If this is successfully achie3edE the transaction can -e restarted from that point. Sync 1oint an& 3o*ical :nit of >or6 (3:>) The sync point is a point in time at 6hich the resources such as files are %ood. The -e%innin% of a tas) is a sync point 6hile the end of the tas) is another sync point 6hile the end of the tas) is another sync point. 4?A is the acti3ityE 6hich a tas) performs -et6een t6o sync points. CICS maintains e:clusi3e control o3er the reco3era-le resources for the duration of a 4?A for the tas). If an /B8;. occursE CICS reco3ers the reco3era-le resources o3er the current 4?A up to the last sync point. Bet6een the -e%innin% and end of a tas)E another sync point may -e declared. This is called Hintermediate sync pointI. .eclarin% the intermediate sync point has follo6in% ad3anta%esC It reduces the amount of resource to -e maintained in the dynamic lo% It reduces the duration of e:clusi3e control o3er a 4?A. It pre3ents successful record updates from -ein% -ac)ed out need1lessly.
Dynamic 3o* / CICS re%ion has a special system area in the main memory called Hdynamic lo%I. Ahene3er a record of a reco3era-le resource such as a >S/& file is chan%ed durin% the e:ecution of a transactionE CICS automatically 6rites the H-efore ima%eI information of the record into the dynamic lo% for the duration of one 4?A of the transaction. The information in the dynamic lo% is the -asis for the resource reco3ery.
12
SACC1OICT Comman&
.unction The S9;C$OI;T command is used to define an intermediate sync point. This e:cludes the -e%innin% and end of a tas)E 6hich are automatically ta)en -y CICS. Other6iseE the S9;C$OI;T command can -e placed any6here in the application pro%ram. /t the completion of the S9;C$OI;T commandE CICS defines a sync point. .ormat
(4(C CICS S/+CPOI+T ;2O55B'C=< (+-8(4(C. (.g. 1E.1: Format o* S/+CPOI+T Comman
<O33'(C7 O+tion The S9;C$OI;T command 6ith the 2O44B/C* option is used to ma)e CICS perform .TB up the last sync point and return control to the instruction follo6in% the S9;C$OI;T72O44B/C* command. This option is 3ery useful 6hen you 6ish to automatically terminate the tas) for some reason 'e.%.E unusual e:ceptional conditions(. Before terminatin% the tas)E you can issue the S9;C$OI;T72O44B/C* command. ThenE the reco3era-le resources 6ould -e reco3ered to the last sync point.
121
122
(++lication In a CICS application pro%ramE the B44 con3ention is used commonly for the follo6in% t6o applicationsC CICS Command 6ith S8T OptionC B44 is commonly used -y the S8T option of certain CICS commands /ccessin% CICS System /reasC /nother common use of B44 is for accessin% CICS system areas.
.ormat
5I+='6( S(CTIO+. "1 B558C(5585IST. "@ FI55(2 "@ FI2ST8POI+T(2 "@ S(CO+-8POI+T(2 "@ T.I2-8POI+T(2 "1 FI2ST8-'T'. "@ FI2ST8FI(5"1 S(CO+-8-'T'. "@ S(CO+-8FI(5"1 T.I2-8-'T'. "@ T.I2-8-'T'
SD%E& COMP. SD%E& COMP. SD%E& COMP. SD%E& COMP. 4%"@&. 4%1"&. 4%1"&.
Im+ro)ements 'y VS CO'O3 II >S COBO4 II pro3ides CICS application pro%rams 6ith si%nificant impro3ements in the area of addressa-ility throu%h the special /..28SS re%ister. ThereforeE if an application pro%ram is 6ritten in >S COBO4 IIE the pro%ram no lon%er re=uires -uildin% the B44 cells in the 4in)a%e Section. The pro%ram can directly specify the 1 le3el field definitions in the 4in)a%e section 6ithout definin% the B44 cells.
123
.ormat
S(2VIC( 2(5O'- *iel 8name (.g. 1D.2: Format o* S(2VIC( 2(5O'- Comman
AhereE Hfield1nameI is a sym-olic name of the data area defined in 1 le3el of the 4in)a%e Section. 8.%.C C S82>IC8 284O/. "I2ST1./T/. C
(DD<2SS Comman&
.unction The /..28SS command is used to access information in the CICS system areas. "or the /..28SS commandE the B44 cells must -e properly defined -ased on the con3ention. .ormat
(4(C CICS '--2(SS OPTIO+% pointer8re*& ;OPTIO+%pointer8re*&< (+-8(4(C. (.g. 1D.): Format o* '--2(SS Comman
The pointer1reference is to -e set -y CICS to address the areaE 6hich you 6ish to access. Commonly :se& O+tions CS/ To access the Common System /rea 'CS/(E 6hich is a CICS system area defined -y the system. CA/ To access the Common Aor) /rea 'CA/(E 6hich is a CICS system area defined -y the system pro%rammer in SIT.
12!
TCT?/ To access the terminal Control Ta-le ?ser /rea 'TCT?/(E 6hich is a 6or) area associated 6ith a terminal. TCT?/ is defined as one per terminal in TCT. TA/ To access the Transaction Aor) /rea 'TA/(E 6hich is a 6or) area associated 6ith a tas). TA/ is defined as one per tas) in $CT.
Stora*e Control
CICS Stora%e Control $ro%ram 'SC$( controls re=uest for main stora%e -y the application pro%rams. There are t6o commands a3aila-leC <8T&/I; and "288&/I;.
92T/(IC Comman&
.unction The <8T&/I; command is used to o-tain a certain amount of stora%e. .ormat
(4(C CICS 6(TM'I+ S(T%pointer8re*& 5(+6T.% ata8Cal!e& : F5(+6T.% ata8Cal!e& ;I+ITIM6% ata8Cal!e&< ;+OS,SP(+-< (+-8(4(C. (.g. 1D.>: Format o* 6(TM'I+ Comman
The pointer reference is set to the address of the ac=uired stora%e area -y CICS. ThereforeE the correspondin% B44 cell must -e esta-lished. The len%th of the stora%eE 6hich you 6ish to ac=uireE should -e specified in either the 48;<TH or "48;<TH option. The ma:imum len%th of stora%e to -e ac=uired is 6#E #2 -ytes for the 48;<TH option and 1E +3E+!1E82! -ytes for the "48;<TH option. The I;IT&< option determines the initial 3alue to -e filled in the stora%e to -e ac=uired. The ;OS?S$8;. optionE if specifiedE inhi-its the ;OST< condition and returns to the ne:t instruction.
12#
2Bam+le
KO2=I+68STO2'6( S(CTIO+. $$ I+IT8C.2 PIC 4 V'5,( 5OK8V'5,(. : 5I+='6( S(CTIO+. "1 P'2M85IST. "@ FI55(2 PIC SD%E& COMP. "@ -KS8PT2 PIC SD%E& COMP. "1 -KS8'2('. "@ FI(5-1 PIC 4%1""&. "@ FI(5-2 PIC 4%2""&. : P2OC(-,2( -IVISIO+. : (4(C CICS 6(TM'I+ S(T%-KS8PT2& 5(+6T.%)""& I+ITM6%I+IT8C.2& (+-8(4(C. S(2VIC( 2(5O'- -KS8'2('. : (.g. 1D.@: (7ample o* 6(TM'I+ Comman
2Becution <esults /t the completion of the <8T&/I; commandE the stora%e of 3 for .AS1/28/E 6hich 6ould contain 4OA1>/4?8S. Common 2Bce+tional Con&itions 48;<822 The len%th specified e:ceeded the limit. ;OST< ;o stora%e is a3aila-le for the specified amount. The default action is that the tas) 6ill -e suspended until stora%e -ecomes a3aila-le. -ytes 6ill -e ac=uired
.<22/(IC Comman&
.unction The ac=uired stora%e area should -e freed as soon as it is no lon%er re=uired. The "288&/I; command is used to release the stora%eE 6hich has -een ac=uired. If the ac=uired stora%e is not freedE it 6ill -e freed 6hen the tas) terminates.
126
The ./T/ parameter is used to specify the area name of the stora%e to -e released. 2Bam+le
(4(C CICS F2((M'I+ -'T'%-KS8'2('& (+-8(4(C. (.g. 1D.$: (7ample o* F2((M'I+ Comman
1ro*ram Control
3O(D Comman&
.unction The 4O/. command is used to load a pro%ram or a ta-leE 6hich is independently compiled or assem-ledE lin)1edited and re%istered in $$T. This command is useful for loadin% a ta-le dynamically. That isE as an applicationE a ta-le can -e coded in /ssem-lerE assem-ledE and lin)1edited. Then a COBO4 pro%ram can load it as a ta-le. .ormat
(4C CICS 5O'P2O62'M%name& ;S(T%pointer8re*&< ;5(+6T.% ata8area& : F5(+6T.% ata8area&< ;.O5-< (+-8(4(C. (.g. 1D.E: Format o* 5O'- Comman
The address of the loaded pro%ram 'or ta-le( 6ill -e placed in the pointer1 reference specified in the S8T parameter. If the HO4. option is specifiedE the loaded pro%ram 'or ta-le( 6ill -e permanently resident until e:plicitly released.
12+
2Bam+le The follo6in% e:ample illustrates that a ta-le defined in an /ssem-ler pro%ram 'C;T29TB4( is to -e loaded into a CICS application pro%ram '$2O<1( coded in COBO4. It assumes that -oth C;T29TB4 and $2O<1 /re re%istered in $$T. (ssembler 1ro*ram This pro%ram defines a ta-le to -e used -y another pro%ram.
C+T2/TB5 CS(CT -C C51" B1",.S.'.B -C C51" M11C'+'-'B -C C51" M12,.=.B : : %1" entries& (+-
Cobol 1ro*ram This pro%ram loads and uses the ta-le outside of the pro%ram.
I-(+TIFIC'TIO+ -IVISIO+. P2O62'M8I-. P2O61. (+VI2O+M(+T -IVISIO+. -'T' -IVISIO+. KO2=I+68STO2'6( S(CTIO+. $$ TB585(+ PIC SD%>& COMP. : 5I+='6( S(CTIO+. "1 P'2M85IST. "@ FI55(2 PIC SD%E& COMP. "@ C+T2/TB58PT2 PIC SD%E& COMP. "1 C+T2/TB58-'T'. "@ FI55(2 OCC,2S 1" TIM(S. 1" C+T2/8CO-( PIC DD. 1" C+T2/8+'M( PIC 4%E&. P2OC(-,2( -IVISIO+.
(4(C CICS .'+-5( CO+-ITIO+ P6MI-(22%P2O68+OT8FO,+-& (+-8(4(C. (4(C CICS 5O'P2O62'M%MC+T2/TB5B& S(T%C+T2/B58PT2& 5(+6T.%TB585(+& (+-8(4(C. S(2VIC( 2(5O'- C(+T2/B58-'T' MOV( C+T2/8CO-(%1& TO 8888888888. MOV( C+T2/8+'M(%1& TO 8888888888. QQQQQ
128
2Becution <esults /fter the completion of the 4O/. command and the S82>IC8 284O/. statementE the C;T29TB4 ta-le 6ill -e loaded and the $2O<1 pro%ram could refer the ta-le The len%th of the C;T29TB4 ta-le 6ill -e placed in TB4148;.
Common 2Bce+tional Con&itions ;OT/?TH 2esource security chec) has failed $<&I.822 $ro%ram specified in not found Im+ro)ement by VS CO'O3 II 1. $/2&14IST in the 4in)a%e Section is not re=uired 2. The 4O/. command must ha3e the special 6ord /..28SS for pointin% the address of the field specified in the 4in)a%e SectionE as follo6sC 8@8C CICS 4O/. $2O<2/&'YC;T29TB4B( S8T'/..28SS O" C8;T29TB41./T/( 48;<TH'TB4148;( 8;.18@8C. 3. The S82>IC8 284O/. statement is not re=uired.
<232(S2 Comman&
.unction The 2848/S8 command is used to release a pro%ram 'or ta-le(E 6hich has -een loaded pre3iously. .ormat
(4(C CICS 2(5('S( P2O62'M%name& (+-8(4(C. (.g. 1D.1": Format o* 2(5('S( Comman
12,
Common 2Bce+tional Con&itions ;OT/?TH 2esource security chec) has failed. $<&I.822 $ro%ram specified is not found.
13
CICS Transactions
There are total appro:imate 22 CICS transactions a3aila-le. "ollo6in% is the list of fe6C CSS;C Si%n1On C8B2C Temporary Stora%e Bro6se C8CIC Command 4e3el Interface C8."C 8:ecution .ia%nostic "acility C8&TC &aster Terminal Transaction C8./C 2esource .efinition Online CSS"C Si%n1Off
CSSC
8na-les CICS to associate user 6ith the terminal ;ame and pass6ord should -e defined in the Si%no; Ta-le 'S;T(.
C2'<
The Temporary Stora%e Bro6se 'C8B2( is a CICS1supplied transactionE 6hich -ro6ses Temporary Stora%e 0ueue 'TS0(. It is a 3ery con3enient tool if you 6ish to display the content of TS0 6hen you are monitorin% an application pro%ram throu%h 8.". In3o)in% C8B2 is simple. 9ou type C8B2 and press the 8;T82 )ey. The C8B2 initial screen 6ill -e displayed. ThenE you typeC 0?8?8 :::::::: Ahere :::::::: is the =ueue id of TS0 to -e -ro6sed. /fter pressin% 8;T82 )eyE the content of the TS0 6ill -e displayed.
C2CI
The Command 4e3el Interpreter 'C8CI( is a CICS1supplied transaction 6hich performs synta: chec)in% of a CICS command. If the synta: is satisfiedE it 6ill actually e:ecute the command. This may -e useful for interacti3e patchin% into the application system. C8CS Dust chec)s the synta:.
131
C2/T
The C8&T '8nhanced &aster Terminal( transaction is a CICS supplied transactionE 6hich manipulates the CICS en3ironmentE such as transactionsE pro%ramsE filesE TS0sE and tas)s. It is a menu1dri3en and easy1to1use transactionE -ut due to its nature of manipulatin% the CICS en3ironmentE it is usually a restricted transaction 6hich an application pro%rammer or the end1users cannot use freelyE But helps application pro%rammers for pro%ram testin%E monitorin%E and7or trou-le shootin%. /a5or .unctions The C8&T transaction performs the follo6in% maDor functionsC I;0?I28C To in=uire a-out the status of CICS en3ironments. S8TC To update the status of CICS en3ironments $82"O2&C "or further system operations.
CSS.
Si%n1off Transaction Brea)s the connection to CICS Sends the messa%e to messa%e lo% Arites si%n1off messa%e to terminal
132
(++en&iB,(
(ssi*nment 1
Create follo6in% &apsC 1Q &enu Screen Customer Information System Hindustan $3t. 4td. .ateC ,,7,,7,,
8nter >alid ChoiceC VVVVVVV &essa%eC VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Operator &essa%eC 2nter1$rocessE .1018:itE .!12efresh 2Q *ey Screen Customer Information System Hindustan $3t. 4td. .ateC ,,7,,7,,
8nter Customer codeC VVVVVVV &essa%eC VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Operator &essa%eC 2nter1$rocessE .101&enuE .!12efresh
133
/o&ification4In-uiry4Data,entry Customer CodeC VVVVVVVVVVVVVVVVVV ;ameC /ddressC CityC Mip1codeC VVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVV
&essa%eC VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Operator &essa%eC GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG ?se follo6in% names for maps and mapsetsC Screen &enu *ey .etail /a+ Came menumap )eymap detmap /a+set Came menumap )eymap detmap
(ssi*nment 2
1Q Code the sample pro%ram %i3en to you. 2Q .e-u% it usin% /nimator. 3Q Chec) the pseudo1con3ersational lo%ic.
13!
(ssi*nment 3
1Q .isplay current date and time. "irst pro%ram 6ill display follo6in% screenO.
D(T2 D TI/2 D &8SS/<8 C .2L$2OC8SS .10L8@IT .!L28"28SH Ahen user 6ill press "2 /I. )ey the control should pass to second pro%ram usin% 4I;*. Called pro%ram should %et the dateE time and format it. Then first pro%ram should display the date 5 time 3alue. If user presses "1 /I. )eyE session should %et terminated. If user presses "# /I. )eyE screen should %et refreshed. If any other )ey is pressedE display the appropriate error messa%e.
(ssi*nment
1Q Arite a $ro%ram for Customer "ile &aintenance &odule. /ccept the choice from the &8;? pro%ramE and pass control to the &/I;T pro%ram 6hich is %oin% to perform follo6in% functionsC /.. &O.I"9 .848T8 &/I;T pro%ram 6ill ta)e the C?STVCO.8 as an input. If customer is not present in the data fileE 6ill perform /.. routine. If customer is presentE then it 6ill perform &O.I"97.848T8 routine. /fter performin% the /..7&O.I"97.848T8 control should return -ac) to the *89 mapE displayin% appropriate messa%e. 13#
In the case of record not e:istin% in the fileE display follo6in% Operator &essa%e in the .8T/I4 screen. .21/..E .31*891SC288;E .!128"28SHE ."1&8;?1SC288;
In the case of record e:istin% in the fileE display follo6in% Operator &essa%e in the .8T/I4 screen. .21&O.I"9E .31.848T8E . 1*891SC288;E .!128"28SHE ."1&8;?1SC288;
"or any mapE if user presses 6ron% )eyE then display I;>/4I. *89 messa%e into error1messa%e -o:. &a)e use of C/1$2OC8SS1SA to determine 6hether to process *89 mapE /.. map or &O.I"9 map. ?se 8IB/I. to chec) for the /I. )ey pressed. &a)e use of sections 6hile 6ritin% pro%ram code. '/lso 6rite 8@IT para%raph in e3ery section to come out of it(. $erform all necessary fields 3alidations -efore proceedin% further.
(ssi*nment !
1Q Arite a $ro%ram for Customer In=uiry &odule. .isplay the .8T/I4 screen after user selects the I;0?I29 option from the menu. ?ser is allo6ed to enter specific C?ST1CO.8 or can %o for 3arious /I. )eys "ollo6in% )eys are pro3ided to the user to perform an in=uiryC 8;T821$2OC8SS "11"I2ST "214/ST "31$28>IO?S "!1;8@T "#128"28SH "61&8;?
136
(ssi*nment "
?se TS0 in the &O.I"9 routine to determine 6hether record has -een chan%ed durin% the current tas)Bs pseudo1con3ersational cycle. "or this use the follo6in% procedureC 28/. the record for specified customer code If record is found. Store it in a TS0. Send the .8T/I4 map to perform &O.I"9 or .848T8 routine. /fter this I7OE a%ain read the record 6ith ?$./T8 option and no6 compare this recordE 6hich is readE and the oneE 6hich is there in the TS0. If -oth are sameE it implies that no other tas) has modified that record. So continue processin%. If the comparison failsE then display the messa%e H2ecord has already -een modified -y someone. 8nter the chan%es a%ainI.
9eneral 9ui&elinesD Chec) for 8IBC/48;L for in3alid entry to I;0?I29 and &/I;T8;/;C8 pro%ram. 'The entry should -e al6ays from &8;? pro%ram(. Chec) the C/1$2OC8SS1SA in the main section to -ranch out to different sections. ?se H<O TOI to ta)e control to the 8@IT para%raph in the section. 'Code 8@IT at the end of e3ery section( Code CICS command and the associated H/;.48 CO;.ITIO; in the same section. /ll 6or)in%1stora%e 3aria-les must -e initialiGed. 8ach section must -e preceded 6ith proper documentation.
13+
(++en&iB,'
Sam+le CO'O3,CICS 1ro*ram
ID2CTI.IC(TIOC DIVISIOC. $2O<2/&1I.. &8;?. 2CVI<OC/2CT DIVISIOC. D(T( DIVISIOC. AO2*I;<1STO2/<8 S8CTIO;. 1 AS1SAITCH8S. # AS18;.1S8SSIO; $IC @' 1( >/4?8 R;R. 88 8818;.1S8SSIO; >/4?8 R9R. T 1 AS18;.1S8SSIO;1&8SS/<8 $IC @'# ( >/4?8 S$/C8S. 1 AS1$<&1;/&8 $IC @' 8( >/4?8 S$/C8S. 1 AS1./T8 $IC S,'1#( CO&$13 >/4?8 M82OS. T 1 AS1>/4I.1./T/ $IC @' 1( >/4?8 R9R. 88 881>/4I.1./T/ >/4?8 R;R. T 1 AS1CO&&1/28/. # C/1$2OC8SS1SA $IC @' 1( >/4?8 R1R. # C/1$2O<2/&1;/&8 $IC @' 8( >/4?8 S$/C8S. # C/1./T8 $IC @' 8( >/4?8 S$/C8S. T CO$9 &8;?&/$. CO$9 BOO*S. T 4I;*/<8 S8CTIO;. T 1 ."HCO&&/28/ $IC @'1+(. TT 1<OC2D:<2 DIVISIOC. T 0000,/(IC S2CTIOC. &O>8 4OA1>/4?8S TO &8;?&/$I. I" 8IBC/48; L $82"O2& 1 1"I2ST1TI&8 84S8 &O>8 ."HCO&&/28/ TO AS1CO&&1/28/ $82"O2& 2 1S?BS80?8;T. T I" 8818;.1S8SSIO; 8@8C CICS S8;. T8@T "2O& 'AS18;.1S8SSIO;1&8SS/<8( 48;<TH'# ( 82/S8 "288*B 8;.18@8C 8@8C CICS 28T?2; 8;.18@8C 84S8 8@8C CICS 28T?2; T2/;SI.'RT1R( CO&&/28/'AS1CO&&1/28/( 48;<TH'1+( 8;.18@8C. 18@IT.
138
13,
1!
1!1
(++en&iB,C
'iblio*ra+hy
1. 2. 3. !. #. CICS for COBO4 $ro%rammers '$art 1( By .ou% 4o6e CICS for COBO4 $ro%rammers '$art 2( By .ou% 4o6e CICS a Ho6 To "or COBO4 $ro%rammer IB& Independent Study $ro%ram IB& /pplication $ro%rammers 2eference &anual
1!2
(++en&iB,D
Table Of .i*ures
Ta-le 1.1C Batch System >s Online System....................................................................................6 "i%. 1.1C CICS System Components..............................................................................................13 "i%.2.1C Terminal Control $ro%ram &ana%ement &odule............................................................1# 8%.3.1C "ormat of B&S macros....................................................................................................2! 8%.3.2C 8:ample of B&S macros..................................................................................................2! 8%.3.3C B&S &acro .efinition.....................................................................................................26 8%.3.!C "ormat of ."H&S. &acro.............................................................................................26 8%.3.#C "ormat of ."H&.I &acro..............................................................................................28 8%.3.6C "ormat of ."H&." &acro.............................................................................................28 8%.3.+C 8:ample Of Sym-olic &ap .efinition.............................................................................31 "i%.!.1C 0uasi12eentrant $ro%ram................................................................................................33 "i%.#.1C Command 4e3el Translator.............................................................................................38 8%. #.1C ."HCO&&/28/ ?sa%e...............................................................................................! 8%.6.1C ."H&SC/ Constants.....................................................................................................!2 8%.6.2C Installation .efined /ttri-ute Constants..........................................................................!3 8%.6.3C Installation .efined &essa%e "ile...................................................................................!3 8%.6.!C ?sin% /I. Information In /pplication $ro%ram.............................................................!! 8%.+.1C "ormat Of H/;.48 CO;.ITIO; Command................................................................!6 8%.+.2C 8:ample Of H/;.48 CO;.ITIO; Command............................................................!+ 8%.+.3C "ormat Of I<;O28 CO;.ITIO; Command.................................................................!+ 8%.+.!C 8:ample Of I<;O28 CO;.ITIO; Command..............................................................!8 8%.+.#C "ormat Of ;OH/;.48 .................................................................................................!8 8%.+.6C 8:ample Of 28S$E ;OH/;.48....................................................................................!, 8%.+.+C "ormat Of H/;.48 /I. Command...............................................................................!, 8%.+.8C 8:ample Of H/;.48 /I. Command............................................................................#1 8%.+.,C .isad3anta%e Of H/;.48 /I. Command.....................................................................#1 8.%. 8.1C .ynamically attri-ute 3alue assi%nment.........................................................................#! 8.%. 8.2C Static Cursor $ositionin%................................................................................................#! 8.%. 8.3C Sym-olic Cursor $ositionin%..........................................................................................## 8.%. 8.!C 2elati3e Cursor $ositionin%............................................................................................## "i%.,.1C Concept of B&S operations.............................................................................................#6 8.%. ,.2C "ormat Of 28C8I>8 &/$ Command...........................................................................#+ 8%.,.3C "ormat Of S8;. Command...........................................................................................#, 8%.,.!C 8:ample Of S8;. Command..........................................................................................61 8%.,.#C "ormat Of 28C8I>8 Command......................................................................................62 8%.,.6C 8:ample Of 28C8I>8 Command...................................................................................62 8%.,.+C "ormat Of S8;. T8@T Command.................................................................................6! 8%.,.8C 8:ample Of S8;. T8@T Command...............................................................................6! 8%.1 .1C "ormat Of /S*TI&8 Command...................................................................................6# 8%.1 .2C "ormat Of "O2&/TTI&8 Command...........................................................................66 8.%.11.1C "ormat Of 28T?2; Command....................................................................................68 "i%.11.1C 4I;* command.............................................................................................................68
1!3
1!!
1!#