Saturday, June 28, 2008

IMS DL/I Codes


Dli-Function Code’s : 4 byte function code describing the type of requested service.
GU ----------à Get Unique
GN ----------à Get Next
GNP ----------à Get Next Within Parent
GHU ----------à Get Hold Unique
GHN ----------à Get Hold Next
GHNP ----------à Get Hold Next Within Parent
ISRT ----------à Insert
DLET ----------à Delete
REPL ----------à Replace
CHKP ----------à Check point
XRST ----------à Restart

IMS Command Detailes

C ----------à Concatenated Key
D ----------à Path call
F ----------à First occurrence
L ----------à Last occurrence
N ----------à Path call ignore
P ----------à set parentage
Q ----------à Enqueue segment
U ----------à Maintain position at this level
V ----------à Maintain position at this and all superior levels
__ ----------à Null command code

To copy an entire PDS to a sequential tape data set (Unloading)

//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH',
// CLASS=J,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//*********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.UNLOAD,
// DISP=(NEW,CATLG),
// UNIT=CART,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*

To copy an entire PDS to another PDS

//RQRIJOJB JOB (RQRIJOJ,SAMPLE),'RIJO JOSEPH',
// CLASS=A,MSGCLASS=Z,REGION=0M,NOTIFY=&SYSUID
//*
//STEP1 EXEC PGM=IEBCOPY
//**********************************************************
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=XXXX.JCLTEST.RIJO.JCLS,DISP=SHR
//SYSUT2 DD DSN=XXXX.JCLTEST.RIJO.JCLS.BKUP,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TESTDA,
// SPACE=(CYL,(10,10,40)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//SYSIN DD *
COPY INDD=SYSUT1,OUTDD=SYSUT2
/*

ISPF Editor

2. How do I see only those lines that contain a particular string?
A. Type ‘X all’ then ‘F all ‘search-string’
3. Now I want to see only those lines that contain a particular value in the display I get after doing an ‘X all, F all’.
A. Type ‘ F new_value all nx’. ‘nx’ will restrict the search only to the displayed lines.
4. How do I go to a particular line numbers ?
A. Use ‘L search-string’ command. This is the Label command.
5. I want to find for a search-string that is Not prefix/suffix of another word. I want to find for an instance of a search-string that is whole word by itself. How can I do this?
A. Use keyword ‘word’ at the end of find command. E.g., ‘f job word’ will find for the whole word ‘job’.
6. How do I specify the direction of search i.e., how do I search for a string in backward / forward direction (w.r.t., your current cursor position)?
A.
Direction
Keyword
Example
Backward
PREV
F ‘job’ PREV finds for string ‘job’ in backward direction
Forward
No need to mention any keyword. It’s default direction
F ‘job’ finds for string ‘job’ in forward direction.
From the beginning of the file
FIRST
F ‘job’ FIRST finds the first instance of sting ‘job’ in the file.
Count of all instances in file
ALL
F ‘job’ FIRST finds the first instance of sting ‘job’ in the file and gives total-no-of-instances of sting ‘job’ in the file.
7. How do I search for a value say '0980312' stored in comp-3 format?
A. Type F X’0980312’.
8. How do I do case sensitive search find for a given search-string?
A. Just, enclose the search-string within quotes and have a letter C in front of the string itself. For e.g., F C’FindMe’ will find all FindMe strings only if the case matches.
9. How do I find for any non-blank characters?
A. Use picture string ‘^’. E.g., "F P’^’ 36" will find the next non-blank characters in column 36.
30. How do I find for any numeric character?
A. Use picture string ‘#’. E.g., 1. "F p’#’" finds the next numeric character. 2. "F ‘PAGE ##’ will find the next instance of the string ‘page followed by a blank followed by 2 numeric characters’.
31. How do I find for any non-numeric character?
A. Use picture string ‘-’.
32. How do I find for any alphabetic character?
A. Use picture string ‘@’.
33. How do I find for any uppercase alphabetic character?
A. Use picture string ‘>’.
34. How do I find for any lowercase alphabetic character?
A. Use picture string ‘<’.
35. How do I find for any non-display character?
A. Use picture string ‘.’ E.g., "f p’.’" finds the next instance of non-display character.
36. How can I split a line in ISPF editor?
A. Key in ‘TS’ in columns 1-6, position cursor at a point from where you want to split the line and press ENTER. This will result in splitting the line: the contents of line from where the cursor is positioned goes to the next line and the remaining portion will be retained in that line itself.
---TS--- This is first portion. It’s been split here.
^ Cursor is placed here.
Upon hitting ENTER, it splits into 2 lines as below:
-------- This is first portion.
-------- It’s been split here. ß next line
37. How do I join 2 lines?
A. You can do this by using overlay command. For e.g.,
-------- This is line-1.
-------- This is line-2.
Say, you want to join these 2 lines. First, you need to move the 2nd line to the position from where you need to join it in the first line. Then, key in ‘M’ in columns 1-6 of 2nd line and ‘O’ in columns 1-6 of 1st line.
----O--- This is line-1.
----M--- This is line-2.
Upon hitting ENTER, line-2 joins line-1.
-------- This is line-1. This is line-2.
NOTE: If you key in ‘C’ instead of ‘M’ in the 2nd line, it joins the 2nd line to the first line and also retains the 2nd line.
38. How do I see the value of the field stored in comp-3 format?
A. Type HEX ON and go to the location of the field and get the value from the two lines displayed below it.
39. How do I get rid of the 4 to 5 message lines displayed at the beginning of the file in ISPF edit?
A. Use ‘RESET’ command.
40. How do I stop the standard numbers on Col 73-80 in the ISPF editor?
A. Type ‘NUM OFF’. Some Clients use Col 73-80 to mark their changes, in that case you HAVE to have NUM OFF as the option.
41. How do I make columns 1-6 disappear from my ISPF editor screen?
A. Type 'NUM ON COB’. These are the ‘COBOL numbers’ columns and the screen display will be from Col 9-80.
42. How do I make the numbers on Col 1-6 contiguous, i.e., the COBOL numbers
A. Type 'RENUM'. ISPF sometimes recommends you to do this. You can ignore it.
43. How do I replace a particular value in a particular column with a constant value?
A. Type c ‘from_value’ ‘to_value’ 6 all. If you want this change in a particular range of rows, you’ll have to block the rows with ‘xx’ and say ‘c from_value to_value 6 x all’. Here ‘6’ is the column number.
44. I want to copy a block of records from one dataset to another.
A. Block the records and type ‘CUT’ at the command line. Open the other dataset in edit mode and type ‘PASTE’ at the command line and type ‘a’ or ‘b’ on the row after / before which you want these records.
45. I have a file of record length 240 and want to know in which column the value I am looking at occurs.
A. Say cols on the Command line if in browse mode and in the column command if in edit mode.

ISPF Environment

1. How do I create multiple instances of ISPF sessions?
A. Use PDF command from the TSO panel, which will initiate a new ISPF session, Type =x to comeback to previous ISPF session. You can also type 'start' to initiate a new ISPF session, in this case you have to swap to go to the other session. You can have as many as 6 sessions open.( This command is installation specific)
2. I want to clear off the PF keys that are shown at the bottom of my ISPF panels.
A. Use command ‘PFSHOW OFF’ on command line. If you want to turn it on, issue ‘PFSHOW ON’.
3. I typed ‘/’ before pressing some Pfkey and this takes me to some other session
A. Character ‘/’ is used as a jump character for going to TPX screen in most of the installations. Therefore typing ‘/’ preceded by a PFkey is as good as going to TPX main menu and going to the corresponding session.
4. How do I see someone else’s jobs in IOF/SDSF?
A. In IOF menu give 'userid' in SCOPE field. In SDF you may have to type ‘ u xxxxx’ where xxxxx is the id or some other option will be available.
5. How do I compare a specific column in two files on ISPF?
A. Go to Option 3.13 (SUPERCE) and type 'edit'. You can give your compare options here. Also, you can specify many other options such as ‘treat certain records as comments’ etc.
6. How do I recover a Dataset I deleted by mistake, or maybe overwrote?
A. Use the TSO command HRECOVER, you’ll have to mention the generation or date of the backup you want restored. You can restore it to a new dataset. Usually, HRECOVER option can be found in ‘HSM’ utility panel.
7. How do you allocate a file similar to existing production file thought a job?
A. Specify production file as Model dataset. If you want to allocate a file similar to another file you can use the LIKE command and override any DCB parameter that you want different in your file.
8. How do I create a sequential file from VSAM file?
A. Use IDCAMS utility with the repro command. You can create a VSAM from a sequential file: the only condition is the sequential file should be sorted on the key fields.
9. How do I compare VSAM datasets?
A. Use either compare option in file-aid or ‘comparex’ utility or ‘data-xpert’ utility.
10. How do I know which version of Cobol compiler I am using?
A. Look at the first line of your compilation listing
11. How do I find out which base cluster does an alternate index file belong to?
A. Display information in file aid for the '.PATH' file which will show the base cluster as well as corresponding alt index file.
12. If I am using 3.4 and try to create a new member in an empty PDS, I can’t ?
A. Use option 2 and the new member name.
13. I got a B37 abend when tried to save the file.
A. Your PDS is out of space. Start another session open this PDS in 3.4 and put a ‘z’ next to it. It will compress the PDS. All x37 abends are ‘out of space’ situations.
14. I got an error message ‘NO SPACE IN DIRECTORY’ while creating a member in PDS.
A. Your PDS can no longer accommodate more members in it. You need to increase the ‘Directory blocks’. Each directory block can hold at least 4 members.
15. I want to copy only the first 500 records of my file.
A. Use file-aid or dataexpert and give the number of records in the option.
16. The dataset I want is migrated, but I don’t want my screen to be frozen when I recall it.
A. Type HRECALL next to the dataset name in 3.4
17. I want to send a message to another person logged on to TSO
A. Say ‘ TSO SEND ‘message line’ U(user_id)’. If the person in not logged on but you want to send a message which he can read when he logs on say ‘ TSO SEND ‘message line’ U(user_id) LOGON’
18. I want to see the LIMIT of a GDG.
A. Use LISTCAT in TSO or File-Aid option 3.2
19. I want to know the % free and other statistics of my dataset.
A. If you press ‘right or PF11’ on your 3.4 listing you can see the dataset statistics or use option 3.1 and I
20. I keep using certain commands that I want to save.
A. The commands you use regularly can be saved as a function key. E.g. – if you often change a JCL, save it, submit it and then go to the job spool. You could save a PF key as ‘save; sub; =IOF’ . To do this type ‘KEYS’ on ‘command line’ and make the necessary entries.
21. I am not able to delete a dataset that resides on a tape.
A. Yes. You cannot delete/rename a tape dataset. Only you can uncatalog it.

Sunday, June 22, 2008

DB2 9 Fundamentals Certification Study Guide

Starting with the certification process itself and ending with the concept of isolation levels and locking, this guide covers everything needed to know to pass the DB2 9 Fundamentals Certification Exam (Exam 730). The prerequisite for all intermediate and follow-on DB2 certifications, XML usage, basic table creation, a rich set of sample questions, and detailed answers are all included, forming the foundation for understanding the newest version of IBM’s flagship database product. Regardless of what future certification path the reader is planning on pursuing, this study guide will chart a course for proficiency in DB2 9.

LINK:
http://rapidshare.com/files/45245111/DB2.9.Fundamentals.Certification.Study.Guide.1583470727.rar

DB2 UDB V8.1 Certification Exam 700 Study Guide

DB2 8.1 Fundamentals Certification Guide I found this book very helpful in preparing for certification. Read this book and do the review questions at the end of each chapter

LINK:
http://rapidshare.com/files/60449485/seven00uide.rar

Saturday, June 21, 2008

CONDITION CHECKING

******************************* CONDITION CHECKING ****************
//MAPL737A JOB NOTIFY=MAPL737,TIME=1,PRTY=15
//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME-
(MAPL737.KSK.+
KSDS5)-
INDEXED-
TRACKS(10,10)-
KEYS(4,0) -
FREESPACE(10,20)-
RECORDSIZE(80,80)-
CISZ(4096))
IF LASTCC=0 THEN -
REPRO INDATASET(MAPL737.EMP.KSDS) -
OUTDATASET(MAPL737.KSK.KSDS5)
ELSE -
SET MAXCC=16
/*
//
*********************************************************************888
******************************** CONDITION **********************
//MAPL737A JOB NOTIFY=MAPL737,TIME=1,PRTY=15
//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
DEFINE CLUSTER(NAME-
(MAPL737.KSK.+
KSDS6)-
INDEXED-
TRACKS(10,10)-
KEYS(4,0) -
FREESPACE(10,20)-
RECORDSIZE(80,80)-
CISZ(4096))
IF LASTCC=0 THEN -
DO -
REPRO INDATASET(MAPL737.KSK.KSDS) -
OUTDATASET(MAPL737.KSK.KSDS6)
REPRO INDATASET(MAPL737.KSK.KSDS) -
OUTDATASET(MAPL737.KSK.KSDS6) REPLACE
END
ELSE -
SET MAXCC=16
/*
//
*************************************************************

JCL Sort Example

****************************** SORT ***************************
//MAPLE12A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPLE12.JCLSORT.PS1,DISP=SHR
//SORTOUT DD DSN=MAPLE12.JCLSORT.PS2,DISP=SHR
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(4,2,CH,A)
/* 00080000
//* SORT A FILE 00090000
**************************************************************
******************************** SORT ******************************
//MAPLE12A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPLE12.JCLSORT.PS1,DISP=SHR
//SORTOUT DD DSN=MAPLE12.JCLSORT.PS2,DISP=SHR
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=NONE
/* 00080000
//* SORT A FILE 00090000
*********************************************************************
******************************** SORT ************************
//MAPLE12A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPLE12.JCLSORT.PS1,DISP=SHR
//SORTOUT DD DSN=MAPLE12.JCLSORT.PS3,DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(TRK,(5,1),RLSE),
// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB,DSORG=PS)
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=NONE
/* 00080000
//* SORT A FILE 00090000
*************************************************************
**************************** SORT *********************************
//MAPLE12A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPLE12.JCLSORT.PS1,DISP=SHR
//SORTOUT DD DSN=MAPLE12.JCLSORT.PS2,DISP=SHR
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(1,3,CH,A,11,9,CH,A)
INCLUDE COND=(21,6,CH,EQ,C'DEPT2')
/* 00080000
//* sort and include cond 00090000
*********************************************************************
*********************************** SORT ******************************
//MAPLE12A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPLE12.JCLSORT.PS1,DISP=SHR
//SORTOUT DD DSN=MAPLE12.JCLSORT.PS2,DISP=SHR
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(1,3,CH,A,11,9,CH,A)
OMIT COND=(21,6,CH,EQ,C'DEPT2')
/*
//
/* sort and omit
******************************************************************
****************************** SORT *******************************
//MAPL737A JOB (ACC1),'KUMAR',TIME=(,5),NOTIFY=&SYSUID, 00010000
// REGION=5M,PRTY=6,MSGLEVEL=(1,0),CLASS=A 00020000
//STEP1 EXEC PGM=SORT 00030000
//SYSPRINT DD SYSOUT=* 00040000
//SYSOUT DD SYSOUT=* 00040000
//SORTIN DD DSN=MAPL737.SAKTHI.PS,DISP=SHR
//SORTOUT DD DSN=MAPL737.SAKTHI.PS2,DISP=SHR
//SRTWK01 DD UNIT=SYSDA,SPACE=(TRK,(5,3))
//SYSIN DD *
SORT FIELDS=(1,1,CH,A)
OUTREC FIELDS=(1,3,21,5)
/*
//
/* sort , omit , take select fields
SORT FIELDS=(1,3,CH,A,11,9,CH,A)
INREC FIELDS=(1,3)
*********************************************************************

JCL Optimization

  • Use automatic block size (BLKSIZE=0) – requires block contains 0 records in the file definition of cobol programs, except for tape or cartridge (UNIT=CART) . For tape or cartridge set the blocksize as close to 32,000 bytes as possible. Reduces I/O , disk space, and cpu required to process the required I/O.
  • When RECFM=VB, use a utility to calculate the best blocksize like TSO SPC-(SPC is a clist instaed of this write actual formula if required ) to get the best blocksize
  • Use TRK instead of CYL or BLK parm whenever possible ( 1 CYL = 15 TRKS)
  • Check if GDG’s are required, if yes check the optimize version number.
  • Save large files ( > 200 CYL) on cartridge rather than DASD; use TRTCH=COMP with cartridge. 1 CYL = 15TRKS = ((56,664 bytes x 15) = .85 megabyte) . Based on the frequency and priority of batch run, decide to put files on DASD or Tape.
    200 CYL = 170 Megabyte. Cost per week = 170 x .09 = $15.30
    200 cyl on disk = 170MB cost $15.30 a week times 4 weeks per month = $61.20.
    1 Volume Cartridge tape = 400MB storage capacity on site cost per month $2.08 + $1.87 per tape mount = $3.95 per month for storage
    1 Volume Cartridge tape = 400MB storage capacity off site cost per month $0.26+ $1.87 per tape mount = $2.13per month for storage
    (The above mentioned rates may differ from site to site.)
  • Space parm; after calculating the required consumption, the primary portion should be depending on the average no of records and secondary portion should be the largest possible out of the overall consumption., use RLSE option also to free up/reduce file space allocated when it not needed.
  • Use ‘Refer Back’ option when writing to cartridge multiple times within a job
  • Use disposition of delete if possible
  • Use consistent high-level qualifiers and as few as possible
  • Avoid to use in-stream data directly in the jcl, instead, use parmlib member.
  • Use standard PROCs/JCLs, if available.


JCL job Shed

To execute a job by 2 p.m. every Friday, code:

//*MAIN DEADLINE=(1400,A,6,WEEKLY)


To execute a job by 7 a.m. on January 20, 1986, code:

//*MAIN DEADLINE=(0700,B,012086)

JCL for MERGE

//SZ04MR1 EXEC PGM=SORT
//SORTIN01 DD DSN=SZ.SZ04SR1.GOOD.ITEM3,DISP=(OLD,DELETE)
//SORTIN02 DD DSN=SZ.SZ04SR1.GOOD.ITEM5,DISP=(OLD,DELETE)
//SORTIN03 DD DSN=SZ.SZ04SR1.GOOD.ITEM2,DISP=(OLD,DELETE)
//SORTOUT DD DSN=SZ.SZ04SR1.GOOD.ITEM6,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
MERGE FIELDS=(1,5,A,8,5,A),FORMAT=BI
OPTION EQUALS
//*

JCL with COPY INCLUDE

//SZ04SR2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SZ.SZ04SR1.GOOD.ITEM1,DISP=(OLD,DELETE)
//SORTOF01 DD DSN=SZ.SZ04SR1.GOOD.ITEM4,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF02 DD DSN=SZ.SZ04SR1.GOOD.ITEM5,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(6,2,PD,EQ,150,OR,6,2,PD,EQ,159)
OUTFIL FILES=02,INCLUDE=(6,2,PD,NE,150,AND,6,2,PD,NE,159)
//*

SORT JCL

//SZ04SR1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=SZ.SZ02.HL.GOOD.ITEM,DISP=OLD
//SORTOF01 DD DSN=SZ.SZ04SR1.GOOD.ITEM1,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF02 DD DSN=SZ.SZ04SR1.GOOD.ITEM2,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SORTOF03 DD DSN=SZ.SZ04SR1.GOOD.ITEM3,DISP=(,CATLG),
// UNIT=%%SYSWRK,SPACE=(CYL,(5,5),RLSE)
//SYSIN DD *
SORT FIELDS=(1,5,A,8,5,A,6,2,A,13,4,A),FORMAT=BI
OUTFIL FILES=01,INCLUDE=(6,2,PD,GE,100,AND,6,2,PD,LE,199)
OUTFIL FILES=02,INCLUDE=(6,2,PD,GE,200,AND,6,2,PD,LE,299)
OUTFIL FILES=03,INCLUDE=(6,2,PD,LT,100,OR,6,2,PD,GE,300)
//*

Executing a query through a JCL

//SZ202R EXEC PGM=IKJEFT01,REGION=4M
//SYSOUT DD SYSOUT=*,DEST=%%CONTROLM
//SYSPRINT DD SYSOUT=*,DEST=%%CONTROLM
//SYSTSPRT DD SYSOUT=*,DEST=%%CONTROLM
//SYSUDUMP DD SYSOUT=P
//SYSTSIN DD *
DSN SYSTEM(%%DB2SYS)
RUN PROGRAM(DSNTIAD) PLAN(DSNTIAD) +
LIB('DB2G.PROD.RUNLIB.LOAD')
END
//*
//SYSIN DD *
UPDATE DBSZT.AVAL_TABL SET HOTS_AVAL_F = 'R';
COMMIT;
/*

JCL Questions and answers

1. What are three major types of JCl statements? What are their funtions?

JOB, EXEC, DD.
JOB - indicates start of jobstream to the operating system and through parms coded on it, certain details about the job (time, region, message level, job accounting data).

EXEC - indicates the start of execution of a particular job step, be that step a program or a proc.

DD - is a data definition, which is used to describe the attributes of a data set (name, unit, type, space, disposition).


2. How would you limit the time allotted for a job to forty-five seconds?

With a TIME parm
on the JOB statement in the form: TIME=(,45).
Next question

3. What is the purpose of the DISP parameter?

Indicates the disposition of a data set (OLD, NEW, PASS, KEEP, etc,).
Next question

4. What does SYSIN * indicate?

Instream data follows this card and is terminated when followed by a card containing // or /* in columns 1 and 2.
Next question

5. The first two characters of any JCL statement must be what?

// or /*
Next question

6. What's wrong with this statement? // EXEC PROG=PAYROLL?

PROG should be PGM.
Next question

7. The EXEC statement indicates the beginning of what?

the beginning of execution of a job step in a job stream.
Next question

8. What characters indicate the JCL card is a comment card?

//* in columns 1 - 3.
Next question

9. How do you continue a JCL card?

A comma should follow the last entry on the original card. The continuation card must have ?? in columns 1 and 2, followed by a least one blank, and the rest of the parms must start in or before column 16.
Next question

10. What DD statement parms are required to access a catalogued data set?

DSN and DISP.
Next question

11. When would you use DISP=SHR instead of DISP=OLD?

You would use DISP=SHR to allow others to read (share) the datasets in a job. You would use DISP=OLD to lock others out (especially when you're updating the data set).
Next question

12. How do you reference the most current generation of a GDG (generation data group)?

by placing a +0 in parenthesis immediately after a dataset name. As in DSN=GDG.NAME(+0)
Next question

13. What is the difference between JOBLIB and STEPLIB?

JOBLIB allocates the libraries to all the steps for the entire life of the job. STEPLIB allocates the libraries for only that step where the STEPLIB is coded. STEPLIB takes precedence over JOBLIB.
Next question

14. Where in the jobstream is the JOBLIB statement placed?

After the JOB statement and before the EXEC or PROC statement.
Next question

15. How do you concatenate data sets?

First card has //DDNAME DD DSN=data.set.name1. Other cards omit DDNAME as in:
// DSN=data.set.name2, // DSN=data.set.name3, etc.
Next question

16. What are COND parms used for?

To control the flow of jobstream execution to bypass or execute certain job steps based on the return codes from previous steps.
Next question

17. What will make this step run if COND parm is COND=(0,NE)?

Run if return codes from any previous step(s) were equal to zero. Skip this step if the return code from any previous steps are not equal to zero (0,NE).
Next question

18. What does COND=EVEN mean? COND=ONLY?

COND=ONLY means the step will be run only if the job has failed. COND=EVEN means the step will run even if a previous step has failed.
Next question

19. What does the RLSE parm on space allocation mean?

Releases any unused space back to system.
Next question

20. How would you override a DD statement called BKUP in step STEP10 in a proc?

//STEP10.BKUP DD .................
To TOP

JCL Condition Code Checking

JCL statement executes if: IF RC =

COND=(0,GT) 0<=RC 0 or positive
COND=(0,GE) 0COND=(0,EQ) 0 NOT=RC negative or positive
COND=(0,LT) 0>=RC 0 or negative
COND=(0,LE) 0>RC negative
COND=(0,NE) 0=RC 0

About JES.........

Job Entry Subsystems:

Job Scheduler:
JES is an MVS component which keeps track of jobs that enter the system. The job entry subsystem also called as JES in short is used by MVS operating system. The JES is the component which presents jobs for MVS processing and sends the job’s spooled output back to the correct destination. A JOB is the execution of one or more related programs in sequence. Each program to be executed by a JOB is called a JOB STEP.
Types of JES:

There are two main types in this as given below:

HASP:
This is the acronym for Houston Automatic Spooling Program. It is otherwise called as JES2.

ASP:
This is the acronym for Asymmetric Multiprocessing system. It is otherwise called as JES3. This system is more suitable for shops with more than one processor.

It is vital that a user must know that each MVS system can use JES2 or JES3 but not both.
Job management of MVS:

The task of job management of MVS is taken care by two main resources:
JES and
Base control program of MVS.

Here the former job entry subsystem also called as JES in short takes up the task of managing jobs before and after running the program. The latter base control program takes the task of managing the job during processing.

General Phases in a Job:

The phases through which a job generally flows through starting from input stage till final stage are given below:
Input
Conversion
Processing
Output
Print
Purge

Input:
The HASP otherwise called as JES2 accepts jobs as input stream. The ability of JES2 is to accept multiple jobs at the same time. Before JES2 accept the jobs it is obvious that user has to submit the jobs. This process of submitting jobs can be done using programs and commands to JES2.We will see about commands in JES2 in detail in our coming sections. The jobs submitted is accepted as input stream by JES2 and a job identifier given to each JOB JCL statement with all jobs, JCL commands and statements being placed in spool data sets from which job is selected by JES2 for further processing.

Conversion:
In the process the jobs are processed and fine tuned for execution. That is to say in detail JES2 uses converter program which associates the JCL statements placed in JOB statement with JCL in procedure library. This merged JCL is then converted into a combined JCL as text by JES2. If there is no errors detected in JCL by JES2 the jobs are queued in spool date set for further processing and execution. If errors were detected by JES2 then appropriate messages are placed and the job is queued for processing and not for execution.

Processing:
In this the jobs that were placed in the previous phase in the jobs queue are taken by JES2 and sent to initiators and these are defined using JES2 initialization statements which we will see in detail in our JES2 commands section. The processing by initiators is based on various priorities of class assigned and the priority of queued jobs.

Output:
All the output produced in system by jobs also called as SYSOUT in short is controlled and monitored by JES2. In this phase the output activities like printing of datasets, output device handling, system messages to be outputted are all handled by JES2.The dataset which is to be outputted having same characteristics are grouped together by JES2 for printing.

Print:
In this phase the output dataset generated by earlier output phase are processed by JES2. Here the output is selected for processing by JES2 based on priority, output class mentioned on JCL. After JES2 process the output of job it places the job in purge queue for next phase to take over.

TSO Short Cut Keyz

Default Function and PF Key settings

PA1 Interrupt a TSO command
PA2 Redisplay the current screen contents
PF1/13 Help (tutorial)
PF2/14 Enter split screen mode
PF3/15 End the current operation
PF4/16 End the current operation and return to the primary option menu
PF5/17 Repeat the previous FIND command
PF6/18 Repeat the previous CHANGE command
PF7/19 Move the window up
PF8/20 Move the window down
PF9/21 Swap (Move between the split screens)
PF10/22 Move the window left
PF11/23 Move the window right
PF12/24 Retrieve the last command entered and put it on the command line

PFSHOW ON Displays the pf settings at the bottom of the screen
PFSHOW OFF Turns off the pf settings displayed at the bottom of the screen

Scroll Amounts

Value Meaning

Half Move the screen window half a page

Page Move the screen window one page

n Move the screen window n lines (where n is a numeric number)

Max Move the screen window to top, bottom, left, or right margin

Csr Move the screen window so data at the current cursor position
ends up at the top, bottom, left, or right of the screen

Data Move the screen window one line or column less than a full page






MENU And Command Tricks

Jump directly to another menu in the selected option:
=option
For example: COMMAND ===> =3

Bypass a second menu :
Enter all menu options on the command line with a period
For example: COMMAND ===> P.3.4

Chain Commands:
command;command

Repeat a command:
&command

Enter a native TSO command
COMMAND===> TSO command

Quit TSO
=X

BROWSE COMMANDS

Establish a label on a line:
.LABEL

Display a scale line with individual columns marked:
COL or COLUMNS
COL OFF to turn the scale off

Find a specified string of characters:
FIND string [NEXT] [CHARS] [column-1 [column-2]]
[PREV] [PREFIX]
[FIRST] [SUFFIX]
[LAST ] [ WORD]
[ALL]

Display non-displayable characters in hexadecimal:
HEX [ON] to turn the hex display on
HEX OFF to turn the hex display off

BROWSE COMMANDS

Move the display to a known point in the file:
LOCATE line number or label

EDIT COMMANDS

Edit Line Commands:

Copying lines
C Copy this line
Cn Copy n lines starting with this line (where n is a number)
CC Copy a block of lines starting with the first CC command and ending with the second CC command.

A Place the copied lines after this line.
An Repeat the copied lines n times after this line
B Place the copied lines before this line
Bn Repeat the copied lines n times before this line.

Deleting lines
D Delete this line.
Dn Delete n lines starting with this line
DD Delete the block of lines starting with the first DD command and ending with the second DD command.

Excluding and redisplaying lines.
X Exclude this line.
Xn Exclude n lines starting with this line.
XX Exclude a block of lines.

S Show one line of the excluded text.
Sn Show n lines.

F Show the first line of the excluded text.
Fn Show the first n lines of the excluded text.

L Show the last line of the excluded text.
Ln Show the last n lines of the excluded text.


Edit Line Commands:
Inserting Lines:
I Insert one line following this line.
In Insert n lines following this line.

Moving Lines:

M Move this line.
Mn Move n lines starting with this line.
MM Move a block of lines beginning with the first MM and ending with the second MM.
A Place the moved lines after this line.
An Repeat the moved lines n times after this line.
B Place the moved lines before this line.
Bn Repeat the moved lines n times before this line.

Repeating Lines:

R Repeat this line.
Rn Repeat this line n times.
RR Repeat a block of lines beginning with the first RR and ending with the second RR.
RRn Repeat a block of lines n times.

Shifting Lines:

< commands are data shift commands
( commands are column shift commands
< ( Shift this line left two positions
<< (( Shift a block of lines left two positions
<
> ) Shift this line right two postions
>n )n Shift this line right n positions
>> )) Shift a block of lines right two positions
>>n ))n Shift a block of lines right n positions

Splitting text
TS Split a text line at the cursor
TSn Split a text line at the cursor and insert n number of lines

Edit Line Commands:
Flow fragments of text into a paragraph
TF Flow text to the end of paragraph which is either a blank line or an indentation.
TFn n is the column number. This will flow the text using the column number as the right margin.

Misc. line commands

TABS Display a tab definition line where * denotes the tabs
COLS Display a column line
BNDS Display a boundary line
MASK Display a mask line.that can be used when inserting lines
.LABEL Establish a label on al line
UC Change text from lowercase to uppercase
LC Change text from uppercase to lowercase

Edit Primary Commands:

Automatically save changes when using the End key (PF3)

AUTOSAVE
AUTOSAVE OFF To turn this feauture off

Set the columns used for editing:

BOUNDS [left column right column}

Cancel everything done in the editing session:

CANCEL

Automatically convert all lowercase letters entered to uppercase:

CAPS
CAPS OFF to turn this feature off






Edit Primary Commands:
Make changes to strings:
CHANGE string-1 string-2 [range] [NEXT] [CHARS] [X] [COL-1 [COL-2]]
[PREV] [PREFIX] [NX]
[FIRST] [SUFFIX]
[LAST] [WORD]
[ALL]

Copy from a dataset to a position marked by an A or B line command or a label:

COPY [member name] [AFTER] label]
[BEFORE]
COPY will bring up a menu to enter dataset name

Move data from the dataset you are editing using the copy or move line commands to CREATE a new dataset:

CREATE [member name] [range]
CREATE will bring up a menu to enter dataset name

Delete lines

DELETE [All] [range] [x]
[nx]

Edit another dataset :

EDIT [member-name]
EDIT will bring up a menu to enter dataset name

Exclude lines from displaying:

EXCLUDE string [range] [NEXT] [CHARS] [COL-1 [COL-2]]
[PREV] [PREFIX]
[FIRST] [SUFFIX]
[LAST] [WORD]
[ALL]




Edit Primary Commands:

Find strings:
FIND string [range] [NEXT] [CHARS] [X] [COL-1 [COL-2]]
[PREV] [PREFIX] [NX]
[FIRST] [SUFFIX]
[ALL] [WORD]

Display non-displayable characters in hexadecimal:
HEX [ON] to turn the hex display on
HEX OFF to turn the hex display off

Move the display to a known point in the file:
LOCATE line number or label

Move from a dataset to a position marked by an A or B line command or a label:

MOVE [member name] [AFTER] label]
[BEFORE]
MOVE will bring up a menu to enter dataset name

Control how trailing blanks are sent to the screen:

NULLS ON (Default) Trailing blanks are sent to the screen as null characters
NULLS OFF Trailing blanks are sent to the screen as blanks

Display and changing the edit profile

PROFILE
PROFILE profile name] switches to a different profile or creates a new profile
PROFILE LOCK saves the changes made to the edit profile

Keep a record of all the changes you make during an editing session:

RECOVERY ON
RECOVERY OFF turns off this feature





Edit Primary Commands:
Move data from the dataset you are editing using the copy or move line commands to REPLACE an existing dataset:

REPLACE [member name] [range]
REPLACE will bring up a menu to enter dataset name

Remove messages that appear within the edited file:

RESET

Save the edited file:

SAVE

Sort
SORT [col-1] [col-2] [sequence] [col-3] [col-4] [sequence] [X]
where sequence is A or D [NX]

Keep automatic statistics:

STATS ON
STATS OFF turns off this feature

Set the tabs mode and tabs character:

TABS [ON] [tab character] [STD]
[ALL]
TABS OFF turns off this feature
Example: TABS ON #

Undo the last modfications made during an editing session:

UNDO
NOTE: This only works if RECOVERY ON

Define how line numbers are stored in a PDS member

NUMBER [ON] [STD] columns 72-80
[OFF] [COBOL] columns 1-7
[STD COBOL] columns 1-7 and 72-80

Edit Primary Commands:

Turn the number mode off
NONUMBER

Indicate how line numbers should be resequenced when a member is saved
AUTONUM ON Resequence when saved
AUTONUM OFF Don't resequence when saved

Renumber the line numbers starting with 100 and incrementing by 100:
RENUM [STD]
[COBOL]
[STD COBOL]

Turn off NUMBER mode and replace the line numbers with blanks
UNNUM

MEMBER SELECTION LIST COMMANDS

Line Commands

S Select the member (not available for 3.1 and 3.4)
P Print the member (only available for 3.1 and 3.4)
R Rename the member (only available for 3.1 and 3.4)
D Delete the member (only available for 3.1 and 3.4)
B Browse the member (only available for 3.1, 3.3 and 3.4)
E Edit the member (only available for 3.4)

Member Selection List Primary Commands:

Locate a character string
LOCATE string

Save a dataset or member list to a sequential dataset
SAVE dataset name

Automatically select members in a member list
SELECT pattern [line command]




Sort a dataset or member list by any two fields displayed on the list:
SORT [field1] [field2]
Example: SORT CHANGED SIZE
ALLOCATE A DATASET (P.3.2)
Step 1 Option = spaces, specifiy a dataset like the one you wish to allocate
Step 2 Option = M, specifiy the dataset you want to allocate
For a PDS, leave the secondary quantity = 0, and enter a number in DIRECTORY BLOCKS

MOVE/COPY UTILITY (P.3.3)
Step 1 Specify the Copy or Move option and the from dataset information. If the from dataset is a PDS, then enter Member==> * to copy all of the members.
Step 2 Specify the to dataset information.
Step 3 If the from dataset is a PDS and not all members were indicated, then a member list is displayed. Specify members to be moved or copied by entering "S" in the leftmost column.

DATA SET LIST UTILITY COMMANDS (P.3.4)

B Browse
E Edit the dataset
D Delete the dataset
R Rename the dataset
I Display dataset information
S Display a short version of the dataset information
C Catalog a dataset
U Uncatalog a dataset
P Print a dataset
X Print an indexed listing
M Display the member list of a partitioned dataset
Z Compress a partitioned dataset
F Free unused space
= Repeat the last command
List











Default Function and PF Key settings for SDSF

PA1-3 Redisplay the current screen contents
PF1/13 Help (tutorial)
PF2/14 Enter split screen mode
PF3/15 Return to the previous screen
PF4/16 Return to ISPF
PF5/17 Repeat the previous FIND command
PF6/18 Find the next condition code when displaying job output.
PF7/19 Move the window up
PF8/20 Move the window down
PF9/21 Swap (Move between the split screens)
PF10/22 Move the window left
PF11/23 Move the window right
PF12/24 Retrieve the last command entered and put it on the command line
KEYS Change the PF settings for SDSF





Primary SDSF Commands

DA Display active users on the system.
I Display the JES2 input queue.
O Display the JES2 output queue.
H Display the JES2 held output queue.
ST Display the JES2 status queue.








SDSF Action Characters

Action Description DA I O H ST
C Cancel a job X X X
? Display a list of output datasets. X X X X X
S Browse output data sets. X X X X X
O Release output and make eligible for printing. X X
P Purge output data sets from the system. X X X X X
X Print a data set to SYSOUT. The print file remains open. X X X X X
XC Print data set and close print file. X X X X X
XD Print a data set using Open Print Data Set panel. X X X X X
XDC Same as XD, but close after printing X X X X X
XS Print a data set using Open Print sysout Data Set panel X X X X X
XSC Same as XS, but close after printing X X X X X

SDSF Panel Commands

Control the display of values for PREFIX, DEST, OWNER, and sort

SET DISPLAY [ON]
SET DISPLAY OFF

Display alternate list of fields: (DA and O panels)

?

Limit the jobs shown by destination(s):
DEST destination

Limit the jobs shown by owner ID:
OWNER ownerid Values for ownerid may include * for any string of characters.

Limit the jobs shown by job name:
PREFIX string Values for string may include * for any string of characters.
SDSF Panel Commands
Refresh the screen every nnn seconds:
&nnn Where nnn is the seconds

Set SDSF screen color, highlighting, and intensity:
SET SCREEN

Find a job name using a character string:
FIND [string] [col-1 [col-2]] [NEXT] [CHARS]
[PREV] [WORD]
[FIRST] [PREFIX]
[LAST] [SUFFIX]
[ALL ]
Locate a line:
LOCATE line number

Change the PF key settings:
KEYS

Print a dataset that was created in ISPF using the print option:
LIST

SDSF OUTPUT DISPLAY COMMANDS:

Scroll forward through data sets:
NEXT [number] (only works when used the S action character)

Scroll backwards through data sets
PREV [number] (only works when used the S action character)

Display a column header:
COLS

Remove a column header
RESET

Set hexadecimal display mode
SET HEX [ON]
SET HEX OFF

Open a print data set:
PRINT OPEN [class [copies [forms]]]
SDSF OUTPUT DISPLAY COMMANDS:

Print a portion of an output data set
PRINT [first-line last-line]

Close a print data set
PRINT CLOSE

'


Ads By CbproAds