MVS (Day 2). Copyright © 2005, Infosys Technologies Ltd 2 ER/CORP/CRS/OS01/003 Version No: 1.0...

52
MVS (Day 2)

Transcript of MVS (Day 2). Copyright © 2005, Infosys Technologies Ltd 2 ER/CORP/CRS/OS01/003 Version No: 1.0...

MVS (Day 2)

Copyright © 2005, Infosys Technologies Ltd

2 ER/CORP/CRS/OS01/003

Version No: 1.0

Agenda

• Data Management– Definition of data set and Record Formats– Describe the organization of data sets – VSAM and Non-VSAM– VSAM Performance Tuning – MVS label processing– Storage Management Subsystem

• Job Management– What is a “job” ?– How does JCL specify its processing requirements ?– Job Entry Subsystem - overall responsibility for job management.– Phases a job goes through as it is processed.– Sample output of messages & results.

Copyright © 2005, Infosys Technologies Ltd

3 ER/CORP/CRS/OS01/003

Version No: 1.0

Data sets

• A data set is mainframe term denoting a file -– With in a data set, data is organized into smaller units called records, which can be

processed individually by application programs– MVS keeps track of data through labels, catalogues and different data set

organizations

Copyright © 2005, Infosys Technologies Ltd

4 ER/CORP/CRS/OS01/003

Version No: 1.0

VARIABLE BLOCKED

1 LOGICAL1 PHYSICAL

FIXED UNBLOCKED

LOGICAL LOGICAL LOGICAL LOGICALFIXED BLOCKED

4 BBL

4 BRL

RECORDVARIABLE UNBLOCKED

UNDEFINED

Record Formats

BL RL RECORD RL RECORD…

Copyright © 2005, Infosys Technologies Ltd

5 ER/CORP/CRS/OS01/003

Version No: 1.0

BLOCK (physical record)

logical recordINTER BLOCK GAP (IBG)

All logical records are the same sizelimit 32,760.

All blocks are the same size (except the last one)limit 32,760.

Fixed Block Format

Copyright © 2005, Infosys Technologies Ltd

6 ER/CORP/CRS/OS01/003

Version No: 1.0

BLOCK

LOGICAL RECORD

LOGICAL RECORD

4 4 4 4

LOGICAL RECORD

BLOCK DESCRIPTOR WORD (4 BYTES)

INTER BLOCK GAP

4

RECORD DESCRIPTOR WORD (4 BYTES)

Logical records in a block can have different sizes.The first four bytes define the size of each record. Limit 32,756 bytes.

Blocks can have different sizes.

The first 4 bytes of each block define its size.Limit 32,760 bytes.

Variable Blocked Format

Copyright © 2005, Infosys Technologies Ltd

7 ER/CORP/CRS/OS01/003

Version No: 1.0

BLOCK BLOCK BLOCK

INTER BLOCK GAP

Blocks can be of any size up to the limit of 32,760 bytes.Logical records do not exist.

Undefined Format

Copyright © 2005, Infosys Technologies Ltd

8 ER/CORP/CRS/OS01/003

Version No: 1.0

VSAM and Non-VSAM

• Two different data management environments :– VSAM

• Virtual storage access method

• required utility called Access Method Services to create VSAM data sets.

• ESA SMS (Storage Management Services) allows creation of VSAM data sets through JCL

– Non-VSAM• Older method

• File can be created by JCL specifications

Copyright © 2005, Infosys Technologies Ltd

9 ER/CORP/CRS/OS01/003

Version No: 1.0

Non-VSAM Data Set Organizations

PHYSICALLY SEQUENTIAL

PARTITIONED (PDS)

DIRECT ACCESS

INDEXED SEQUENTIAL

NON-VSAM

Copyright © 2005, Infosys Technologies Ltd

10 ER/CORP/CRS/OS01/003

Version No: 1.0

Physical sequential (PS) data sets …

• Records stored one after another in consecutive sequence -– a data element within record can contain key value that’s used to sequence records

• Random access of data not possible

• Suitable for just about any type of I/O device

Copyright © 2005, Infosys Technologies Ltd

11 ER/CORP/CRS/OS01/003

Version No: 1.0

PHYSICALLY SEQUENTIAL DATA SETS CAN RESIDE ON ALMOST ANY STORAGE DEVICE

IT’S THE ONLY DATA SET ORGANIZATION WHICH CANEXIST ON MAGENITIC TAPE.

THIS IS THE ORGANIZATION DEFAULT, SO AN ACCESS METHOD NEED NOT BE CODED.

HOWEVER, DSORG=PS, CODED ON A DCB, WILL EXPLICITLYREQUEST AN ACCESS METHOD.

Physical Sequential

Copyright © 2005, Infosys Technologies Ltd

12 ER/CORP/CRS/OS01/003

Version No: 1.0

Partitioned data sets (PDS) …

• Divided into one or more members, each of which can be processed as if it were a separate physical sequential file.

• Each members name is stored in a directory.

• Also called a PDS or library.

• Entire library can be processed a unit.

• Widely used by MVS to store system data.

Copyright © 2005, Infosys Technologies Ltd

13 ER/CORP/CRS/OS01/003

Version No: 1.0

PDS …

Copyright © 2005, Infosys Technologies Ltd

14 ER/CORP/CRS/OS01/003

Version No: 1.0

DEPT01.........................................................LOCATION DEPT02.........................................................LOCATION DEPT03.........................................................LOCATION

DEPT01 DEPT02 DEPT03

ACCOUNTS

PDS …

Copyright © 2005, Infosys Technologies Ltd

15 ER/CORP/CRS/OS01/003

Version No: 1.0

ENTRY FORMEMBER A

ENTRY FORMEMBER B

MEMBER A

MEMBER B

PDS …

Copyright © 2005, Infosys Technologies Ltd

16 ER/CORP/CRS/OS01/003

Version No: 1.0

MEMBER NAME TTR C OPTIONAL USER DATA

TTRN TTRN TTRN

POINTER TO FIRST RECORD OF MEMBER

38 0-31MAX 62 BYTES

‘1’ IF ALIAS

NO. OF USER DATA TTRN’S

NO. OF USER DATAHALF WORDS

PDS

Copyright © 2005, Infosys Technologies Ltd

17 ER/CORP/CRS/OS01/003

Version No: 1.0

Direct data sets

• Each record can be accessed at random based on records’ disk location.

• Isn't commonly used because of programming complexities involved in calculating disk addresses.

Copyright © 2005, Infosys Technologies Ltd

18 ER/CORP/CRS/OS01/003

Version No: 1.0

Indexed sequential data sets …

• Records can be accessed sequentially & randomly using a index that relates key field values to locations of corresponding data record.

• Random access of records based on key value possible.

Copyright © 2005, Infosys Technologies Ltd

19 ER/CORP/CRS/OS01/003

Version No: 1.0

FIRST NAME LAST NAME EMPLOYEE NUMBER

THOMAS BLUESTONE 00008

WILLIAMS COLLINE 00002

RONALD GARCIA 00010

STANLEY ABBOTT 00001

EMPLOYEE DISK NAME LOCATION

00001 5

00002 2

00008 7

00010 1

INDEX COMPONENT DATA COMPONENT

Indexed Sequential data sets

Copyright © 2005, Infosys Technologies Ltd

20 ER/CORP/CRS/OS01/003

Version No: 1.0

VSAM Design Objectives

• Operating System independence

• Device independence

• Data integrity

• Data security

• File performance

Uses of VSAM

• VSAM is the choice for high performance, random access applications.

• VSAM is ideal for CICS, IMS and batch databases.

• VSAM is used for a large part of the data that MVS creates and/or uses.

Copyright © 2005, Infosys Technologies Ltd

21 ER/CORP/CRS/OS01/003

Version No: 1.0

VSAM data sets

• Entry-sequenced data set ( ESDS )– Similar to physical sequential files but can reside only on DASDs.

• Key-sequenced data set ( KSDS )– Similar to indexed sequential data set– Most common

• Relative record data set ( RRDS )– Similar to a direct data set– retrieve record by specifying its location relative to start of the file

• Linear Dataset

Copyright © 2005, Infosys Technologies Ltd

22 ER/CORP/CRS/OS01/003

Version No: 1.0

VSAM Data Set Organization

ENTRY-SEQUENCED

KEY-SEQUENCED

RELATIVE RECORD

VSAM

LINEAR RECORD

Copyright © 2005, Infosys Technologies Ltd

23 ER/CORP/CRS/OS01/003

Version No: 1.0

VSAM Performance Tuning

• Control Interval Size

• Free space

• Buffer space

Copyright © 2005, Infosys Technologies Ltd

24 ER/CORP/CRS/OS01/003

Version No: 1.0

MVS label processing

• Labels are special records in data sets used by MVS to identify data sets.

• DASD labels -– Volume labels ( VOL1 label )

• provides a volume-serial ( unique, 6 character )

• address of VTOC

– File labels

• VTOC : Special file that contains file labels of data sets on the volume

Copyright © 2005, Infosys Technologies Ltd

25 ER/CORP/CRS/OS01/003

Version No: 1.0

MVS label processing

• File labels are also called DSCBs (data set control blocks) , have several formats:

– Format 1 DSCB : gives data set name, etc.,– Format 5 DSCB : describes VTOC

• Space allocated to DASD files in areas called extents - initial primary extent, then one or more secondary extents as file grows ( records are added ).

Copyright © 2005, Infosys Technologies Ltd

26 ER/CORP/CRS/OS01/003

Version No: 1.0

MVS label processing

Copyright © 2005, Infosys Technologies Ltd

27 ER/CORP/CRS/OS01/003

Version No: 1.0

DSCB Formats

• Format 1 DSCB : primary extent and three secondary extents

• Format 3 DSCB : thirteen additional extents

• Format 5 DSCB : defines upto 26 free extents

Copyright © 2005, Infosys Technologies Ltd

28 ER/CORP/CRS/OS01/003

Version No: 1.0

MVS Catalogs

• Catalogs record location of files so that its volume-serial need not be specified to locate it.

• Master catalogs :– entries that identify system data sets &– entries that identify user catalogs

• User catalogs :– entries that identify user data sets

Copyright © 2005, Infosys Technologies Ltd

29 ER/CORP/CRS/OS01/003

Version No: 1.0

MVS Catalogs

Copyright © 2005, Infosys Technologies Ltd

30 ER/CORP/CRS/OS01/003

Version No: 1.0

VTOC

ABE.FILE1ABE.FILE2.USER.CATALOG.TST.PSTTST.SEC

ABE.FILE1 3390 111111ABE.TP1 3480 503308ABE.TP2 3480 566637ABE.TP3 3480 503984FILEX.TT 3480 900035TST.LIBA 3390 222222TST.LIBB 3390 222222

DSN UNIT VOLUME

ABE.FILE1

ABE.FILE2

USER CATALOG

TST.PST

TST.SEC

3390 VOLUME 111111

Volume Table of Contents

Copyright © 2005, Infosys Technologies Ltd

31 ER/CORP/CRS/OS01/003

Version No: 1.0

A B

A.B A.C A.D

A.C.E A.C.FA.D.G0000V00

A.D.G0001V00

Catalog Structure

Copyright © 2005, Infosys Technologies Ltd

32 ER/CORP/CRS/OS01/003

Version No: 1.0

Data set processing by MVS :

• Three distinct steps :– Allocation

• unit ( device ), volume, data set

• DISP parameter qualifies how a non-VSAM file is allocated

– Processing• Access methods used for processing

– basic, queued or VSAM

– open, I/O and close processing– Deallocation

• auto deallocate after job over

Copyright © 2005, Infosys Technologies Ltd

33 ER/CORP/CRS/OS01/003

Version No: 1.0

Storage Management subsystem :

• MVS/ESA feature, SMS is a separate software that automates storage management.

• SMS uses storage class, data class etc., to automate storage management

• Enables allocating VSAM data sets using JCL– Without SMS an AMS ( Access Method Service ) utility called IDCAMS

needs to be used for this purpose.

Copyright © 2005, Infosys Technologies Ltd

34 ER/CORP/CRS/OS01/003

Version No: 1.0

Job Management

Copyright © 2005, Infosys Technologies Ltd

35 ER/CORP/CRS/OS01/003

Version No: 1.0

Job Management

• A job is the execution of one or more related programs in sequence– Each program to be executed is a job step

• Job control language or JCL :– A set of control statements that provide the specifications necessary to process a

job.

Copyright © 2005, Infosys Technologies Ltd

36 ER/CORP/CRS/OS01/003

Version No: 1.0

The 3 Basic JCL statements

• JOB– Info that identifies a job

• EXEC– Name of program to be executed

• DD– Defines data, one per file of data referred

Copyright © 2005, Infosys Technologies Ltd

37 ER/CORP/CRS/OS01/003

Version No: 1.0

Basic format of a JCL

//SYDOEJ JOB USER=SYSDOE,PASSWORD=xxxxx

Identifier field

Name field

Operation field

Parameters field

Copyright © 2005, Infosys Technologies Ltd

38 ER/CORP/CRS/OS01/003

Version No: 1.0

Job that prints a library member

//SYDOEJ JOB USER=SYSDOE,PASSWORD=xxxxxxx// EXEC PGM=IEBGENER//SYSPRINT DD SYSOUT=A//SYSUT1 DD DSN=SYDOE.COPYLIB.COBOL(OPENITEM),// DISP=SHR//SYSUT2 DD SYSOUT=A//SYSIN DD DUMMY

( Note JCL syntax for continuing a statement on the next line. )

Copyright © 2005, Infosys Technologies Ltd

39 ER/CORP/CRS/OS01/003

Version No: 1.0

JES - Basic responsibilities

• Enter job into system.

• Decide when job is be processed.

• Pass job to MVS for processing.

• Deliver job’s printed output to correct destination.

Copyright © 2005, Infosys Technologies Ltd

40 ER/CORP/CRS/OS01/003

Version No: 1.0

How is an MVS job processed ?(JES)

1.The job is submitted.

2.The job is selected for execution.

3.The job is executed.

4.The job’s output is processed.

5.The job is purged.

Copyright © 2005, Infosys Technologies Ltd

41 ER/CORP/CRS/OS01/003

Version No: 1.0

Submitting a job

• Create JCL at terminal using an editor (ISPF).– Job stream now in a file on DASD

• Use SUBMIT command to enter job into system :– JES copies job stream into JES spool ( a special system DASD file ).

Copyright © 2005, Infosys Technologies Ltd

42 ER/CORP/CRS/OS01/003

Version No: 1.0

Scheduling for execution …

• Each initiator has one or more job classes associated with it– Can control no. of jobs of each class and combinations there-of.

• Within a class initiators select a job for execution based on priority ( 0 - 15 ).

Copyright © 2005, Infosys Technologies Ltd

43 ER/CORP/CRS/OS01/003

Version No: 1.0

Scheduling for execution …

• Job class & priority decides when a job is actually scheduled to run.

• Initiator – prog. that runs in sys region of address space eligible for batch jobs

– Examines JES spool, selects job, executes job in address space & returns to spool for next job.

• Each initiator handles one job and no. of initiators can be varied dynamically.

Copyright © 2005, Infosys Technologies Ltd

44 ER/CORP/CRS/OS01/003

Version No: 1.0

Scheduling for execution …

• A typical Job-class assignment :-

Job Class Characteristics

A Will execute within 15 mins of submissionB 30 minsC 1 hourD Will execute overnightH Will be held until released by operatorL Within 15 mins of submission; each step limited to 1 min execution timeT requires tape processing

Copyright © 2005, Infosys Technologies Ltd

45 ER/CORP/CRS/OS01/003

Version No: 1.0

Scheduling for execution

• Typical initiator-class assignment :

Initiator Eligible job classes

1 A2 B,C,D,H,L,T3 B,C,D,H,L,T4 B,C5 B,C6 C

Copyright © 2005, Infosys Technologies Ltd

46 ER/CORP/CRS/OS01/003

Version No: 1.0

Executing a job …

• Initiator selects job for exec and invokes interpreter.

• Interpreter examines job stream and creates a series of control blocks which describe all data sets required.

• Then, initiator,– invokes allocation routines– builds user region and executes job in it– invokes unallocation routines after job over.

Copyright © 2005, Infosys Technologies Ltd

47 ER/CORP/CRS/OS01/003

Version No: 1.0

Executing a job

Copyright © 2005, Infosys Technologies Ltd

48 ER/CORP/CRS/OS01/003

Version No: 1.0

Processing a job’s output

• Like jobs, SYSOUT data is also assigned to different output classes :– Class A : Std printer output, Class Z : held output, etc.,

• Single job may produce SYSOUT data using more than one output class :– Class A for system messages & program output, class D for some of job’s

spooled output.

• Specs for output like no. of copies etc.,

Copyright © 2005, Infosys Technologies Ltd

49 ER/CORP/CRS/OS01/003

Version No: 1.0

Purging a Job

• JES spool space held by job freed, after output processing has been done.

• JES control blocks associated with job deleted.

Copyright © 2005, Infosys Technologies Ltd

50 ER/CORP/CRS/OS01/003

Version No: 1.0

Alternative data set allocations :

• Job-step allocation :– allocate/deallocate on a step by step basis.

• JES3 allocation :– part of resources pre-allocated by JES3 and rest by MVS during execution.– prevents resource conflicts

• Dynamic allocation : JES2 & JES3– No allocation till request.– Mainly used during TSO sessions.

Copyright © 2005, Infosys Technologies Ltd

51 ER/CORP/CRS/OS01/003

Version No: 1.0

Summary

• Data Management– Definition of data set and Record Formats– Describe the organization of data sets – VSAM and Non-VSAM– Performance Tuning– Storage Management Subsystem

• Job Management– What is a “job” ?– How does JCL specify its processing requirements ?– Job Entry Subsystem - overall responsibility for job management.– Phases a job goes through as it is processed.– Sample output of messages & results.

Copyright © 2005, Infosys Technologies Ltd

52 ER/CORP/CRS/OS01/003

Version No: 1.0

Thank You!