INTRODUCIÓN JCL BASICO UNIDAD 4

download INTRODUCIÓN JCL BASICO UNIDAD 4

of 43

Transcript of INTRODUCIÓN JCL BASICO UNIDAD 4

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    1/43

    z/OS MVS JCL Introduction

    Copyright IBM Corp., 2000, 2004. All rights reserved.

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    2/43

    z/OS MVS JCL Introduction

    Page 2 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    UNIT Coding DD Statements

    Coding a DD Statement

    Using DDNAME in Programs

    Topics:

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    3/43

    z/OS MVS JCL Introduction

    Page 3 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    A program needs to be told which data sets to use during execution. This is accomplished by coding one or more Data Definition (DD) statements in the JCL.

    DD statements specify which data sets the program has to use during execution.

    Unit Introduction

    The characteristics of each data setappears in the DD statement not in

    the individual program.

    Unit: Coding DD Statements

    Introduction

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    4/43

    z/OS MVS JCL Introduction

    Page 4 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    At the end of this unit, you will be able to:

    Identify how to connect a DD statement to the programrequirement for input/output

    Identify the number of DD statements required for agiven program

    Understand the advantages of identifying the applicationdata set and its location at program initiation time

    Unit Objectives

    Unit: Coding DD Statements

    Introduction

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    5/43

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    6/43

    z/OS MVS JCL Introduction

    Page 6 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    At the end of this topic, you will be able to:

    Describe the scope of DD statements

    Identify the number of DD statements required for agiven program

    Explain the advantages of specifying the characteristicsof a data set in JCL

    Identify some of the commonly used keywordparameters in a DD statement and their scope

    Topic Objectives

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Introduction

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    7/43

    z/OS MVS JCL Introduction

    Page 7 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What is a DD statement?

    Each data set used or created in a job steprequires a separate DD statement.

    In the example three data sets are involved, so

    three separate DD statements are required in theJCL one for each data set.

    A program called MERGE reads a particular data set (DATASET1).

    Defining a DD statement

    Continued

    DD

    JOB

    MERGE

    1 0 0 1

    DATASET1

    DATASET2

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    8/43

    z/OS MVS JCL Introduction

    Page 8 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    During the course of the execution, this dataset receives updates from the second dataset (DATASET2).

    Defining a DD statement (contd)

    Continued

    DD

    JOB

    1 0 0 1

    DATASET1

    DATASET2

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    9/43

    z/OS MVS JCL Introduction

    Page 9 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The result of this update creates a new dataset (DATASET3).

    Defining a DD statement (contd)

    DD

    JOB

    1 0 0 1

    DATASET1

    DATASET2

    DATASET3

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    10/43

    z/OS MVS JCL Introduction

    Page 10 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    If the program also prints an output listing afourth DD statement must be coded into theaccompanying JCL.

    This one is for the SYSOUT data set that isspooled and eventually printed.

    DD statements - SYSOUT

    DD

    JOB DATASET1

    DATASET2

    DATASET3

    1 0 0 1

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    11/43

    z/OS MVS JCL Introduction

    Page 11 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The system accesses a member of a private library in order to run a program, then sendsthe output to a printer. How many DD statements would the JCL for the job contain?

    A. Three

    B. None

    C. One

    D. Two

    Are We on Track?

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Review

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    12/43

    z/OS MVS JCL Introduction

    Page 12 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The syntax used for coding a DD statement in theJCL is:

    //ddname DD parameter(s)

    What are the functions of a DD statement?

    The DD statement identifies the basic informationabout a data set including:

    DDNAME used by the program toreference a data set

    The data set name

    The location of the data set

    The manner in which data set should beaccessed

    The DD statement syntax

    DD

    JOB DATASET1

    DATASET2

    DATASET3

    1 0 0 1

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    13/43

    z/OS MVS JCL Introduction

    Page 13 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    Code a DD statement using the following information:

    The DDNAME is DD1 and parameter is DSN=WEEKLY

    //JOB1 JOB 255,SMITH

    //STEP1 EXEC PGM=PAYROLL

    Are We on Track?

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Review

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    14/43

    z/OS MVS JCL Introduction

    Page 14 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The PAYROLL program might specify aDDNAME

    of PAY for the weekly payroll data set. Theprogram uses DDNAME PAY to point to the dataset for input to the payroll program.

    If the payroll data set for that week isWEEKPAY1, then the JCL might appear as

    //MYJOB JOB

    //STEP1 EXEC PGM=PAYROLL

    //PAY DD DSN=WEEKPAY1

    DD Statement An Example

    DD

    JOB

    PAYROLL

    WEEKPAY1

    1 0 0 1

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    15/43

    z/OS MVS JCL Introduction

    Page 15 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The following week, the payroll data set isWEEKPAY2. The program can use the sameDDNAME (PAY), the JCL has to refer to theWEEKPAY2 data set like this

    //MYJOB JOB

    //STEP1 EXEC PGM=PAYROLL//PAY DD DSN=WEEKPAY2

    DD Statement An Example

    DD

    JOB

    PAYROLL

    WEEKPAY2

    1 0 0 1

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    16/43

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    17/43

    z/OS MVS JCL Introduction

    Page 17 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The characteristics of DD Statement Parametersare:

    Adding parameters in the DD statementallows us to specify the characteristicsof a data set

    DD statement parameters can be codedin any order as they are keywordparameters

    DD Statement Parameters

    //DDNAME DD parameter(s)

    DSN

    DISP

    UNIT

    VOL

    SPACE

    LABEL

    DCB

    SYSOUT

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    18/43

    z/OS MVS JCL Introduction

    Page 18 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the DSNparameter?

    The characteristics of the DSN Parameter are:

    The Data Set Name (DSN) parameter specifies the name of the data set

    Data sets are either temporary or non-temporary

    DD Statement Parameters - DSN

    //DATA1 DD DSN=FIRST

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    19/43

    z/OS MVS JCL Introduction

    Page 19 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The characteristics of a temporary data set are:

    Temporary data set is used for storage within the life cycle of the job

    Naming a temporary data set is optional

    Temporary data set names can be coded either by including two ampersands (&&) before thename or by leaving out the DSN parameter

    The syntax used in coding temporary data sets is:

    //DATA1 DD DSN=&&FIRST

    or

    //DATA1 DD (all needed parameters except DSN parameter)

    When the DSN parameter is omittedthe system assigns a unique name.

    Temporary Data Sets

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    20/43

    z/OS MVS JCL Introduction

    Page 20 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    The characteristics of non-temporary data sets are:

    Non-temporary data sets can be saved and reused after the job has completed

    Non-temporary data sets must be given a data set name

    The syntax used in coding non-temporary data sets is:

    //DATA2 DD DSN=SECOND

    Non-Temporary Data Sets

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    21/43

    z/OS MVS JCL Introduction

    Page 21 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the DISPparameter?

    The data set disposition parameter (DISP)specifies the current status of a data set and tellsthe system which method to use for handling the

    data set after the job step terminates.

    The current status of a data set can be: Old New Shared

    The method of handling a data set after termination can be:

    Delete Keep Catalog

    DD Statement Parameters - DISP

    //DATA1 DD DSN=FIRST,// DISP=(NEW,CATLG)

    //DATA2 DD DSN=SECOND,// DISP=(OLD)

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    22/43

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    23/43

    z/OS MVS JCL Introduction

    Page 23 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the VOLparameter?

    The Volume (VOL) parameter is used to indicatethe specific media volume a tape data set has toaccess.

    A media volume might be a specific tape volumenamed ACCT01 or specific disk pack namedTSO001.

    DD Statement Parameters - VOL

    A media on a storage device such as atape reel or a Direct Access StorageDevice (Disk unit) is called a volume.

    //INPUT DD DSN=MYTAPE,// UNIT=TAPE,// VOL=SER=ACT001

    //INPUT DD DSN=ABC,

    // UNIT=DISK,// VOL=SER=TSO001

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    24/43

    z/OS MVS JCL Introduction

    Page 24 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the SPACEparameter?

    By using the SPACE parameter the requiredamount of space for a data set can be allocated.

    The characteristics of the SPACE parameter are:

    Coding the SPACE specifies how muchroom on a DASD volume the systemshould allocate to the new data set

    The space can be reserved by

    specifying a number of blocks, tracks or cylinders

    DD Statement Parameters - SPACE

    //DATA1 DD DSN=FIRST,// DISP=(NEW,CATLG),// UNIT=SYSDA,// SPACE=(100,(10,20))

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    25/43

    z/OS MVS JCL Introduction

    Page 25 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the LABELparameter?

    The label parameter indicates the type of volumelabels on a tape or DASD (Direct Access StorageDevice) data set, and the expiration date or the

    retention period.

    It also specifies whether or not volume is writeprotected.

    DD Statement Parameters - LABEL

    //DATA1 DD LABEL=RETPD=30

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    26/43

    z/OS MVS JCL Introduction

    Page 26 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the DCBparameter?

    The Data Control Block (DCB) parameter is usedduring execution to complete information in theprogram's data control block for a data set.

    The DCB parameter identifies the type, blocksize,

    and length of records in a data set.

    DD Statement Parameters - DCB

    //DATA1 DD DCB=(RECFM=FB,// LRECL=80,BLKSIZE=6400)

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    27/43

    z/OS MVS JCL Introduction

    Page 27 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What are the characteristics of the SYSOUTparameter?

    The output stream, or SYSOUT data set, is thedata set that contains the results of a job to beprinted.

    The SYSOUT parameter specifies a systemoutput data set and its output class.

    The DD statement routes the output to a printer of

    the specified output class.

    The output class can be any alphanumericcharacter (A-Z, 0-9) or an asterisk.

    DD Statement Parameters - SYSOUT

    The asterisk tells the system to usethe same class as the MSGCLASSparameter in the JOB statement.

    //DATA1 DD SYSOUT=A

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    28/43

    z/OS MVS JCL Introduction

    Page 28 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.Review

    Match the DD statement parameters with their descriptions.

    1. UNIT A. The tape reel or disk pack on which a data set is stored

    2. DSN B. The current status and step termination status of the data set

    3. VOL C. The type of hardware device used to store or access the data set

    4. DISP D. The data set name

    Are We on Track?

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Review

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    29/43

    z/OS MVS JCL Introduction

    Page 29 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.Review

    The ________ parameter in a DD statement routes the output to a printer based on theoutput class indicated.

    Are We on Track?

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Review

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    30/43

    z/OS MVS JCL Introduction

    Page 30 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    Volume A DASD device like hard disk or the media like a tape reel.

    Glossary

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Glossary

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    31/43

    z/OS MVS JCL Introduction

    Page 31 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.Introduction

    Now that you have completed this topic, you should be able to:

    Describe the scope of DD statements

    Identify the number of DD statements required for agiven program

    Explain the advantages of specifying the characteristicsof a data set in JCL

    Identify some of the commonly used keywordparameters on a DD statement and their scope

    Topic Summary

    Unit: Coding DD Statements Topic : Coding a DD Statement

    Summary

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    32/43

    z/OS MVS JCL Introduction

    Page 32 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    UNIT Coding DD Statements

    Coding a DD Statement

    Using DDNAME in Programs

    Topics:

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    33/43

    z/OS MVS JCL Introduction

    Page 33 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    At the end of this topic, you will be able to:

    Code a DDNAME in a program

    Discuss the applications of Storage ManagementSubsystem (SMS) in managing data sets

    Topic Objectives

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Introduction

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    34/43

    z/OS MVS JCL Introduction

    Page 34 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    How do we code DDNAME in programs?

    The format for coding a DDNAME in a programdepends on the language in which the program iswritten.

    The way the DDNAME is coded is different inCOBOL, PL/1, and Assembler. In the example

    theDDNAME used is DD1.

    Using DDNAME in Programs

    SELECT FILEIN ASSIGN TO DD1...

    READ FILE(DD1)

    FILEIN DCB DDNAME=DD1,...

    COBOL

    PL/1

    Assembler

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    35/43

    z/OS MVS JCL Introduction

    Page 35 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    How do we code the DDNAME in COBOL?

    The ASSIGN clause in the Environment Divisionof the COBOL program identifies the DDNAMEthat must be used in the DD statement.

    COBOL DDNAME Definition

    SELECT FILEIN ASSIGN TO DD1...

    COBOL

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    36/43

    z/OS MVS JCL Introduction

    Page 36 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    How do we code the DDNAME in PL/1?

    In PL/1 programs, the READ statement indicatesthe DDNAME.

    PL/I DDNAME Definition

    READ FILE(DD1)

    PL/1

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    37/43

    z/OS MVS JCL Introduction

    Page 37 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    How do we code the DDNAME in Assembler?

    In an Assembler program, the DDNAME isindicated as a keyword parameter of the DCBmacro.

    Assembler DDNAME Definition

    FILEIN DCB DDNAME=DD1,...

    Assembler

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

    d

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    38/43

    z/OS MVS JCL Introduction

    Page 38 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    What is a SMS?

    A Storage Management Subsystem (SMS) maybe an optional facility at the installation. Wheninstalled and active, the SMS manages many

    data

    sets within the installation.

    If the SMS is active, the storage administrator atthe installation decides which data sets itmanages.

    SMS Considerations

    Continued

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    39/43

    /OS MVS JCL I d i

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    40/43

    z/OS MVS JCL Introduction

    Page 40 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    How does SMS affect the JCL?

    In general existing JCL continues to performcorrectly with SMS installed and activated. SMSprovides the benefit of data class, managementclass and storage class constructs without

    necessarily changing existing JCL.

    Installation-defined Automatic Class Selection(ACS) routines can be used to select appropriatecharacteristics for data sets, eliminating thenecessity of coding some JCL parameters.

    SMS Considerations (contd)

    //SMSDS DD DSN=DATA.LIST// DISP=(NEW,KEEP)

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Concepts

    /OS MVS JCL I t d ti

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    41/43

    z/OS MVS JCL Introduction

    Page 41 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    Automatic Class Selection (ACS) A set of routines that assign classes to data, based on itsrequirements and attributes and select the target storagegroup.

    Partitioned Data Set (PDS) It is a data set on direct access storage that is divided intopartitions, called members, each of which can contain a

    program, part of the program, or data.

    Partitioned Data Set Extended (PDSE) It is a system managed data set that contains an indexeddirectory and members that are similar to the directoryand members or partitioned data sets.

    Storage Management Subsystem (SMS) It is a DFSMS/MVS facility used to automate and centralizethe management of storage.

    Virtual Storage Access Method (VSAM) It is an access method for direct or sequential processing of fixed and variable-length records on direct access devices.

    Glossary

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Glossary

    /OS MVS JCL I t d ti

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    42/43

    z/OS MVS JCL Introduction

    Page 42 of 43 Copyright IBM Corp., 2000, 2004. All rights reserved.

    Now that you have completed this topic, you should be able to:

    Code a DDNAME in a program

    Discuss the applications of Storage ManagementSubsystem (SMS) in managing data sets

    Topic Summary

    Unit: Coding DD Statements Topic : Using DDNAME in Programs

    Summary

  • 7/30/2019 INTRODUCIN JCL BASICO UNIDAD 4

    43/43