Sie sind auf Seite 1von 19

Control Operations

Day 5
Objectives
• Task Control
– ENQUEUE/DEQUEUE
– SUSPEND
• Program Control
– Usage of COMMAREA in LINK, XCTL
– RETURN
– LOAD, RELEASE
• Storage Control
– GETMAIN
– FREEMAIN
• Interval Control
– ASKTIME, FORMATTIME
– START, ATI
– CANCEL, RETRIEVE
– DELAY, POST, WAIT EVENT
Copyright © 2005, Infosys 2 ER/CORP/CRS/TP01/003
Technologies Ltd Version No: 1.0
Task Control
• SUSPEND
– Suspend a task
– To relinquish control to a task of higher dispatching priority
– Control returns to the task issuing the command when there is no other
task of higher priority to be processed

• ENQ/DEQ
– Schedule the use of a resource by a task
– Protects the resource from concurrent use by more than one task
ENQ
RESOURCE (data-area) DEQ
RESOURCE (data-area)
[LENGTH (data-value)]
[LENGTH (data-value)]
[NOSUSPEND]
Conditions: LENGERR
Conditions: ENQBUSY, LENGERR

Copyright © 2005, Infosys 3 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Program Control Commands
• XCTL
• LINK
• RETURN
• ABEND
• LOAD
• RELEASE

Copyright © 2005, Infosys 4 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Logic Levels

CICS LEVEL 0

PGM A
LINK B LEVEL 1
RETURN

PGM C
PGM B LEVEL 2
LINK D
XCTL C
RETURN

PGM D
LEVEL 3
RETURN
Copyright © 2005, Infosys 5 ER/CORP/CRS/TP01/003
Technologies Ltd Version No: 1.0
XCTL
• EXAMPLE
EXEC CICS XCTL
PROGRAM (‘example3’)
COMMAREA (ws-commarea)
LENGTH (100)
END-EXEC.

• This causes control to be passed to ‘example3’,


with 100 bytes of data.

Copyright © 2005, Infosys 6 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
LINK
• EXAMPLE
EXEC CICS LINK
PROGRAM (‘example3’)
COMMAREA (ws-commarea)
LENGTH (100)
END-EXEC.

• The calling program expects control back.


• Control to example3 with 100 bytes of data.

Copyright © 2005, Infosys 7 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
XCTL Vs LINK
• XCTL does not expect • LINK expects control
control back. back.
• Handle conditions in the • Handle conditions in the
main program are not calling program are
available to the called needed again. Hence use
program. Establish new PUSH and POP
handle conditions. commands to restore
them again.

Copyright © 2005, Infosys 8 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
XCTL Vs LINK Continues...
• XCTL does not expect • LINK expects control
control back and hence back and hence the
less overhead on system overhead is more in this
resources like memory case on memory etc.
etc. • Similar to perform, and
• Similar to GO TO. control will be passed
back to the instruction
following this.

Copyright © 2005, Infosys 9 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
CALL Vs XCTL/LINK
• Linkedited along with • Separately compiled and
the main module. link edited.
• Higher module size and • Single copy be shared.
higher memory • Dynamic loading may
requirement. slow down execution
• Single copy can not be speed.
used.

Copyright © 2005, Infosys 10 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
CALL Vs XCTL/LINK Continues...
• Any changes in this • Changes in this will not
require compiling of all effect other modules
other modules using this. using this.
• A CALLed program • A LINKed or XCTLed
remains in the last used program always brings a
state after it returns NEW copy.
control.

Copyright © 2005, Infosys 11 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
RETURN
• Return, always passes control back to the
program at one logic level higher when used
without any options.
• Return with TRANSID option passes control to
another program, in pseudo-conversation mode.
• It is important to note that RETURN is not at all
a replacement for LINK or XCTL.

Copyright © 2005, Infosys 12 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
ABEND
• When a situation arises that the program can not
handle the program condition, can terminate
itself by giving an abend code to help the user.
EXEC CICS ABEND
ABCODE (‘abcd’)
END-EXEC.

Copyright © 2005, Infosys 13 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Storage Control

• GETMAIN - to get main memory


• FREEMAIN - to release the memory
acquired by GETMAIN

Copyright © 2005, Infosys 14 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Interval Control

• ASKTIME
• FORMATTIME
• START
• CANCEL

Copyright © 2005, Infosys 15 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Interval Control Continues...
• START can be used for starting a Transaction
from a remote terminal.
EXEC CICS START
TRANSID (‘TA01’)
[INTERVAL (hhmmss)/TIME (hhmmss)]
[TERMID (terminal-no)]
END-EXEC.

• CANCEL command can be used to cancel the


interval control commands given previously.

Copyright © 2005, Infosys 16 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0
Interval Control Continues...
ABSTIME (data-value)

[YYDDD (data-area)]

[YYMMDD (data-area)]

[YYDDMM (data-area)]

[DDMMYY (data-area)]
ASKTIME [ABSTIME (data-area)]
[MMDDYY (data-area)]

[DATE (data-area)]

[DATEFORM (data-area)]

[DATESEP [(data-area)]]

[YEAR (data-area)]

Copyright © 2005, Infosys 17 ER/CORP/CRS/TP01/003


[TIME (data-area) Technologies Ltd Version No: 1.0
Summary
• What are the task control statements and what
are they used for?
• What is the difference between XCTL and
LINK?
• How is CALL different from XCTL and LINK?
• Why is RETURN used?
• What are the commands for Storage control?
• How can we format the date and time from the
system?
Copyright © 2005, Infosys 18 ER/CORP/CRS/TP01/003
Technologies Ltd Version No: 1.0
Thank You!

Copyright © 2005, Infosys 19 ER/CORP/CRS/TP01/003


Technologies Ltd Version No: 1.0

Das könnte Ihnen auch gefallen