January 26, 2012 – 12:00 pm
CA11 is a utility from Computer Associates that helps to re-run a job multiple times and also to restart from abended steps, taking care of what files to be used when we rerun.
We need to specify a restart parameter that tells CA11 – how we want the job to be run. Valid parameters are nP, nR, nN and more (n = 0,1,2,3,..)
P for Production run (0P, 1P, 2P, .. nP)
- The job will execute from the first step.
- if any file with DISP=(NEW,*,*) already exist in catalogue, it will be deleted and re-created as defined in the current JCL job.
When we submit a job for first time, a parameter of ‘0P’ will be passed.
Due to any failure, if we need to run the job for a second time, and start from first step, pass a parameter ‘1P’.
If that fails again, and you need to run again from the beginning, use ‘2P’. (and so on…)
R for Restart/Rerun (1R, 2R, .. nR)
- the job will start from last abended step
- all the files, GDG file versions used in the last run of the job will be used
- After the failure of first ‘0P’ run, if we want to restart from the failed step, pass ‘1R’ as the parameter. Consecutive restart runs should have ‘2R’ ,’3R’, and so on..
N for Null (1N, 2N,.. nN)
- CA11 utility will not perform anything, and just allow your job to run.
- but for every consecutive run, you need to change the number like 0N, 1N, 2N,.. etc
Note: if you do not change the number n in the parameter you will be getting a user abend U0060 saying that the parameter was not changes since the last run. However if your job has been completed successfully and you are rerunning the job, you do not need to change the number n.
January 9, 2012 – 4:25 pm
DIRECT YES:
When we use DIRECT YES option, BMC Unload Plus utility (ADUUMAIN) reads data directly from the table space data set or image copy data set and uses a SELECT-like syntax for data selection.
We can unload all data from a table-space without requiring written SELECT statements.
The data can be sorted by clustering key or partitioning key.
DIRECT NO:
When we use DIRECT NO option, BMC Unload Plus utility uses DB2 dynamic SQL to process the SELECT statement.
Data type conversions can be performed using DIRECT NO (which is not available with DIRECT YES).
November 14, 2011 – 2:35 pm
- DIS or -Display : Display a status of tablespace (ie READ-WRITE / COPY-PENDING / CHECK-PENDING / READ ONLY)
-DIS DATABASE(dbname) SPACENAM(tbspace)
more on Display Database
Stop / Start a tablespace / indexspace:
-STOP DATABASE(dbname) SPACENAM(tbspace)
-START DATABASE(dbname) SPACENAM(tbspace) ACCESS(FORCE)
Start: publib.boulder.ibm.com/../bjncstdb999243.htm
Stop: publib.boulder.ibm.com/../bjncstod999243.htm
How to find a table’s Database name and tablespace name?
SELECT DBNAME, TSNAME FROM
SYSIBM.SYSTABLES WHERE NAME = [table name]
AND OWNER = [qualifier] ;
SELECT DBNAME, TSNAME FROM
SYSIBM.SYSTABLES WHERE NAME = 'SYSDUMMY1' AND
OWNER = 'SYSIBM';
Terminating a BMC (or any DB2) utility:
issue the Terminate Utility command:
-TER UTILITY([util id])
TERM: publib.boulder.ibm.com/../ctermu.htm
November 14, 2011 – 2:13 pm
Symbolic parameters used in JCL can be assigned a value using the SET statement.
// SET INFILE=MY.DATA.SET.HERE
You can also give an eight character (upto 8 char) name to this statement.
//MYVARS SET INFILE=MY.DATA.SET.HERE
Multiple variables can be defined in a SET statement – separated by comma.
//MYVARS SET INFILE1=MY.DATA.SET.HERE,PARM1='KARTHIK'
Learn more
November 14, 2011 – 1:53 pm
Let’s say we have a file with first byte having 2 different values ‘A’ or ‘B’ or any other character.
We are going to create a file with all records starting with A (DD name SORTXXA), a second file with all records starting with B (DD name SORTXXB), a third file (DD name SORTXXX) with remaining records.
SORT FIELDS=COPY
OUTFIL FNAMES=SORTXXA,INCLUDE=(1,1,CH,EQ,C'A')
OUTFIL FNAMES=SORTXXB,INCLUDE=(1,1,CH,EQ,C'B')
OUTFIL FNAMES=SORTXXX,SAVE
November 14, 2011 – 1:42 pm
SYMNAMES is a means of defining variables in SORT. When you have a complex sortcard, it becomes hard to have your sort control card ‘readable / understandable’. It is a good practice to always use SYSNAMES DD to define variables and then use the logical variable names in Sort card.
Below is an example with the SYMNAMES DD (variables declared) and SYSIN (the ‘sort control card’).
//SORTSTEP EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,
// DSN=MYDSN.NAME
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,2000)
//SYMNAMES DD *
Name,1,10,CH
Age,11,2,ZD
/*
//SYSIN DD *
SORT FIELDS=(Age,D)
INCLUDE FILEDS=(Age,GT,25)
/*
//SORTOUT DD DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(250,100),RLSE),
// UNIT=DISK,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
// DSN=MYDSN.OUTPUT.NAME
read more on SYMNAMES
October 1, 2011 – 1:00 pm
Updating/ REWRITING a VSAM record:
VSAM declaration should look like,
FILE2 is the DD name – must have DISP=OLD
Reading VSAM file by Key and updating the record
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
LIST ON
FILE FILE1 FB(80 200)
IN-REC 1 80 A
IN-KEY 1 8 A
FILE FILE2 VS UPDATE
F2-REC 1 18 A
F2-KEY 1 8 A
F2-VALUE 9 10 N
JOB INPUT NULL
GET FILE1
DO WHILE NOT EOF FILE1
READ FILE2 KEY IN-KEY STATUS
IF FILE2 : FILE-STATUS EQ 0
F2-VALUE = F2-VALUE + 5
WRITE FILE2 UPDATE
ELSE
DISPLAY IN-KEY ' NOT PRESENT IN VSAM FILE'
END-IF
GET INFILE
END-DO
STOP