Top Banner
Control Operations Day 5
19

Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

Jan 12, 2016

Download

Documents

Gwenda Harris
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

Control OperationsDay 5

Page 2: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

2Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

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

Page 3: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

3Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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 taskENQ

RESOURCE (data-area)

[LENGTH (data-value)]

[NOSUSPEND]

Conditions: ENQBUSY, LENGERR

DEQ RESOURCE (data-area)

[LENGTH (data-value)]

Conditions: LENGERR

Page 4: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

4Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Program Control Commands• XCTL

• LINK

• RETURN

• ABEND

• LOAD

• RELEASE

Page 5: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

5Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Logic Levels

CICS

PGM ALINK BRETURN

PGM CLINK DRETURN

PGM BXCTL C

PGM DRETURN

LEVEL 0

LEVEL 1

LEVEL 2

LEVEL 3

CICS

PGM ALINK BRETURN

PGM CLINK DRETURN

PGM BXCTL C

PGM DRETURN

LEVEL 0

LEVEL 1

LEVEL 2

LEVEL 3

Page 6: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

6Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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.

Page 7: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

7Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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.

Page 8: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

8Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

XCTL Vs LINK• XCTL does not expect

control back.• Handle conditions in the

main program are not available to the called program. Establish new handle conditions.

• LINK expects control back.

• Handle conditions in the calling program are needed again. Hence use PUSH and POP commands to restore them again.

Page 9: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

9Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

XCTL Vs LINK Continues...• XCTL does not expect

control back and hence less overhead on system resources like memory etc.

• Similar to GO TO.

• LINK expects control back and hence the overhead is more in this case on memory etc.

• Similar to perform, and control will be passed back to the instruction following this.

Page 10: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

10Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

CALL Vs XCTL/LINK• Linkedited along with

the main module.• Higher module size and

higher memory requirement.

• Single copy can not be used.

• Separately compiled and link edited.

• Single copy be shared.• Dynamic loading may

slow down execution speed.

Page 11: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

11Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

CALL Vs XCTL/LINK Continues...• Any changes in this

require compiling of all other modules using this.

• A CALLed program remains in the last used state after it returns control.

• Changes in this will not effect other modules using this.

• A LINKed or XCTLed program always brings a NEW copy.

Page 12: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

12Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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.

Page 13: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

13Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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.

Page 14: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

14Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Storage Control

• GETMAIN - to get main memory

• FREEMAIN - to release the memory acquired by GETMAIN

Page 15: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

15Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Interval Control

• ASKTIME

• FORMATTIME

• START

• CANCEL

Page 16: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

16Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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.

Page 17: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

17Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Interval Control Continues...

ASKTIME [ABSTIME (data-area)]

FORMATTIME

ABSTIME (data-value)

[YYDDD (data-area)]

[YYMMDD (data-area)]

[YYDDMM (data-area)]

[DDMMYY (data-area)]

[MMDDYY (data-area)]

[DATE (data-area)]

[DATEFORM (data-area)]

[DATESEP [(data-area)]]

[YEAR (data-area)]

[TIME (data-area)

[TIMESEP [(data-area)]]

Page 18: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

18Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 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?

Page 19: Control Operations Day 5. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/TP01/003 Version No: 1.0 Objectives Task Control –ENQUEUE/DEQUEUE –SUSPEND.

19Copyright © 2005, Infosys Technologies Ltd

ER/CORP/CRS/TP01/003 Version No: 1.0

Thank You!