Showing posts with label CA7. Show all posts
Showing posts with label CA7. Show all posts

Saturday, January 2, 2016

Invoke CA7 commands from Batch terminal - use of SASBSTR

CA7 is a product of Computer Associates and is a scheduling tool for batch jobs in mainframe. When the number of jobs to be executed are astronomical, it is difficult to manage the jobs manually. So we need a tool like CA7 to manage the same. Manipulation of jobs, predecessor and triggers are done through CA7 panels. But sometimes we need to define hundreds of jobs to CA7, it is advisable to use batch terminal to do the same. Also batch terminals are less prone to errors. Batch terminals are a set of CA7 commands in a member of a partitioned dataset which is input to a CA7 batch program and submitted using a JCL

The program which executes the CA7 commands in batch is called SASSBSTR. The list of commands are put into a member of a partitioned dataset and given as an input to the program through SYSIN DD statement in the JCL. When executing the SASSBSTR program, the SYSIN input statements are copied into the input dataset called CA7. Communication dataset informs CA7 that there are commands waiting in the input dataset. These are read and processed by CA7. Any output is written to the output dataset. When all the commands have been processed, SASSBSTR copies the contents of the output dataset to SYSPRINT. Have a look into the below diagram
CA7 commands from batch terminal


Now, lets have the JCL to execute the CA7 from batch terminal.

//@SASBSTR EXEC PGM=SASBSTR
//UCC7CMDS DD DSN=TTOS.NCA7A01.COMMDS,DISP=SHR
//SYSDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
LJOB,JOB=SJABCD7,LIST=ALL     <==  CA7 command goes here
/*
//*

All relevant information for the particular job SJABCD7 will be listed in SYSOUT since we gave SYSPRINT DD SYSOUT=*.

Check the commonly used CA7 commands in this page. We can use these commands in the SYSIN DD* statements.

Explanation of JCL:
SASSBSTR is the program which executes the batch terminal
UCC7CMDS DD statement is a communication dataset which is used to read the CA7 commands from SYSIN DD Statements into the input dataset.

The CA7 commands are embedded within the SYSIN DD statement.All valid commands can be used here. Usually the programs are written in a cataloged procedure and the batch terminal is given as an input to the program. The output can be stored in a dataset.

Wednesday, November 18, 2015

Frequently used CA7 Commands

To Define Jobs in CA7:
Each Job in CA7 must first be defined in its database; the easiest way to do this is through the command 'JOB'. Just type the command JOB or 'DB' in the CA7 Scheduler and it will show the list of available options we have to add the jobs.

Lets have look into some of the day-to-day commands which we use frequently to check the job schedules and other details.

1. LJOB,JOB=jobname,LIST=ALL
It will show you all the details of the job once you press enter.

We can use the below values with the LIST parameter
 LIST=NODD.  It will show the TRIGGERED BY JOS and SUCCESSOR jobs
 LIST=RQMT   to get the Requirement and Network connections
 LIST=SCHD    to know many sch id are assigned to a particular job using the below command
 LIST=TRIG     to know only the triggering jobs

2. Get the list of jobs in tree structure. Use the command
   FRJOB,JOB=jobname

3. Get the tree structure of the downstream job. Use the command
    FSTRUC,JOB=jobname

4.  Get the JCL in the pannel using the below command
 LJCL,JOB=jobname

5.List the active jobs using the command
LACT

6. Want to see the member names in any PDS. Use the below command
LISTDIR,DSN=pds-name

CA7 Guide for beginner's

CA7 is a product of Computer Associates and is a scheduling tool for batch jobs in mainframe.When the number of jobs to be executed is huge in number and jobs need to be executed depending on several parameters (like time dependency,  availability of data sets from other jobs, successful completion of other jobs), a tool like CA7 comes into play. 
Once a job is scheduled /triggered or manually added in CA7, it will start a process of moving through various QUEUES in CA7. CA7 will manage it until its completion.
Below is the diagram which shows in brief the lifecyle of the job inside a CA7 Scheduler.


Lets have a quick look into the Queues:
Request Queue:  When a job enters CA7, it will reside in the request queue until all its requirements have been satisfied. Examples of requirements  can be cited like :
Predecessor job
User holds
Submit time
Data set requirements

Ready Queue:  When a job's requirement have been satisfied, it will move to the ready queue. It will wait until initiators are available and any virtual resource or workload manager requirement is satisfied to enable it to execute.

Active Queue: When job can run it is moved to the active Q where it will remain whilst the job is executing within JES2. Once the job  has completed successfully on JES2 the job will be marked completed within CA7 and is removed from the active Q.

Failure list: If the job fails the it will be moved back to the requirement queue but will need correction prior to rerun. JCL errors are returned to ready Q and other failures are moved to request Q.

How to login to CA7.
Differnet systems use different methods to get into CA7. Some system allow the users to access the CA7 from ISPF menu while others use varied methods. Once we go inside the interface all remains the same.

Refer to This link for list of CA7 Commands.