Sunday 13 January 2019

SDSF

SDSF means System Display and Search Facility

It is a utility that allows user to monitor, control or view the output of jobs in the system.

It is a component of IBM's mainframe operating system, z/OS.

Once the job is submitted, it is common to use SDSF to check the status of the job like completed/running/failed...

To start using SDSF, 

type SDSF;ST or S;ST on the start window/command line

ST :Displays current status of all the jobs

Following are the most commonly used SDSF options:

DA : Displays Active/currently running jobs

I : Input Queue - Shows jobs waiting for execution 

H : Jobs on HOLD - either waiting to be released into input or output.

PR : Displays printers

INIT : Displays initiators (areas where jobs execute or run)

On the ST panel, SDSF supports following options for each batch Job. The user should type the desired option against the job and press enter to see the result

C : Cancel the job

S : Select the job (view only)

SJ : Show Job (View the original JCL of the job) - In this mode, you can edit the JCL as you required and SUBmit it in case of failures.

P : Purge job (Remove the job)

SE : Select Edit job (view in edit mode) 

XDC : Writes the spool content of the job into a data set. The data set name should be provided in the dialog window that gets popped up after pressing enter.

Following operations can be performed on SDSF panel. The desired command should be provided in "COMMAND INPUT" and press enter 

OWNER * - Displays all the jobs submitted by the owner if any.

OWNER ABC* - Filter jobs with owner name starting with ABC

PRE XYZ* - Filter jobs starting with XYZ.
PRE represents PREFIX

PRE AB%%PQ - Filter jobs starting with AB and ends with PQ

WHO - Provides basic information about SDSF user

SET CONFIRMATION ON/OFF - This command will enable/disable the confirmation for any action like P(Purge), C(Cancel)….

In SDSF, we can purge multiple jobs at a time using Block //. The jobs to purge should be in sequence to perform the same.
How - Say I have jobs JOB1, JOB2, JOB3, JOB4, JOB5 in SDSF. To purge JOB3, JOB4 and JOB5 at a time, Type //p against JOB3 and // against JOB5 and press enter.


Friday 4 January 2019

IEBEDIT(Edit Job stream) Utility:

1. It is used to run selected job step(s) in particular JCL.

Ex. I have a JCL with 10 steps and wanted to run only STEP10, 


//IEBEDITX JOB (MVSQuest),'IEBEDIT TEST',
//            CLASS=N,MSGCLASS=H,NOTIFY=7SYSUID
//*
//SUBMIT   EXEC PGM=IEBEDIT
//SYSUT1   DD DSN=USERID.TEST.JCL(JCLINP),DISP=SHR
//SYSUT2   DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
 EDIT START=JOBA,TYPE=INCLUDE,STEPNAME=(STEP10)
//*

JCLINP contains 10 steps

START => specifies job name of JCLINP

TYPE=INCLUDE => runs only those steps specified in STEPNAME

If TYPE=EXCLUDE, it runs all the steps except for the one specified in STEPNAME

If i want to run step09 and step10, then

EDIT START=JOBA,TYPE=INCLUDE,STEPNAME=(STEP09,STEP10)

2. Copies the complete job including all its steps to the output data set
    
    EDIT START=JOBA

3. Copies different steps from different jobs to output data set
    
    Example: If i have 3 jobs (JOBA, JOBB,JOBC)  in input dataset and wanted to copy different steps from all the 3 jobs

EDIT START=JOBA,TYPE=INCLUDE,STEPNAME=(STEPC,STEPD)
EDIT START=JOBB,TYPE=INCLUDE,STEPNAME=STEPE
EDIT START=JOBC,TYPE=INCLUDE,STEPNAME=STEPJ   

Points to remember:


Instream procedure should be defined before EXEC statement.

Example:

//INSTPROC  PROC
//    statements
//    ----
//    ----
//          PEND
//STEP01 EXEC PGM=pgm1
//FILE1  DD DSN=file-name
//STEP02 DD INSTPROC
//STEP03 DD INSTPROC

Cataloged Procedure:

Cataloged procedures will be stored in separate PDS. This PDS name should be specified in JCLLIB ORDER. If the procedure is not found in the specified library, then SYS1.PROCLIB will be checked.

We can add/modify the parmeters in steps of Cataloged procedure without even changing it. 

Ex. I have a cataloged proc name MYPROC and wanted to add Region parameter to STEP02 in that
proc, i can code like below in corresponding JCL

//MYSTEP EXEC MYPROC, REGION.STEP10=56K

To apply region parameter for all the steps in MYPROC

//MYSTEP EXEC MYPROC, REGION=56K

To nullify a parameter of a particular step in MYPROC, override the same through JCL and just don't give any value like below

//MYSTEP EXEC MYPROC, TIME.STEP10=

- The DSN and UNIT parameters must be coded for new generation data sets.





Thursday 3 January 2019

VSAM Intro

VSAM - Virtual Storage Access Method

A VSAM cluster is a logical definition for a VSAM data set and has one or two components. viz.,
Index component - Contains pointers to all data records to access them
Data component - Contains actual records


VSAM commands:

All the following operations (including CREATE and DELETE) should be done through IDCAMS utility.

ALTER - To modify the attributes of VSAM file.
REPRO - To load the data into VSAM data set (from sequential file to VSAM file), to copy the data from one VSAM file to another VSAM file.
LISTCAT - To get the catalog information of a VSAM dataset like dataset attributes, allocation information, volume information...  
EXAMINE - Checks the structural integrity of a given KSDS cluster. It checks index and data components and reports if there are any issues.
VERIFY - Checks and fix VSAM files which are not closed properly after an error

An Alternate Index provides access to records using more than one key. The key of an alternate Index can be a unique/non-unique key. We define alternate index for a given VSAM cluster.