CA7 Command lists.
LQ LISTS ALL JOBS IN CA-7'S QUEUES AND
WILL TELL WHICH QUE EACH JOB IS IN.
LQ,JOB=JOBNAME WILL TELL YOU WHICH QUE A JOB IS IN
LQ,JOB=JOBNAME,LIST=RQMT WILL LIST THE REQUIREMENTS THE JOB
IS WAITING ON.
LQ,JOB=JOBNAME,LIST=Q WILL SHOW IF THE JCL CAME FROM THE
OVERRIDE LIBRARY. WILL SHOW LAST
STEP EXECUTED IF THE JOB IS ACTIVE.
LQ,JOB=JOBNAME,LIST=JCL WILL LIST THE JCL LOADED FOR THE
JOB FOR THIS RUN ONLY.
LQ,ST=LATE LISTS JOBS THAT ARE LATE IN ALL
QUEUES.
LQ,ST=RSTR LISTS ABENDED JOBS WHICH HAVEN'T
BEEN REQUED AND LISTS ABEND CODE.
XQ LISTS ALL JOBS IN THE REQUEST QUE
WAITING ON REQUIREMENTS TO BE MET.
XQ,JOB=JOBNAME USED TO EDIT A JOB, POST A REQUIRE-
MENT, RESTART A JOB, PUT A HOLD ON
A JOB, RELEASE A JOB, CANCEL A JOB,
OR FORCE COMPLETE A JOB.
XRQ,JOB=JOBNAME,LIST=ALL IF JOB HAS ABENDED BECAUSE THE
RQMTS WERE POSTED AND YOU WANT TO
PUT THE RQMTS BACK ON IT, USE THIS
COMMAND THEN PUT A 'U' TO UNPOST
THE RQMTS.
LACT LISTS ACTIVE JOBS.
LACTR LISTS ACTIVE JOBS,CLASS & RESOURCES
LJES LISTS ALL ACTIVE JOBS AND LAST STEP
EXECUTED.
LRDY LISTS ALL JOBS IN RDY QUE WAITING
ON RESOURCES SUCH AS A TAPE DRIVE,
INITIATOR OR HIGHER PRIORITY JOBS.
ALSO LISTS WHETHER A JOB IS LATE.
LRDYP LISTS ALL JOBS IN RDY QUE. LISTS
PRIORITY AND TAPE DRIVES NEEDED FOR
EACH JOB.
LRDYP,JOB=JOBNAME EXPLAINS WHAT RESOURCES JOB IS WAIT
ING ON: TAPE DRIVES, CLASS BARRIER.
XUPD,JOB=JOBNAME THIS SCREEN SHOWS THE CLASS, TAPE
DRIVES NEEDED AND PRIORITY OF A
JOB. CAN BE UPDATED TO MOVE A JOB
THRU THE RDY QUE TO THE ACT QUE
FASTER BY INCREASING THE PRIORITY
AND DECREASING THE TAPE DRIVES.
XWLB WORKLOAD BALANCING SHOWS TOTAL JOBS
ACTIVE, TOTAL INITIATORS AVAILABLE,
TOTAL MAX TAPE DRIVES ALLOWED, AND
NUMBER OF INITIATORS OPEN PER CLASS
LQ,SEQ=DOTM,LIST=STATUS LISTS ALL THE JOBS IN REQUEST QUE,
ACTIVE QUE, READY QUE AND ABENDED
JOBS WITH THEIR ABEND CODES. LISTS
ALL REQUIREMENTS NOT YET MET.
LIST,JOB=JOBNAME LISTS ALL STEPS IN AN ABENDED JOB
AND FLAGS THE ABENDED STEP.
LJOBR,JOB=JOBNAME SHOWS THE AVERAGE RUN TIME OF A JOB
BY AVERAGING THE LAST 6 RUNS. LISTS
CPU TIME AND CLOCK TIME IN HHMM AND
LAST RUN DATE AND TIME.
LJOB,JOB=JOBNAME,LIST=RQMT LISTS ALL REQUIREMENTS THAT NEED TO
BE MET: DSN, USR, JOB. A / IN FRONT
OF A JOB MEANS IT CAN'T RUN WITH AT
THE SAME TIME AS THIS JOB. THIS IS
CALLED A NEGATIVE DEPENDANCY.
LJOB,JOB=JOBNAME,LIST=DEPJ LISTS ALL JOBS DEPENDANT ON THIS
JOB AND ALL JOBS YOUR JOB IS DEPEND
ANT ON. CHECK THIS BEFORE CANCELING
OR FORCE COMPLETING A JOB.
LJOB,JOB=JOBNAME,LIST=TRIG LISTS ALL JOBS TRIGGERED BY THIS
JOB AND ALL JOBS THAT TRIGGER THIS
JOB. CHECK THIS BEFORE CANCELING OR
FORCE COMPLETING A JOB.
LJOB,JOB=JOBNAME,LIST=ALL LISTS ALL INFORMATION ON THIS JOB:
SCHEDULING, RESTART PROCEDURES,
DATA SETS, AND ALL REQUIREMENTS.
LJOB,JOB=JOBNAME,LIST=NODD LISTS ALL INFORMATION ON THIS JOB
EXCEPT FOR DD STATEMENTS.
LJOB,JOB=*,JOBNET=WACC THESE ARE EXAMPLES OF FIELDS FROM
LJOB,JOB=XXXX*,MAINT=Y THE "JOB" SCREEN. WILL LIST THESE
LJOB,JOB=XX*,HOLD=Y FIELDS AND WHATEVER YOU SPECIFY
LJOB,JOB=*,EXEC=N FOR THE PARAMETER.
LJOB,JOB=X*,SCAL=XX
LPROS,JOB=JOBNAME LISTS ALL RESTART INFORMATION FOR
THIS JOB.
LJCL,JOB=JOBNAME LISTS THE PRODUCTION JCL FOR JOB.
LPRRN,JOB=JOBNAME LISTS THE LAST SUCCESSFULL RUN OF
THE JOB. LISTS START AND END TIMES
DATE AND HIGHEST COND CODE.
LPRRN,JOB=JOBNAME,LIST=Q LISTS THE LAST SUCCESSFULL RUN OF
THE JOB. LISTS START AND END TIMES
DATE AND HIGHEST COND CODE. ALSO
SHOWS IF JOB RAN FROM OVERRIDE
LIBRARY.
LRLOG,JOB=JOBNAME, LISTS A JOB FOR THAT JULIAN DATE
DATE=*JULIAN DATE TO SEE IF IT RAN, WAS CANCELED OR
ABENDED.
LRLOG,JOB=*,DATE=*JULIAN DATE LISTS ALL JOBS FOR THAT JULIAN
DATE TO SEE IF THEY RAN, OR WERE
CANCELED, OR ABENDED.
LRLOG,SEQ=JOB,LIST=RSTR,DATE=* LISTS JOBS THAT ABENDED IN LAST 5
DAYS.
LRLOG,SEQ=JOB,ST=CANC,DATE=* LISTS JOBS CANCELED IN LAST 5 DAYS
LDSN,DSN=DATASET NAME,LIST=USERS LISTS ALL JOBS USING THIS DATA SET
AND THE DISPOSITION FOR EACH JOB.
JOB WITH NEW DISP CREATES THE DSN.
SSCAN SHOWS THE NEXT SCHEDULE SCAN OF
CA-7. SHOWS THE NEXT WAKE UP TIME.
SUBTM,JOB=JOBNUMBER,TIME=HHMM TO CHANGE THE SUBMIT TIME FOR A
JOB ALREADY IN THE REQUEST QUE.
MUST USE MILITARY TIME IN HOURS
AND MINUTES. USE THE JOB NUMBER.
ADDRQ,JOB=JOBNAME,DEPJOB=JOBNAME USED TO ADD A JOB DEPENDANCY TO
YOUR JOB. WHEN THE DEPJOB ENDS
RUNNING SUCCESSFULLY, THEN YOUR
JOB WILL BECOME ACTIVE.
ADDRQ,JOB=JOBNAME,USR=COMMENTS TO ADD A COMMENTS DEPENDANCY TO
YOUR JOB SUCH AS 'HOLD FOR PGMR
TO LOOK AT IN THE MORNING'. MUST
BE POSTED BEFORE YOUR JOB WILL RUN
CANCEL,JOB=JOBNUMBER,REASON=XXX TO CANCEL AN ABENDED JOB AND STOP
THE TRIGGERING OF SUBSEQUENT JOBS.
ALSO USED FOR A SKELETON JCL.
DEMAND,JOB=JOBNAME,SCHID=XXX PUTS A JOB IN THE CA-7 REQ QUE.
IF THERE ARE NO REQUIREMENTS TO
BE POSTED, JOB WILL AUTOMATICALLY
BECOME ACTIVE.
DEMANDH,JOB=JOBNAME,SCHID=XXX DEMANDS A JOB INTO THE CA-7 AND
PUTS IT IN THE REQUEST QUE. USED
TO EDIT A JOB. WILL NEED TO POST
THE HOLD REQUIREMENT BEFORE JOB
WILL BECOME ACTIVE. RECOMMENDED.
DEMANDH,JOB=JOBNAME,SET=NTR, DEMANDS A JOB INTO CA-7 AND TELLS
SCHID=XXX CA-7 NOT TO TRIGGER SUBSEQUENT
JOBS WHEN THIS JOB ENDS.
DEMANDH,JOB=JOBNAME,SET=SKP, DEMANDS A JOB INTO CA-7 AND TELLS
SCHID=XXX CA-7 TO SKIP THE NEXT SCHEDULED
RUN OF THIS JOB.
DEMANDH,JOB=JOBNAME,TYPE=RES, DEMANDS A JOB INTO CA-7 AND TELLS
SCHID=XXX CA-7 THIS IS A RESTART OF THE JOB.
RMS IS RESET TO BRING IN ALL DSN
GENERATIONS OF THE LAST RUN.
DEMANDH,JOB=JOBNAME,TIME=HHMM, DEMANDS A JOB INTO CA-7 WITH A
SCHID=XXX TIME REQUIREMENT. USE MILITARY
TIME, HOURS AND MINUTES.
REQUEUE,Q=RDY,JOB=JOBNAME TO REMOVE A JOB FROM THE RDY QUE
AND PUT IT BACK IN THE REQUEST Q.
REQUEUE,Q=ACT,JOB=JOBNAME TO REMOVE A JOB FROM THE ACT QUE
AND PUT IT BACK IN THE REQUEST Q.
USED WHEN SYSTEM CRASHES!!!!!
FJOB,FROM=(MMDDYY,HHMM), TO FORECAST WHEN A JOB IS SCHEDUL-
TO=(MMDDYY,HHMM),JOB=JOBNAME ED TO RUN. USE MONTH DAY YEAR FOR
MMDDYY & HOURS & MINUTES FOR HHMM.
FJOB,FROM=(MMDDYY,HHMM), TO FORECAST WHEN A JOB IS SCHEDUL-
TO=(MMDDYY,HHMM),JOB=XXXX* ED TO RUN. USE MONTH DAY YEAR FOR
MMDDYY AND HOURS AND MINUTES FOR
HHMM. JOB=XXXX* WILL SHOW ALL JOBS
THAT BEGIN WITH THE FIRST FOUR
LETTERS OF THAT JOB.
FJOB,FROM=(MMDDYY,HHMM),SPAN=HH, TO FORECAST WHEN A JOB IS SCHEDUL-
JOB=JOBNAME ED TO RUN. USE MONTH DAY YEAR FOR
MMDDYY AND HOURS AND MINUTES FOR
HHMM. SPAN=HH WHERE HH IS THE NUM-
BER OF HOURS YOU WISH TO SPAN FOR
THE JOB. SHOWS TRIGGERED JOBS.
FQJOB,TO=(MMDDYY,HHMM), FORECASTS SCHEDULE JOB AND IT'S
JOB=JOBNAME,TRIG=JD TRIGGERED JOBS.
FSTRUC,JOB=JOBNAME,SCHID=NNN USED TO TRACK A JOBSTREAM FLOW.
SCHID=NNN WHERE NNN IS THE NUMBER
OF THE SCHEDULED ID. THIS WILL
LIST ALL JOBS TRIGGERED IN THAT
JOBSTREAM. TO UNDERSTAND THE ORDER
OF THE FLOW, CHECK THE LEVEL NUM-
BERS AND THE TRIGGERING JOBS.
FRJOB,JOB=JOBNAME,SCHID=NNN REVERSE FORECAST. USED TO TRACK A
JOBSTREAM FLOW BACKWARDS.
SCHID=NNN WHERE NNN IS THE NUMBER
OF THE SCHEDULED ID. THIS WILL
LIST JOBS IN THAT JOBSTREAM FROM
THE JOB SPECIFIED BACK TO THE
ORIGINAL SCHEDULED JOB. CAN BRING
IN MULTIPLE JOBSTREAMS FOR A SCHID.
LCTLG,DSN=DATASET NAME LISTS THE GENERATIONS, VOLSERS,
DATES AND TIMES FOR A CATALOGED
DATA SET.
CAT,DSN=DSNAME,VOL=XXXX,UNIT=XXX CATALOG DSN. USE VOLSER AND UNIT.
UNC,DSN=DSNAME,VOL=XXXXXX, UNCATALOG A DATA SET, SPECIFY DSN
UNIT=XXXX VOLSER & UNIT. WON'T DELETE DSN.
/SHUTDOWN,Z1 SHUTDOWN CA-7 NETWORK WITH A FAST
SHUTDOWN. LOGS ALL USERS OFF FIRST
USED ONLY ON CA-7 MASTER TERMINAL.
NXTCYC,JOB=JOBNAME,SET=OFF STOPS ALL SCHEDULED RUNS OF THIS
JOB UNTIL SET=ON IS SPECIFIED.
NXTCYC,JOB=JOBNAME,SET=ON STARTS SCHEDULED RUNS OF JOB AGAIN
NXTCYC,JOB=JOBNAME,SET=SKP SKIPS THE NEXT SCHEDULED RUN OF JOB
JOBCONN, USR, JOB=XXXXXXX WHERE XXXXXXX IS THE JOBNAME. THIS
COMMAND WILL ALLOW YOU TO ADD A
USR REQUIREMENT BEFORE THE JOB IS
IN THE REQUEST QUEUE.
JOBCONN,JDEP,JOB=XXXXXXX WHERE XXXXXXX IS THE JOBNAME. THIS
COMMAND WILL ALLOW YOU TO ADD A
JOB DEPENDENCY ON A JOB BEFORE THE JOB
IS IN THE REQUEST QUEUE.
HOLD,JOB=jobname HOLDS A SINGLE JOB CURRENTLY IN
THE REQUEST QUEUE.
HOLD,Q=REQ HOLDS ALL JOBS CURRENTLY IN THE
REQUEST QUEUE. IF NEW JOBS COME
INTO THE QUEUE IT DOESN'T HOLD THEM.
SCHDMOD THIS COMMAND WILL SHOW YOU IF THE
SCHEDULED JOB IS SCHEDULED. A '1'
MEANS IT WILL RUN AND A '0' MEANS
IT WON'T RUN.
LSCHD,JOB=XXXXXXXX,LIST=CALS THIS COMMAND WILL SHOW YOU THE
SCHEDULE FOR A JOB AND IT'S
CALENDARS. IT WILL SHOW IF A JOB
IS SCHEDULED, TRIGGERED OR TRIGGERS
OTHER JOBS.
LSCHD,JOB=XXXXXXXX,LIST=SIDxxx THIS COMMAND WILL SHOW YOU A
(Where xxx is the schid) PARTICULAR SCHID AND IT'S CALENDAR
FOR A JOB. IT WILL SHOW IF THAT
SCHID TRIGGERS OTHER JOBS.
LSCHD,JOB=*,SCAL=XX THIS COMMAND WILL SHOW YOU WHICH
(Where xx is the last 2 JOBS USE A PARTICULAR CALENDAR.
characters of a calendar name)
/DISPLAY,ST=KEY DISPLAYS YOUR PFKEY SETTINGS
/DISPLAY,ST=JCL DISPLAYS THE LIBRARIES WHERE ALL
THE DIFFERENT JCL RESIDES.
LOADH,JOB=JOBNAME,SCHID=XXX, LOADS NEW JCL ONTO THE CA7 DATABASE
SET=NTR BUT DOES NOT EXECUTE THE JOB.
RUNH,JOB=JOBNAME,SCHID=XXX RUNS THE JOB WITHOUT UPDATING THE
LPRRN.
LLOCK,JOB=* SHOWS ALL JOBS THAT ARE LOCKED FOR
WHATEVER REASON. JOBS CAN BE LOCKED
BY SETTING THE NEXT CYCLE TO OFF, OR
A JOB MAY BE SET TO SKIP THE NEXT RUN.
SCHD,DTRG BRINGS UP A MENU WHERE YOU CAN SETUP
DATASET TRIGGERING.
SCHD,JTRG BRINGS UP A MENU WHERE YOU CAN SETUP
JOB TRIGGERING.
Mainframe_Stuffs_Uploader
Friday, March 30, 2012
CA-7 Basics & Commands
CA-7 Basics & Commands
Add a one-time requirement:
Use the ADDRQ command to manually add temporary, one-time, pre-execution user or predecessor job requirements. These requirements must be added to the job while it is in the CA-7 request queue. These added requirements apply only to the current run of the job.
SYNTAX:
Add a job dependency requirement:
ADDRQ,JOB=job name or job number, DEPJOB=job this run is dependent on
Add a user requirement :
ADDRQ,JOB=job name or job number ,USR=text
Cancel a Job :
Use the CANCEL command to delete jobs from the CA-7 queues. This command only removes the job from the CA-7 queues. Cancellation of a job in the CA-7 active queue or ready queue (if it has been submitted) does not cause termination of the job's execution. CPU jobs which may be executing have to be canceled from the operating system separately.
SYNTAX:
CANCEL,JOB=job number or job name, FORCE=YES,REASON=text
(Note: If you want to cancel the job without removing it from the CA-7 queue, do not specify FORCE=YES.)
Change a Job submit time :
Type the 'XQ' top line command to get to the queue maintenance screen. Type a 'U' beside the job you want to update, and hit enter.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPWH3 2877 JOB: GSAJP*
GSAJPWH5 2843 SEQ: ENTRY
GSAJPWH1 2833 QUEUE: REQ
GSAJPWH2 2873 LIST: ALL
GSAJPWH4 2874
GSAJPDH1 2876 FUNCTIONS:
U GSAJPWDE 2773 C=CANCEL
F=RESTART
H=HOLD
J=JCLOVRD
P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 20:34:33
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
The next screen displayed is the CPU Job Attributes screen. Here you can change the job submit time, as well as several other job attributes.
--------------- CA-7 QUEUE MAINTENANCE - CPU JOB ATTRIBUTES ----------
JOB: GSAJPWDE CA-7#: 2773 MCNT: 001 QUEUE: REQ
---------SCHEDULING--------- ------MANUAL REQUIREMENTS-------
DEADLINE TIME.... 98028 2205 JOB HELD...................... N
DUE-OUT TIME..... 98028 2210 MANUAL VERIFICATION REQUIRED.. N
SUBMIT TIME...... 98028 2200 JCL OVERRIDES REQUIRED........ N
MAINID........... ALL
----------RESTART----------- -----------PROMPTING------------
GENERATE CA-11 STEP....... N ELIGIBLE FOR PROMPTS... N
FORMAT CA-11 CMT.......... N PROMPT ACKNOWLEDGED.... N
RETAIN JCL IN PRRN QUEUE.. N LTERM FOR MESSAGES..... MASTER
----------------------------RESOURCES-----------------------------
JOB CLASS............. A JOB PRIORITY.......... 100
ELAPSED TIME (HHMM)... 0000 TAPE DRIVES OF TYPE1.. 000
CPU TIME (MMMSS)...... 00000 TAPE DRIVES OF TYPE2.. 000
PROGRAM: QM40 MSG-INDX: 00 -- QM.3-X -- 98.028 / 20:35:42
MESSAGE: CHANGE DESIRED FIELDS OR ENTER A COMMAND ON THE TOP LINE
Delay schedule start and due out times :
Use the ADDSCH command to delay scheduled start and due-out times for up to 24 hours.
You can use this command for a specific job, or for an entire workload in the case of a major unexpected and unscheduled change in the environment.
Syntax:
ADDSCH,JOB=nnnn or ALL,TIME=mmmm
nnnn specifies the CA-7 job number of a single job
mmmm specifies the amount of time to be added to the start time and due-out time of the job in minutes
e.g. ADDSCH,JOB=2502,TIME=0060
Be careful when using JOB=ALL. This command will then apply to every job in the request, ready, active, and post-process queues.
Demand a Job into request queue :
It is advisable not to use DEMANDH to run nightly cycle jobs during the day. The
post-processing will cause the out-conditions to be posted, possibly allowing any
successors to execute as soon as CA-7 brings them into the request queue. Use
RUNH instead.
Use the DEMANDH top-line command to demand a job into the CA-7 request queue:
DEMANDH,JOB=job name, SCHID=schedule ID
e.g. DEMANDH,JOB=GSAJPORF,SCHID=070
You will be prompted to enter hold information (name, phone, reason for hold). Go to the request queue and review your job to make sure it has the appropriate requirements. If everything looks okay, release the hold requirement.
Schedule ID is required procedurally, but is not required by CA-7. Be extremely careful to use the correct SCHID when demanding jobs into CA-7. If you do not specify a schedule ID, CA-7 will use the first schedule ID it finds in the CA-7 database, which may not be the one you want.
Edit the execution JCL :
Note: If you are not the on-call SE but plan to restart a job, you need to contact the on-call SE and let them know. When you edit the execution JCL in CA-7 it does not prevent someone else from editing the dataset and they can overlay your changes.
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to edit and type an 'E' beside it and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
E GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
HOLD A JOB :
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to hold, type an 'H' beside it, and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
H GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
POST JOB REQUIREMENTS:
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to view requirements on. Type an 'X' beside it and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
X GSAJPWH2 2502 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
You will see the job requirements on the following screen. To post a requirement, type an 'X' beside the job name and hit enter.
-------------- CA-7 QUEUE MAINTENANCE - CPU JOB PREDECESSORS ---------
JOB: GSAJPWH2 CA-7#: 2502 MCNT: 001
F-TYP-NUMBER-E-DESCRIPTION
X SUB WAITING FOR SUBMIT TIME (16:45)
PULL JCL FROM ALTERNATE LIBRARY:
When a job comes into the request queue, CA-7 will first search the alternate library for the JCL. If the member name is found in the alternate library, the JCL will be pulled from there. If the member is not in the alternate library, then CA-7 will search the champ JCL library.
JCL Library JCL ID
PGSAJ.SSBCH.JCLPDS 013
PGSAJ.SSBLB.DYNJCL 104 Alternate Library for 013
The alternate library will be used for JCL overrides (e.g. coding the JCL to pull a source member from FIXLIB instead of PRODLIB.) It will also be used for any JCL that gets written out from an ALC module (Draw, Catalog).
We have EID write access to the alternate library.
RELEASE A HOLD REQUIREMENT:
To release a job that has been put on hold, enter the 'XQ' topline command to go to the queue maintenance screen. Type an 'R' beside the job you want to release, and hit enter.
(Note: Posting the hold requirement accomplishes the same thing as using the Release.)
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPWH3 2877 JOB: GSAJP*
GSAJPWH5 2843 SEQ: ENTRY
GSAJPWH1 2833 QUEUE: REQ
GSAJPWH2 2873 LIST: ALL
GSAJPWH4 2874
GSAJPDH1 2876 FUNCTIONS:
R GSAJPWDE 2773 C=CANCEL
F=RESTART
H=HOLD
J=JCLOVRD
P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 20:29:50
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
REQUEUE A JOB:
The easiest way to requeue a job is with the requeue command:
REQUEUE,JOB= jobnumber or jobname
You can also accomplish this through the queue maintenance screen. Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to requeue, type a 'Q' beside it, and hit the Enter key.
Note: If the job is in another queue, you can use the XQ,Q=RDY command to get to the ready queue, or use the XQ,Q=ACT command to get to the active queue.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS -----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
Q GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
RESTART A JOB:
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to restart, type an 'F' beside it, and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS -----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
F GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
(Note: If the job is not in the ready queue, you will have to requeue the job before it can be restarted.)
The next screen displayed will be the "CPU JOB IN RESTART STATUS" screen. Enter your reason for restarting the job, type an 'X' beside RESUBMIT FOR PRODUCTION, and hit enter.
-------- CA-7 QUEUE MAINTENANCE - CPU JOB IN RESTART STATUS ---------
JOB: GSAJPWH2 CODE: JCL-ERROR LAST-STEP MCNT: 001
CA-7#: 2433 JES#: 20505 NODE-NAME: LOCAL
REASON: JOB NOT RUN DUE TO ERROR. RESUBMIT PER SE.
-- X -- RESUBMIT FOR PRODUCTION
-- -- FORCE COMPLETE
.
.
.{The rest of this screen contains CA-11 restart options.
DO NOT UNDER ANY CIRCUMSTANCES RESTART USING ANY OF THESE OPTIONS!!!
Our jobs are not set up for CA-11 restart and you can screw up royally.}
VIEW JOBS IN REQUEST QUEUE:
XQ -> Lists all jobs in request queue (but only the jobs you have ACF2 authority to view)
XQJ -> Lists jobs in jobname sequence
XQM -> Lists jobs and a summary of job requirements
To view the jobs in other queues add Q=queue parameter
Eg: XQ,Q=RDY to view the ready queue
XQ,Q=ACT to view the active queue
CA-JCL check:
Use the LJCK command to list JCL for a CA-7 job. JCL is fetched from the library indicated on the DB.1 panel or its alternate. LJCK keyword values for DATE, TIME, and SCHID may affect the display if scheduled overrides such as #JI and #JO are used. If the CA-Driver procedures are used, LJCK displays CA-Driver JCL modifications.
Syntax:
LJCK,JOB=jobname,DATE=YYDDD,TIME=hhmm,SCHID=nnn
DATE, TIME and SCHID parameters are optional.
The execution JCL for the specified job will be evaluated by CA-JCLCheck and all JCL substitutions, procedure expansions, errors, and other messages returned by CA-JCLCheck will be displayed inline following the relevant execution JCL statements.
CA-7 JCL overrides:
#JI Overrides
Indicates the statement are to be included based on the specified scheduling criteria.
#JO Overrides
Indicates the statements are to be omitted based on the specified scheduling criteria.
#JEND
Indicates the end of a set of override control statements
#SCC
Statements placed within the JCL to define step level condition code tests used to determine whether the job completed successfully. To use these statements, the job must be defined on the DB.1 screen with a condition code of 0 (zero) and the relational operator of #S.
Additional overrides and examples may be found in the CA-7 Database Maintenance Guide Section 10.
CA-7 Commands
/DISPLAY,ST=JCL
Use this command to obtain information about the JCL libraries attached to the CA-7. The ST=JCL parameter provides the information about the JCL libraries and their associated ID number.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/DISPLAY,PRINT=SCH
Use this command to obtain the information about Schedule Scan (SSCAN). The PRINT=SCH provides the information about SSCAN such as INCR, SPAN, QDWELL intervals and the next run.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CANCEL
CANCEL,JOB=jobname or job number,FORCE=YES,REASON=text
Cancels job out of CA-7 Request Queue.
If job is in the Ready or Active queues, cancelling it in CA-7 would not prevent the job from running. It would only prevent CA-7 from tracking the job. If you need to cancel a job that is awaiting execution (ready queue) or executing (active queue), cancel it from SAM or call the operator and have them cancel the job.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
DEMANDH
DEMANDH,JOB=jobname,SCHID=nnn
Use this command to request a job to run in CA-7. This command will place a HOLD on the job which must be posted. A reason will be required. The SCHID parameter should be nnn if triggering is not to be done. If triggering is needed, then the appropriate SCHID should be supplied. Caution should be used when executing jobs from the batch cycle during the day. Doing so could cause problems during the next nightly cycle.See also RUNH
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FJOB,FROM=,TO=
FJOB,FROM=(mmddyy,hhmm),TO=(mmddyy,hhmm),SYS=GSAJKJ
Use this command to obtain forecasted job execution information for jobs in a specified system for a specified date and time period.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FJOB,SPAN=
FJOB,SPAN=hh,SYS=GSAJKJ
Use this command to obtain forecasted job execution information for jobs in a specified system for a specified future time span in hours.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FSTRUC,JOB=
FSTRUC,JOB=jobname,LIST=ALL
Use this command to obtain job flow structure information for a job. The LIST=ALL parameter provides the job trigger relationships and the elapsed time of each job
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LACT,JOB=
LACT,JOB=jobname or SYS=sysname
Use this command to obtain CA-7 information on jobs in the active queue. The JOB=jobname parameter can be a specific job or can be a generic mask such as JOB=GSAJ*. The SYS=system name parameter can be either an ‘*’ indicating all systems or the value must be a specific system name.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LDSN,DSN=
LDSN,DSN=dataset name or dataset number,LIST=ALL
Use this command to obtain information about a dataset. The DSN parameter can be used with the dataset name or dataset number if known. The LIST=ALL parameter provides information about the dataset, the using jobs and any documentation entries.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LJCL,JOB=
LJCL,JOB=jobname
Use this command to review the JCL contained in the associated JCL library.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LJOB,JOB=
LJOB,JOB=jobname,LIST=ALL or LIST=TRIG
Use this command to obtain miscellaneous information about a job. The LIST=ALL parameter provides information about the job requirements, triggers and characteristics or attributes.LIST=TRIG parameter provides information about the job triggers.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=
LQ,JOB=jobname
Use this command to obtain CA-7 information on the jobs in the ready, request and active queues
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=,ST=ABND
LQ,JOB=jobname,ST=ABND
Use this command to obtain CA-7 information on the jobs in the request that are in abend status.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=,ST=LATE
LQ,JOB=jobname,ST=LATE
Use this command to obtain CA-7 information on the jobs in the request that are in late status.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LPROS,JOB=
LPROS,JOB=jobname
Use this command to review the prose for a job.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LPRRN,JOB=
LPRRN,JOB=jobname,LIST=ALL
Use this command to review the last run of a job. The information is obtained from the prior-run queue. The LIST=ALL parameter is optional and provides all data relative to the queue.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LRLOG,SPAN=,SYS=
LRLOG,SPAN=hh,SYS=system name
Use this command to review the run log information for jobs in a specified system for the specified span of time in hours.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LSCHD,JOB=LIST=
LSCHD,JOB=jobname,LIST=SIDnnn or LIST=BYSID
Use this command to obtain information about the schedule(s) for a job. The SCAL=SIDnnn parameter provides the schedule information for a specific schedule identifier (SCHID). (The ‘nnn’ in the SIDnnn should be the SCHID.) The LIST=BYSID parameter provides scheduling information for all SCHIDs. This is useful if a job has multiple SCHIDs. A month-by-month calendar is displayed for both parameters.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
REQUEUE,JOB=
REQUEUE,JOB=jobname,Q=ACT or Q=RDY
Use this command to move a member from one the ready or active queue to the request queue. The Q=queue name parameter is optional. If the Q=queue name parameter is not used, then the RDY and ACT queues are both searched. This command must be used whenever a job enters the request queue in skeleton mode (no JCL attached to job).
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
RUNH,JOB=
RUNH,JOB=jobname
Use this command to execute a special run of a job so that requirements will not be posted, and jobs will not be triggered. This command places a HOLD on the job which must be posted.Note that any mutually exclusive conditions the jobs have (which are requirements) will not take effect.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
XQJ,JOB=
XQJ,JOB=jobname,Q=REQ or Q=RDY or Q=ACT
Use this command to review and/or perform actions on the request queue. The JOB=jobname parameter may be a specific jobname or generic such as JOB=GSAJKN*. The Q=queue name parameter is optional and the queue name may be REQ (request), RDY (ready) or ACT (active). The list is displayed in jobname sequence. If no members are found matching the jobname criteria, the QUEUE MAINTENANCE panel is displayed.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
XQM,JOB=
XQM,JOB=jobname,Q=REQ or Q=RDY or Q=ACT
Use this command to review and/or perform actions on the request queue. The JOB=jobname parameter may be a specific jobname or generic such as JOB=GSAJKN*. The Q=queue name parameter is optional and the queue name may be REQ (request), RDY (ready) or ACT (active). The list is displayed in jobname sequence and a summary of the requirements is displayed. If no members are found matching the jobname criteria, the QUEUE MAINTENANCE panel is displayed.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Add a one-time requirement:
Use the ADDRQ command to manually add temporary, one-time, pre-execution user or predecessor job requirements. These requirements must be added to the job while it is in the CA-7 request queue. These added requirements apply only to the current run of the job.
SYNTAX:
Add a job dependency requirement:
ADDRQ,JOB=job name or job number, DEPJOB=job this run is dependent on
Add a user requirement :
ADDRQ,JOB=job name or job number ,USR=text
Cancel a Job :
Use the CANCEL command to delete jobs from the CA-7 queues. This command only removes the job from the CA-7 queues. Cancellation of a job in the CA-7 active queue or ready queue (if it has been submitted) does not cause termination of the job's execution. CPU jobs which may be executing have to be canceled from the operating system separately.
SYNTAX:
CANCEL,JOB=job number or job name, FORCE=YES,REASON=text
(Note: If you want to cancel the job without removing it from the CA-7 queue, do not specify FORCE=YES.)
Change a Job submit time :
Type the 'XQ' top line command to get to the queue maintenance screen. Type a 'U' beside the job you want to update, and hit enter.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPWH3 2877 JOB: GSAJP*
GSAJPWH5 2843 SEQ: ENTRY
GSAJPWH1 2833 QUEUE: REQ
GSAJPWH2 2873 LIST: ALL
GSAJPWH4 2874
GSAJPDH1 2876 FUNCTIONS:
U GSAJPWDE 2773 C=CANCEL
F=RESTART
H=HOLD
J=JCLOVRD
P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 20:34:33
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
The next screen displayed is the CPU Job Attributes screen. Here you can change the job submit time, as well as several other job attributes.
--------------- CA-7 QUEUE MAINTENANCE - CPU JOB ATTRIBUTES ----------
JOB: GSAJPWDE CA-7#: 2773 MCNT: 001 QUEUE: REQ
---------SCHEDULING--------- ------MANUAL REQUIREMENTS-------
DEADLINE TIME.... 98028 2205 JOB HELD...................... N
DUE-OUT TIME..... 98028 2210 MANUAL VERIFICATION REQUIRED.. N
SUBMIT TIME...... 98028 2200 JCL OVERRIDES REQUIRED........ N
MAINID........... ALL
----------RESTART----------- -----------PROMPTING------------
GENERATE CA-11 STEP....... N ELIGIBLE FOR PROMPTS... N
FORMAT CA-11 CMT.......... N PROMPT ACKNOWLEDGED.... N
RETAIN JCL IN PRRN QUEUE.. N LTERM FOR MESSAGES..... MASTER
----------------------------RESOURCES-----------------------------
JOB CLASS............. A JOB PRIORITY.......... 100
ELAPSED TIME (HHMM)... 0000 TAPE DRIVES OF TYPE1.. 000
CPU TIME (MMMSS)...... 00000 TAPE DRIVES OF TYPE2.. 000
PROGRAM: QM40 MSG-INDX: 00 -- QM.3-X -- 98.028 / 20:35:42
MESSAGE: CHANGE DESIRED FIELDS OR ENTER A COMMAND ON THE TOP LINE
Delay schedule start and due out times :
Use the ADDSCH command to delay scheduled start and due-out times for up to 24 hours.
You can use this command for a specific job, or for an entire workload in the case of a major unexpected and unscheduled change in the environment.
Syntax:
ADDSCH,JOB=nnnn or ALL,TIME=mmmm
nnnn specifies the CA-7 job number of a single job
mmmm specifies the amount of time to be added to the start time and due-out time of the job in minutes
e.g. ADDSCH,JOB=2502,TIME=0060
Be careful when using JOB=ALL. This command will then apply to every job in the request, ready, active, and post-process queues.
Demand a Job into request queue :
It is advisable not to use DEMANDH to run nightly cycle jobs during the day. The
post-processing will cause the out-conditions to be posted, possibly allowing any
successors to execute as soon as CA-7 brings them into the request queue. Use
RUNH instead.
Use the DEMANDH top-line command to demand a job into the CA-7 request queue:
DEMANDH,JOB=job name, SCHID=schedule ID
e.g. DEMANDH,JOB=GSAJPORF,SCHID=070
You will be prompted to enter hold information (name, phone, reason for hold). Go to the request queue and review your job to make sure it has the appropriate requirements. If everything looks okay, release the hold requirement.
Schedule ID is required procedurally, but is not required by CA-7. Be extremely careful to use the correct SCHID when demanding jobs into CA-7. If you do not specify a schedule ID, CA-7 will use the first schedule ID it finds in the CA-7 database, which may not be the one you want.
Edit the execution JCL :
Note: If you are not the on-call SE but plan to restart a job, you need to contact the on-call SE and let them know. When you edit the execution JCL in CA-7 it does not prevent someone else from editing the dataset and they can overlay your changes.
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to edit and type an 'E' beside it and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
E GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
HOLD A JOB :
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to hold, type an 'H' beside it, and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
H GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
POST JOB REQUIREMENTS:
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to view requirements on. Type an 'X' beside it and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
X GSAJPWH2 2502 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
You will see the job requirements on the following screen. To post a requirement, type an 'X' beside the job name and hit enter.
-------------- CA-7 QUEUE MAINTENANCE - CPU JOB PREDECESSORS ---------
JOB: GSAJPWH2 CA-7#: 2502 MCNT: 001
F-TYP-NUMBER-E-DESCRIPTION
X SUB WAITING FOR SUBMIT TIME (16:45)
PULL JCL FROM ALTERNATE LIBRARY:
When a job comes into the request queue, CA-7 will first search the alternate library for the JCL. If the member name is found in the alternate library, the JCL will be pulled from there. If the member is not in the alternate library, then CA-7 will search the champ JCL library.
JCL Library JCL ID
PGSAJ.SSBCH.JCLPDS 013
PGSAJ.SSBLB.DYNJCL 104 Alternate Library for 013
The alternate library will be used for JCL overrides (e.g. coding the JCL to pull a source member from FIXLIB instead of PRODLIB.) It will also be used for any JCL that gets written out from an ALC module (Draw, Catalog).
We have EID write access to the alternate library.
RELEASE A HOLD REQUIREMENT:
To release a job that has been put on hold, enter the 'XQ' topline command to go to the queue maintenance screen. Type an 'R' beside the job you want to release, and hit enter.
(Note: Posting the hold requirement accomplishes the same thing as using the Release.)
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS ----------------
F-JOBNAME--CA7#
GSAJPWH3 2877 JOB: GSAJP*
GSAJPWH5 2843 SEQ: ENTRY
GSAJPWH1 2833 QUEUE: REQ
GSAJPWH2 2873 LIST: ALL
GSAJPWH4 2874
GSAJPDH1 2876 FUNCTIONS:
R GSAJPWDE 2773 C=CANCEL
F=RESTART
H=HOLD
J=JCLOVRD
P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 20:29:50
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
REQUEUE A JOB:
The easiest way to requeue a job is with the requeue command:
REQUEUE,JOB= jobnumber or jobname
You can also accomplish this through the queue maintenance screen. Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to requeue, type a 'Q' beside it, and hit the Enter key.
Note: If the job is in another queue, you can use the XQ,Q=RDY command to get to the ready queue, or use the XQ,Q=ACT command to get to the active queue.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS -----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
Q GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
RESTART A JOB:
Type the XQ top line command to get to the CA-7 Queue Maintenance Screen. Tab down to the job you want to restart, type an 'F' beside it, and hit the Enter key.
----------------- CA-7 QUEUE MAINTENANCE - CPU JOBS STATUS -----------------
F-JOBNAME--CA7#
GSAJPF24 2459 JOB: GSAJP*
GSAJPDH1 2449 SEQ: ENTRY
GSAJPWH5 2450 QUEUE: REQ
GSAJPWH3 2451 LIST: ALL
GSAJPWH4 2454
GSAJPPD2 2384 FUNCTIONS:
GSAJPBDH 2386 C=CANCEL
GSAJPBH5 2431 F=RESTART
GSAJPWH1 2430 H=HOLD
F GSAJPWH2 2433 J=JCLOVRD
GSAJPF37 2480 P=RSVP
Q=REQUEUE
R=RELEASE
S=SUBTM OFF
U=UPDATE
V=VERIFY
X=RQMT POST
E=EDIT QJCL
PROGRAM: QM20 MSG-INDX: 00 -- QM.1-X -- 98.028 / 16:10:38
MESSAGE: ENTER FUNCTION IN 'F' FIELD OR ENTER A COMMAND ON THE TOP LINE
(Note: If the job is not in the ready queue, you will have to requeue the job before it can be restarted.)
The next screen displayed will be the "CPU JOB IN RESTART STATUS" screen. Enter your reason for restarting the job, type an 'X' beside RESUBMIT FOR PRODUCTION, and hit enter.
-------- CA-7 QUEUE MAINTENANCE - CPU JOB IN RESTART STATUS ---------
JOB: GSAJPWH2 CODE: JCL-ERROR LAST-STEP MCNT: 001
CA-7#: 2433 JES#: 20505 NODE-NAME: LOCAL
REASON: JOB NOT RUN DUE TO ERROR. RESUBMIT PER SE.
-- X -- RESUBMIT FOR PRODUCTION
-- -- FORCE COMPLETE
.
.
.{The rest of this screen contains CA-11 restart options.
DO NOT UNDER ANY CIRCUMSTANCES RESTART USING ANY OF THESE OPTIONS!!!
Our jobs are not set up for CA-11 restart and you can screw up royally.}
VIEW JOBS IN REQUEST QUEUE:
XQ -> Lists all jobs in request queue (but only the jobs you have ACF2 authority to view)
XQJ -> Lists jobs in jobname sequence
XQM -> Lists jobs and a summary of job requirements
To view the jobs in other queues add Q=queue parameter
Eg: XQ,Q=RDY to view the ready queue
XQ,Q=ACT to view the active queue
CA-JCL check:
Use the LJCK command to list JCL for a CA-7 job. JCL is fetched from the library indicated on the DB.1 panel or its alternate. LJCK keyword values for DATE, TIME, and SCHID may affect the display if scheduled overrides such as #JI and #JO are used. If the CA-Driver procedures are used, LJCK displays CA-Driver JCL modifications.
Syntax:
LJCK,JOB=jobname,DATE=YYDDD,TIME=hhmm,SCHID=nnn
DATE, TIME and SCHID parameters are optional.
The execution JCL for the specified job will be evaluated by CA-JCLCheck and all JCL substitutions, procedure expansions, errors, and other messages returned by CA-JCLCheck will be displayed inline following the relevant execution JCL statements.
CA-7 JCL overrides:
#JI Overrides
Indicates the statement are to be included based on the specified scheduling criteria.
#JO Overrides
Indicates the statements are to be omitted based on the specified scheduling criteria.
#JEND
Indicates the end of a set of override control statements
#SCC
Statements placed within the JCL to define step level condition code tests used to determine whether the job completed successfully. To use these statements, the job must be defined on the DB.1 screen with a condition code of 0 (zero) and the relational operator of #S.
Additional overrides and examples may be found in the CA-7 Database Maintenance Guide Section 10.
CA-7 Commands
/DISPLAY,ST=JCL
Use this command to obtain information about the JCL libraries attached to the CA-7. The ST=JCL parameter provides the information about the JCL libraries and their associated ID number.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/DISPLAY,PRINT=SCH
Use this command to obtain the information about Schedule Scan (SSCAN). The PRINT=SCH provides the information about SSCAN such as INCR, SPAN, QDWELL intervals and the next run.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
CANCEL
CANCEL,JOB=jobname or job number,FORCE=YES,REASON=text
Cancels job out of CA-7 Request Queue.
If job is in the Ready or Active queues, cancelling it in CA-7 would not prevent the job from running. It would only prevent CA-7 from tracking the job. If you need to cancel a job that is awaiting execution (ready queue) or executing (active queue), cancel it from SAM or call the operator and have them cancel the job.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
DEMANDH
DEMANDH,JOB=jobname,SCHID=nnn
Use this command to request a job to run in CA-7. This command will place a HOLD on the job which must be posted. A reason will be required. The SCHID parameter should be nnn if triggering is not to be done. If triggering is needed, then the appropriate SCHID should be supplied. Caution should be used when executing jobs from the batch cycle during the day. Doing so could cause problems during the next nightly cycle.See also RUNH
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FJOB,FROM=,TO=
FJOB,FROM=(mmddyy,hhmm),TO=(mmddyy,hhmm),SYS=GSAJKJ
Use this command to obtain forecasted job execution information for jobs in a specified system for a specified date and time period.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FJOB,SPAN=
FJOB,SPAN=hh,SYS=GSAJKJ
Use this command to obtain forecasted job execution information for jobs in a specified system for a specified future time span in hours.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
FSTRUC,JOB=
FSTRUC,JOB=jobname,LIST=ALL
Use this command to obtain job flow structure information for a job. The LIST=ALL parameter provides the job trigger relationships and the elapsed time of each job
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LACT,JOB=
LACT,JOB=jobname or SYS=sysname
Use this command to obtain CA-7 information on jobs in the active queue. The JOB=jobname parameter can be a specific job or can be a generic mask such as JOB=GSAJ*. The SYS=system name parameter can be either an ‘*’ indicating all systems or the value must be a specific system name.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LDSN,DSN=
LDSN,DSN=dataset name or dataset number,LIST=ALL
Use this command to obtain information about a dataset. The DSN parameter can be used with the dataset name or dataset number if known. The LIST=ALL parameter provides information about the dataset, the using jobs and any documentation entries.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LJCL,JOB=
LJCL,JOB=jobname
Use this command to review the JCL contained in the associated JCL library.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LJOB,JOB=
LJOB,JOB=jobname,LIST=ALL or LIST=TRIG
Use this command to obtain miscellaneous information about a job. The LIST=ALL parameter provides information about the job requirements, triggers and characteristics or attributes.LIST=TRIG parameter provides information about the job triggers.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=
LQ,JOB=jobname
Use this command to obtain CA-7 information on the jobs in the ready, request and active queues
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=,ST=ABND
LQ,JOB=jobname,ST=ABND
Use this command to obtain CA-7 information on the jobs in the request that are in abend status.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LQ,JOB=,ST=LATE
LQ,JOB=jobname,ST=LATE
Use this command to obtain CA-7 information on the jobs in the request that are in late status.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LPROS,JOB=
LPROS,JOB=jobname
Use this command to review the prose for a job.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LPRRN,JOB=
LPRRN,JOB=jobname,LIST=ALL
Use this command to review the last run of a job. The information is obtained from the prior-run queue. The LIST=ALL parameter is optional and provides all data relative to the queue.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LRLOG,SPAN=,SYS=
LRLOG,SPAN=hh,SYS=system name
Use this command to review the run log information for jobs in a specified system for the specified span of time in hours.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
LSCHD,JOB=LIST=
LSCHD,JOB=jobname,LIST=SIDnnn or LIST=BYSID
Use this command to obtain information about the schedule(s) for a job. The SCAL=SIDnnn parameter provides the schedule information for a specific schedule identifier (SCHID). (The ‘nnn’ in the SIDnnn should be the SCHID.) The LIST=BYSID parameter provides scheduling information for all SCHIDs. This is useful if a job has multiple SCHIDs. A month-by-month calendar is displayed for both parameters.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
REQUEUE,JOB=
REQUEUE,JOB=jobname,Q=ACT or Q=RDY
Use this command to move a member from one the ready or active queue to the request queue. The Q=queue name parameter is optional. If the Q=queue name parameter is not used, then the RDY and ACT queues are both searched. This command must be used whenever a job enters the request queue in skeleton mode (no JCL attached to job).
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
RUNH,JOB=
RUNH,JOB=jobname
Use this command to execute a special run of a job so that requirements will not be posted, and jobs will not be triggered. This command places a HOLD on the job which must be posted.Note that any mutually exclusive conditions the jobs have (which are requirements) will not take effect.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
XQJ,JOB=
XQJ,JOB=jobname,Q=REQ or Q=RDY or Q=ACT
Use this command to review and/or perform actions on the request queue. The JOB=jobname parameter may be a specific jobname or generic such as JOB=GSAJKN*. The Q=queue name parameter is optional and the queue name may be REQ (request), RDY (ready) or ACT (active). The list is displayed in jobname sequence. If no members are found matching the jobname criteria, the QUEUE MAINTENANCE panel is displayed.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
XQM,JOB=
XQM,JOB=jobname,Q=REQ or Q=RDY or Q=ACT
Use this command to review and/or perform actions on the request queue. The JOB=jobname parameter may be a specific jobname or generic such as JOB=GSAJKN*. The Q=queue name parameter is optional and the queue name may be REQ (request), RDY (ready) or ACT (active). The list is displayed in jobname sequence and a summary of the requirements is displayed. If no members are found matching the jobname criteria, the QUEUE MAINTENANCE panel is displayed.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Tips on VSAM
Tips on VSAM
1. What are the different types of VSAM files available?
ESDS: Entry Sequence Data Set
KSDS: Key Sequence Data Set
RRDS: Relative Data Set
2. What is IDCAMS ?
IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).
3. Can AMS commands be run from the TSO prompt ?
Yes
4. Syntax of AMS modal commands ?
Note: these can be used only under IDCAMS and not from the TSO prompt.
IF LASTCC(or MAXCC) >(or <,= etc..) value -
THEN -
DO -
command set (such as DELETE, DEFINE etc..)
ELSE -
DO -
command set
LASTCC - Condition code from the last function(such as delete) executed
MAXCC - Max condition code that was returned by any of the prev functions
SET is also a valid AMS command. SET LASTCC (or MAXCC) = value
The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of 8 is usually encountered on a DELETE of a dataset that is not present.
5. Under IDCAMS , multiple functions can be executed, each of which returns a cond code. What will be the condition code returned to the operating system ?
The maximum condition code generated is returned as the condition code of the IDCAMS step.
6. What is Control Interval, Control Area
Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked.
Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation type (cyl, tracks or records) and can be max of 1 cylinder
7. What is FREESPACE ?
Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.
8. How do you decide on optimum values for CI, FREESPACE etc...
CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), chose 6K or 8K.
FREESPACE should be large if more number of insertions are envisaged. Usual values are (20 20) when heavy updates are expected. CI size can be calculated.
9. Would you specify FREESPACE for an ESDS?
No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for freespace does not make any sense.
10. What is SHAREOPTS ?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share the file, while b is the cross system share option ie how two or more jobs on different MVSes can share the file. Usual value is (2 3).
11. What is the meaning of each of the values in SHAREOPTS(2 3)?
Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).
12. How do you define a KSDS ?
DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component & the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHAREOPTIONS.
13. How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS pgms ?
DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify the base cluster name, KEYS, RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY), DATA(ds name for the data component), INDEX(ds name for the index component).
Then DEFINE PATH. Important paramters are NAME (ds name for the path), PATHENTRY (ds name of the alternate index name), UPDATE(or NOUPDATE) which specifies whether an alt index is updated when a update to the base cluster takes place.
Then BLDINDEX. Parameters are INDATASET(ds name of base cluster), OUTDATASET(ds name of AIX).
Using alternate indexes in batch pgms:
In the JCL, you must have DD stmts for the cluster and for the path(s). In the cobol pgm, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS... ALTERNATE RECORD KEY IS..
Using alternate indexes in CICS pgms:
FCT entries must be created for both base cluster & the path. To read using the alternate index, use the dd name of the path in CICS file control commands.
14. What happens when you open an empty VSAM file in a COBOL program for input?
A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.
15. How do you initialize a VSAM file before any operation? a VSAM with alternate index?
Can write a dummy program that just opens the file for output & then closes it.
16. What does a file status of 02 on a VSAM indicate?
Duplicate alternate key . Happens on both input and output operation
17. How do you calculate record size of an alternate cluster? Give your values for both unique and non-unique.
Unique Case: 5 + ( alt-key-length + primary-key )
Nonunique Case: 5 + ( alt-key-length + n * primary-key )
where n = # of duplicate records for the alternate key
???? Ramesh - can you explain ?
18. What is the difference between sequential files and ESDS files?
Sequential(QSAM) files can be created on tape while ESDS files cannot.
Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.
19. How do you load a VSAM data set with records ?
Using the REPRO command.
20. How do you define a GDG ?
Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0)
21. Do all versions of the GDG have to be of the same record length ?
No, the DCB of the model dataset can be overridden when you allocate new versions.
22. How are different versions of GDG named ?
base-file-name.GnnnnnV00 where nnnn= generation number (upto 255).
nnnn will be 0000 for the 1st generation.
23. Suppose 3 generations of a GDG exist. How would you reference the 1 st generation in the JCL? - GS
Use GDG name(-2).
24. Suppose a generation of GDG gets created in a particular step of a proc. How would you refer the current generation in a subsequent step? What would be the disposition of this generation now? - GS
Relative generation numbers are updated only at the end of the job, not at the end of a step. To allocate a new generation, we would be using (+1) with a DISP of (NEW,CATLG,DELETE). To refer to this in a subsequent step in the same job, we would again use (+1) but with a DISP of SHR or OLD.
25. What more info you should give in the DD statement while defining the next generation of a GDG? - GS
Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can give the dcb parameter if you want to override the dcb of the model dataset.
26. Assuming that the DEFINE jcl is not available, how do you get info about a VSAM file’s organisation ?
Use the LISTCAT command.
27. During processing of a VSAM file, some system error occurs and it is subsequently unusable . What do you do ?
Run VERIFY.
54. What is SSRANGE, NOSSRANGE ?
These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.
55. How do you set a return code to the JCL from a COBOL program?
Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.
56. How can you submit a job from COBOL programs?
Write JCL cards to a dataset with
//xxxxxxx SYSOUT=(A,INTRDR) where ‘A’ is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.
57. What are the differences between OS VS COBOL and VS COBOL II?
OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes.
Report writer is supported only in OS/VS Cobol.
USAGE IS POINTER is supported only in VS COBOL II.
Reference modification eg: WS-VAR(1:2) is supported only in VS COBOL II.
EVALUATE is supported only in VS COBOL II.
Scope terminators are supported only in VS COBOL II.
OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.
Under CICS Calls between VS COBOL II programs are supported.
58. What are the steps you go through while creating a COBOL program executable?
DB2 precompiler(if embedded sql used), CICS translator (if CICS pgm), Cobol compiler, Link editor.
1. What are the different types of VSAM files available?
ESDS: Entry Sequence Data Set
KSDS: Key Sequence Data Set
RRDS: Relative Data Set
2. What is IDCAMS ?
IDCAMS is the Access Method Services program. You run the IDCAMS program and supply AMS commands thru SYSIN. (examples of AMS commands are DELETE, DEFINE, REPRO etc..).
3. Can AMS commands be run from the TSO prompt ?
Yes
4. Syntax of AMS modal commands ?
Note: these can be used only under IDCAMS and not from the TSO prompt.
IF LASTCC(or MAXCC) >(or <,= etc..) value -
THEN -
DO -
command set (such as DELETE, DEFINE etc..)
ELSE -
DO -
command set
LASTCC - Condition code from the last function(such as delete) executed
MAXCC - Max condition code that was returned by any of the prev functions
SET is also a valid AMS command. SET LASTCC (or MAXCC) = value
The maximum condition code is 16. A cond code of 4 indicates a warning. A cond code of 8 is usually encountered on a DELETE of a dataset that is not present.
5. Under IDCAMS , multiple functions can be executed, each of which returns a cond code. What will be the condition code returned to the operating system ?
The maximum condition code generated is returned as the condition code of the IDCAMS step.
6. What is Control Interval, Control Area
Control Interval is analogous to a physical block for QSAM files. It is the unit of i/o. Must be between 512 bytes to 32 k. Usually either 2K or 4K. A larger control interval increases performance for sequential processing while the reverse is true for random access. Under CICS when a record is locked, the entire CI gets locked.
Control area is a group of control intervals. CA is used during allocation. CA size is calculated based on the allocation type (cyl, tracks or records) and can be max of 1 cylinder
7. What is FREESPACE ?
Coded in the DEFINE as FREESPACE(ci ca) where ci is the percentage of each control interval to be left free for insertions, ca is the percentage of control intervals in each control area to be left empty.
8. How do you decide on optimum values for CI, FREESPACE etc...
CI size should be based on record length, type of processing. Usually CI is 4K. If record length is larger(>1K), chose 6K or 8K.
FREESPACE should be large if more number of insertions are envisaged. Usual values are (20 20) when heavy updates are expected. CI size can be calculated.
9. Would you specify FREESPACE for an ESDS?
No. Because you cannot insert records in an ESDS, also when you rewrite a record, it must be of the same length. Thus putting any value for freespace does not make any sense.
10. What is SHAREOPTS ?
SHAREOPTS is a parameter in the DEFINE and specifies how an object can be shared among users. It is coded as SHAREOPTS(a b), where a is the cross region share option ie how two or more jobs on a single system can share the file, while b is the cross system share option ie how two or more jobs on different MVSes can share the file. Usual value is (2 3).
11. What is the meaning of each of the values in SHAREOPTS(2 3)?
Value of 2 for cross region means that the file can be processed simultaneously by multiple users provided only one of them is an updater. Value of 3 for cross system means that any number of jobs can process the file for input or output (VSAM does nothing to ensure integrity).
12. How do you define a KSDS ?
DEFINE CLUSTER(cluster name) with the INDEXED parameter. Also specify the ds name for the DATA component & the ds INDEX component. Other important parms are RECORDSIZE, KEYS, SHAREOPTIONS.
13. How do you define an ALTINDX ? How do you use ALTINDXs in batch, CICS pgms ?
DEFINE ALTERNATEINDEX. Important paramters are RELATE where you specify the base cluster name, KEYS, RECORDSIZE,SHAREOPTIONS,UNIQUEKEY(or NONUNIQUEKEY), DATA(ds name for the data component), INDEX(ds name for the index component).
Then DEFINE PATH. Important paramters are NAME (ds name for the path), PATHENTRY (ds name of the alternate index name), UPDATE(or NOUPDATE) which specifies whether an alt index is updated when a update to the base cluster takes place.
Then BLDINDEX. Parameters are INDATASET(ds name of base cluster), OUTDATASET(ds name of AIX).
Using alternate indexes in batch pgms:
In the JCL, you must have DD stmts for the cluster and for the path(s). In the cobol pgm, SELECT .. ASSIGN TO ddname for base cluster RECORD KEY IS... ALTERNATE RECORD KEY IS..
Using alternate indexes in CICS pgms:
FCT entries must be created for both base cluster & the path. To read using the alternate index, use the dd name of the path in CICS file control commands.
14. What happens when you open an empty VSAM file in a COBOL program for input?
A VSAM file that has never contained a record is treated as unavailable. Attempting to open for input will fail. An empty file can be opened for output only. When you open for output, COBOL will write a dummy record to the file & then delete it out.
15. How do you initialize a VSAM file before any operation? a VSAM with alternate index?
Can write a dummy program that just opens the file for output & then closes it.
16. What does a file status of 02 on a VSAM indicate?
Duplicate alternate key . Happens on both input and output operation
17. How do you calculate record size of an alternate cluster? Give your values for both unique and non-unique.
Unique Case: 5 + ( alt-key-length + primary-key )
Nonunique Case: 5 + ( alt-key-length + n * primary-key )
where n = # of duplicate records for the alternate key
???? Ramesh - can you explain ?
18. What is the difference between sequential files and ESDS files?
Sequential(QSAM) files can be created on tape while ESDS files cannot.
Also, you can have ALTINDEX for an ESDS while no such facility exists for QSAM files.
19. How do you load a VSAM data set with records ?
Using the REPRO command.
20. How do you define a GDG ?
Use the DEFINE GENERATIONDATAGROUP command. In the same IDCAMS step, another dataset must be defined whose DCB parameters are used when new generations of the GDG are created. This dataset is known as the model dataset. The ds name of this model dataset must be the same as that of the GDG, so use a disp of keep rather than catlg and also specify space=(trk,0)
21. Do all versions of the GDG have to be of the same record length ?
No, the DCB of the model dataset can be overridden when you allocate new versions.
22. How are different versions of GDG named ?
base-file-name.GnnnnnV00 where nnnn= generation number (upto 255).
nnnn will be 0000 for the 1st generation.
23. Suppose 3 generations of a GDG exist. How would you reference the 1 st generation in the JCL? - GS
Use GDG name(-2).
24. Suppose a generation of GDG gets created in a particular step of a proc. How would you refer the current generation in a subsequent step? What would be the disposition of this generation now? - GS
Relative generation numbers are updated only at the end of the job, not at the end of a step. To allocate a new generation, we would be using (+1) with a DISP of (NEW,CATLG,DELETE). To refer to this in a subsequent step in the same job, we would again use (+1) but with a DISP of SHR or OLD.
25. What more info you should give in the DD statement while defining the next generation of a GDG? - GS
Give (+1) as the generation number, give (new,catlg) for disp, give space parameter, can give the dcb parameter if you want to override the dcb of the model dataset.
26. Assuming that the DEFINE jcl is not available, how do you get info about a VSAM file’s organisation ?
Use the LISTCAT command.
27. During processing of a VSAM file, some system error occurs and it is subsequently unusable . What do you do ?
Run VERIFY.
54. What is SSRANGE, NOSSRANGE ?
These are compiler options w.r.t subscript out of range checking. NOSSRANGE is the default and if chosen, no run time error will be flagged if your index or subscript goes out of the permissible range.
55. How do you set a return code to the JCL from a COBOL program?
Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.
56. How can you submit a job from COBOL programs?
Write JCL cards to a dataset with
//xxxxxxx SYSOUT=(A,INTRDR) where ‘A’ is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.
57. What are the differences between OS VS COBOL and VS COBOL II?
OS/VS Cobol pgms can only run in 24 bit addressing mode, VS Cobol II pgms can run either in 24 bit or 31 bit addressing modes.
Report writer is supported only in OS/VS Cobol.
USAGE IS POINTER is supported only in VS COBOL II.
Reference modification eg: WS-VAR(1:2) is supported only in VS COBOL II.
EVALUATE is supported only in VS COBOL II.
Scope terminators are supported only in VS COBOL II.
OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.
Under CICS Calls between VS COBOL II programs are supported.
58. What are the steps you go through while creating a COBOL program executable?
DB2 precompiler(if embedded sql used), CICS translator (if CICS pgm), Cobol compiler, Link editor.
Tips on CICS
Tips on CICS
1. How do you place the cursor on a particular position on the screen? - GS Move -1 to the length attribute of the field and use the CUSRSOR option. Define the field with IC in the BMS map.
2. What are the two outputs created as a result of generation of a map? - GS The map copybook and the load module. Tips on Mainframe 3. What is the difference between physical map and symbolic map? - GS The physical map is the load module and the symbolic map is the data structure.
4. How do you protect a field from being overlaid? - GS
5. What is the attribute byte? - GS Defines the display/transmission of field. most cases is an output field from the program.
6. What are the 3 working storage fields used for every field on the map? - GS Length, attribute and input/output field.
7. How is dynamic memory allocated within a CICS application program? - GS Use a GETMAIN
8. What are the restrictions while using GETMAIN and FREEMAIN? - GS
9. How are VSAM files Read in CICS pgms? - GS File Control Commands. Random, Sequential, forward and backward.
10. When you compile a CICS program, the (pre)compiler puts an extra chunk of code. Where does it get included and that is it called? What is its length? - GS DFHEIBLK, DFHCOMMAREA.
11. List all the CICS tables and explain their contents. - GS PPT SIT PCT JCT FCT SNT DCT SRT RCT TCT
12. I have written a CICS program. What tables should I setup to run this program? - GS PPT, PCT, (FCT, DCT, RCT (if needed)).
13. In which table would you make an entry for a BMS map? - GS PPT
14. What is the content of the PPT entry? - GS Length, Source, Use count, Lang, Res count DFHRPL number
15. For a CICS-DB2 program, how is the plan referenced? - GS Uses a RCT table.
16. What is the use of a TDQ, TSQ? - GS Temporary data stores.
17. How do you read from a TSQ? - GS Temp storage read command
18. If I create a TSQ from one transaction, can I read it from another transaction? - GS Yes. As long as they run in the same region.
19. Can you issue SQL COMMIT from a CICS program? - GS No.
20. What is the other way of terminating a transaction? - GS
EXEC CICS SYNCPOINT. Assuming it is a LUW. This will not end the Xn.
21. What is an ASRA abend ? Any data exception, problem SOC7, SOC4 etc.
22. What is an AEY9 abend ? DB2/IDMS not up.
23. What are the situations under which NEWCOPY is required ? When a program has been used in CICS atleast once and then changed and recompiled.
24. What is 2 phase commit? Simultaneous Syncpoint for two different DB for ex VSAM and DB2 updates
25. What are extra partition & intra partition TDQs? Extra partition TDQs are datasets used for communication b’n CICS and other CICS/Batch regions. Intrapartition TDQs are queues for communication within regn.
26. What is trigger level in the context of TDQs? For intrapartition TDQs specify the # records at which ATI happens. not applicable for extra partition TDQs.
27. What is ENQ, DEQ ? Task control commands to make resources serially reusable.
28. What is MDT? What are FSET, FRSET ? Modified Data Tag. Bit in the attribute byte indicating modification of field on screen. Happens on an input operation. FSET. Sets MDT on to ensure field is transmitted. Happens on an output operation. FRSET. Resets MDT. Until this happens, field continues to be sent. Tips on Mainframe 29. What is EXEC CICS RETRIEVE ? Used by STARTed tasks to get the parameters passed to them.
30. What do you do if you do not want characters entered by the user to be folded to uppercase ? Use ASIS option on RECEIVE.
31. What does the BUFFER option in RECEIVE mean ? Brings the entire datastream from the terminal buffer.
32. What are SEND MAP MAPONLY & SEND MAP DATAONLY ?
33. What is the difference between a PF key & a PA key ? PF keys wake up the task and transmit modified data, PA keys only wake up the task.
34. Name some important fields in the EIB block ? EIBRESP, EIBCALEN, EIBRRCDE, EIBTASK, EIBDATE, EIBTIME
35. Can you use DYNAMIC calls in CICS ?
Yes, the called routine must be defined in PPT and the calling program must use CALL identifier..
36. How do you handle errors in CICS pgms ? Check EIBRESP after the call or use the HANDLE condition.
37. How do you use extended attributes ? Define EXTATT=YES and the correct terminal type.
38. Suppose pgm A passes 30 bytes to pgm B thru commarea and pgm B has defined its DFHCOMMAREA to be 50 bytes . Is there a problem ? Tips on Mainframe Yes, if B tries to access bytes 31-50.
39. When an XCTL is done, does the tranid change ? Is a new task created ? Does it cause an implicit SYNCPOINT to be issued ? No, No, Yes.
40. How do you execute a background CICS txn ? With a START or ATI.
41. How do you fire a batch job from a CICS txn ? Define an extrapartition TDQ as an internal reader and write the JCL to it. Terminate the JCL with /*EOF.
42. Can a CICS region be attached to more than one DB2 subsystem ? no and yes. You can access objects of other db2 subsyetms by defining alias. However explicit access to remote db2 subsystem object is not possible
43. What determines the DB2 subsystem to which a particular CICS region is attached ? RCT
44. What is the DSNC transaction used for ? for establishing link between cics and db2
45. What is the use of DSECT parameter in BMS? Is the parameter to generate a symbolic map.
46. Do you receive the attribute byte in the symbolic map? On EOF yes.
47. How do you make your BMS maps case sensitive? Use ASIS???
48. What is effect on RECEIVE MAP when
• PF key is pressed? Data transmission may happen,
• PA key is pressed? Data transmission will not happen.
49. What is the use of DCT? Destination Control Table used to define TDQs
50. How do you handle error in a CICS program? Same as 36.
51. Name the macros used to define the following:
MAP MAPSET FIELD DFHMSD DFHMDI DFHMDF
52. Can you use OCCURS in a BMS map? If you do, what are the issues related with its use? Yes. cannot use group by clause???
53. What is the meaning of BMS length of field = 0? Data was not entered in the field
54. Can you simply check if length = 0 for checking if a field was modified? No, not if ERASE EOF was used.
55. What is ATI? What kind of TDQ can be used? Automatic Task Initiation. Intra partition TDQ.
56. Do you require a table entry for a TSQ? If recovery is needed. Tips on Mainframe 57. Is there any entry for TSQs in CICS tables? Yes in the DFHTST.
58. What is the difference between START and XCTL ? START is used to start a new task. It is a interval control command. XCTL is used to pass control to a program within the same task. It is a program control command.
59. Can you define multiple maps in a BMS mapset? Yes.
60. How is the storage determined in the symbolic map, if you have multiple maps? Storage for maps redefine the first. This means largest map has to be the first.
61. What is the usage of language in the PPT entry? Language interface and call parameters???
62. Can you have CICS code in a copybook? If yes, what happens during compilation? Yes. Needs to be preprocessed.
63. What is an AICA abend? Runaway Task.
64. How would you resolve an ASRA abend? In COBOL II start with CEBR, and get the offset/instruction.
65. What are the steps you go through to a create a BMS executable? Assemble to create CSECT and Link
66. How will you access a VSAM file using an alternate index? Thru the path. Define path as an FCT and use normal File control commands. Tips on Mainframe 67. I have TSQ with 15 items. I want to delete the 10th item. How do I do that?
68. How do you rollback data written to an ESDS file? Define the file as recoverable. in cases where records have been inserted into the file, you may need to run a batch program to logically delete the inserted records.
69. I invoke a transaction from CICS. The program has a code: MOVE DFHCOMMAREA TO WS-AREA. What happens to this transaction? What happens to the other transactions? Junk may get moved in. Will cause Storage violation. ????
70. When you do a START, what will the value of EIBCALEN? Zero.
71. I have done a START BROWSE on a VSAM dataset. Can I do another START BROWSE without doing an END BROWSE? No.
72. How do I find the name of the CICS region inside my COBOL program?
73. Can you access QSAM (seq ) files from CICS ? No.
Can you access ESDS files from CICS ? Yes.
1. How do you place the cursor on a particular position on the screen? - GS Move -1 to the length attribute of the field and use the CUSRSOR option. Define the field with IC in the BMS map.
2. What are the two outputs created as a result of generation of a map? - GS The map copybook and the load module. Tips on Mainframe 3. What is the difference between physical map and symbolic map? - GS The physical map is the load module and the symbolic map is the data structure.
4. How do you protect a field from being overlaid? - GS
5. What is the attribute byte? - GS Defines the display/transmission of field. most cases is an output field from the program.
6. What are the 3 working storage fields used for every field on the map? - GS Length, attribute and input/output field.
7. How is dynamic memory allocated within a CICS application program? - GS Use a GETMAIN
8. What are the restrictions while using GETMAIN and FREEMAIN? - GS
9. How are VSAM files Read in CICS pgms? - GS File Control Commands. Random, Sequential, forward and backward.
10. When you compile a CICS program, the (pre)compiler puts an extra chunk of code. Where does it get included and that is it called? What is its length? - GS DFHEIBLK, DFHCOMMAREA.
11. List all the CICS tables and explain their contents. - GS PPT SIT PCT JCT FCT SNT DCT SRT RCT TCT
12. I have written a CICS program. What tables should I setup to run this program? - GS PPT, PCT, (FCT, DCT, RCT (if needed)).
13. In which table would you make an entry for a BMS map? - GS PPT
14. What is the content of the PPT entry? - GS Length, Source, Use count, Lang, Res count DFHRPL number
15. For a CICS-DB2 program, how is the plan referenced? - GS Uses a RCT table.
16. What is the use of a TDQ, TSQ? - GS Temporary data stores.
17. How do you read from a TSQ? - GS Temp storage read command
18. If I create a TSQ from one transaction, can I read it from another transaction? - GS Yes. As long as they run in the same region.
19. Can you issue SQL COMMIT from a CICS program? - GS No.
20. What is the other way of terminating a transaction? - GS
EXEC CICS SYNCPOINT. Assuming it is a LUW. This will not end the Xn.
21. What is an ASRA abend ? Any data exception, problem SOC7, SOC4 etc.
22. What is an AEY9 abend ? DB2/IDMS not up.
23. What are the situations under which NEWCOPY is required ? When a program has been used in CICS atleast once and then changed and recompiled.
24. What is 2 phase commit? Simultaneous Syncpoint for two different DB for ex VSAM and DB2 updates
25. What are extra partition & intra partition TDQs? Extra partition TDQs are datasets used for communication b’n CICS and other CICS/Batch regions. Intrapartition TDQs are queues for communication within regn.
26. What is trigger level in the context of TDQs? For intrapartition TDQs specify the # records at which ATI happens. not applicable for extra partition TDQs.
27. What is ENQ, DEQ ? Task control commands to make resources serially reusable.
28. What is MDT? What are FSET, FRSET ? Modified Data Tag. Bit in the attribute byte indicating modification of field on screen. Happens on an input operation. FSET. Sets MDT on to ensure field is transmitted. Happens on an output operation. FRSET. Resets MDT. Until this happens, field continues to be sent. Tips on Mainframe 29. What is EXEC CICS RETRIEVE ? Used by STARTed tasks to get the parameters passed to them.
30. What do you do if you do not want characters entered by the user to be folded to uppercase ? Use ASIS option on RECEIVE.
31. What does the BUFFER option in RECEIVE mean ? Brings the entire datastream from the terminal buffer.
32. What are SEND MAP MAPONLY & SEND MAP DATAONLY ?
33. What is the difference between a PF key & a PA key ? PF keys wake up the task and transmit modified data, PA keys only wake up the task.
34. Name some important fields in the EIB block ? EIBRESP, EIBCALEN, EIBRRCDE, EIBTASK, EIBDATE, EIBTIME
35. Can you use DYNAMIC calls in CICS ?
Yes, the called routine must be defined in PPT and the calling program must use CALL identifier..
36. How do you handle errors in CICS pgms ? Check EIBRESP after the call or use the HANDLE condition.
37. How do you use extended attributes ? Define EXTATT=YES and the correct terminal type.
38. Suppose pgm A passes 30 bytes to pgm B thru commarea and pgm B has defined its DFHCOMMAREA to be 50 bytes . Is there a problem ? Tips on Mainframe Yes, if B tries to access bytes 31-50.
39. When an XCTL is done, does the tranid change ? Is a new task created ? Does it cause an implicit SYNCPOINT to be issued ? No, No, Yes.
40. How do you execute a background CICS txn ? With a START or ATI.
41. How do you fire a batch job from a CICS txn ? Define an extrapartition TDQ as an internal reader and write the JCL to it. Terminate the JCL with /*EOF.
42. Can a CICS region be attached to more than one DB2 subsystem ? no and yes. You can access objects of other db2 subsyetms by defining alias. However explicit access to remote db2 subsystem object is not possible
43. What determines the DB2 subsystem to which a particular CICS region is attached ? RCT
44. What is the DSNC transaction used for ? for establishing link between cics and db2
45. What is the use of DSECT parameter in BMS? Is the parameter to generate a symbolic map.
46. Do you receive the attribute byte in the symbolic map? On EOF yes.
47. How do you make your BMS maps case sensitive? Use ASIS???
48. What is effect on RECEIVE MAP when
• PF key is pressed? Data transmission may happen,
• PA key is pressed? Data transmission will not happen.
49. What is the use of DCT? Destination Control Table used to define TDQs
50. How do you handle error in a CICS program? Same as 36.
51. Name the macros used to define the following:
MAP MAPSET FIELD DFHMSD DFHMDI DFHMDF
52. Can you use OCCURS in a BMS map? If you do, what are the issues related with its use? Yes. cannot use group by clause???
53. What is the meaning of BMS length of field = 0? Data was not entered in the field
54. Can you simply check if length = 0 for checking if a field was modified? No, not if ERASE EOF was used.
55. What is ATI? What kind of TDQ can be used? Automatic Task Initiation. Intra partition TDQ.
56. Do you require a table entry for a TSQ? If recovery is needed. Tips on Mainframe 57. Is there any entry for TSQs in CICS tables? Yes in the DFHTST.
58. What is the difference between START and XCTL ? START is used to start a new task. It is a interval control command. XCTL is used to pass control to a program within the same task. It is a program control command.
59. Can you define multiple maps in a BMS mapset? Yes.
60. How is the storage determined in the symbolic map, if you have multiple maps? Storage for maps redefine the first. This means largest map has to be the first.
61. What is the usage of language in the PPT entry? Language interface and call parameters???
62. Can you have CICS code in a copybook? If yes, what happens during compilation? Yes. Needs to be preprocessed.
63. What is an AICA abend? Runaway Task.
64. How would you resolve an ASRA abend? In COBOL II start with CEBR, and get the offset/instruction.
65. What are the steps you go through to a create a BMS executable? Assemble to create CSECT and Link
66. How will you access a VSAM file using an alternate index? Thru the path. Define path as an FCT and use normal File control commands. Tips on Mainframe 67. I have TSQ with 15 items. I want to delete the 10th item. How do I do that?
68. How do you rollback data written to an ESDS file? Define the file as recoverable. in cases where records have been inserted into the file, you may need to run a batch program to logically delete the inserted records.
69. I invoke a transaction from CICS. The program has a code: MOVE DFHCOMMAREA TO WS-AREA. What happens to this transaction? What happens to the other transactions? Junk may get moved in. Will cause Storage violation. ????
70. When you do a START, what will the value of EIBCALEN? Zero.
71. I have done a START BROWSE on a VSAM dataset. Can I do another START BROWSE without doing an END BROWSE? No.
72. How do I find the name of the CICS region inside my COBOL program?
73. Can you access QSAM (seq ) files from CICS ? No.
Can you access ESDS files from CICS ? Yes.
Tips on JCL
Tips on JCL
1. What is primary allocation for a dataset?
The space allocated when the dataset is first created.
2. What is the difference between primary and secondary allocations for a dataset?
Secondary allocation is done when more space is required than what has already been allocated.
3. How many extents are possible for a sequential file ? For a VSAM file ?
16 extents on a volume for a sequential file and 123 for a VSAM file.
4. What does a disposition of (NEW,CATLG,DELETE) mean? - GS
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to delete the dataset if the step abends.
5. What does a disposition of (NEW,CATLG,KEEP) mean? - GS
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset would not be catalogued and we would need to supply the vol. ser the next time we refer to it.
6. How do you access a file that had a disposition of KEEP? - GS
Need to supply volume serial no. VOL=SER=xxxx.
7. What does a disposition of (MOD,DELETE,DELETE) mean ?
The MOD will cause the dataset to be created (if it does not exist), and then the two DELETEs will cause the dataset to be deleted whether the step abends or not. This disposition is used to clear out a dataset at the beginning of a job.
8. What is the DD statement for a output file?
Unless allocated earlier, will have the foll parameters: DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB .
9. What do you do if you do not want to keep all the space allocated to a dataset? - GS
Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)
10. What is DISP=(NEW,PASS,DELETE)?
This is a new file and create it, if the step terminates normally, pass it to the subsequent steps and if step abends, delete it. This dataset will not exist beyond the JCL.
11. How do you create a temporary dataset? Where will you use them?
Temporary datasets can be created either by not specifying any DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP.
We use them to carry the output of one step to another step in the same job. The dataset will not be retained once the job completes.
12. How do you restart a proc from a particular step? - GS
In job card, specify RESTART= procstep.stepname
where procstep = name of the jcl step that invoked the proc
and stepname = name of the proc step where you want execution to start
13. How do you skip a particular step in a proc/JOB? - GS
Can use either condition codes or use the jcl control statement IF (only in ESA JCL)
14. A PROC has five steps. Step 3 has a condition code. How can you override/nullify this condition code? - GS
Provide the override on the EXEC stmt in the JCL as follows:
//STEP001 EXEC procname,COND.stepname=value
All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like this.
15. How do you override a specific DDNAME/SYSIN in PROC from a JCL?
// DSN=...
16. What is NOTCAT 2 - GS
This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you already have a dataset with dsn = ‘xxxx.yyyy’ and u try to create one with disp new,catlg, you would get this error. the program open and write would go through and at the end of the step the system would try to put it in the system catalog. at this point since an entry already exists the catlg would fail and give this message. you can fix the problem by deleting/uncataloging the first data set and going to the volume where the new dataset exists(this info is in the msglog of the job) and cataloging it.
17. What is 'S0C7' abend? - GS
Caused by invalid data in a numeric field.
18. What is a S0C4 error ? - GS
Storage violation error - can be due to various reasons. e.g.: READING a file that is not open, invalid address referenced due to subscript error.
19. What are SD37, SB37, SE37 abends?
All indicate dataset out of space. SD37 - no secondary allocation was specified. SB37 - end of vol. and no further volumes specified. SE37 - Max. of 16 extents already allocated.
20. What is S322 abend ?
Indicates a time out abend. Your program has taken more CPU time than the default limit for the job class. Could indicate an infinite loop.
21. Why do you want to specify the REGION parameter in a JCL step? - GS
To override the REGION defined at the JOB card level.
REGION specifies the max region size. REGION=0K or 0M or omitting REGION means no limit will be applied.
22. What does the TIME parameter signify ? What does TIME=1440 mean ?
TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time. TIME=1440 means no CPU time limit is to be applied to this step.
23. What is COND=EVEN ?
Means execute this step even if any of the previous steps, terminated abnormally.
24. What is COND=ONLY ?
Means execute this step only if any of the previous steps, terminated abnormally.
25. How do you check the syntax of a JCL without running it?
TYPERUN=SCAN on the JOB card or use JSCAN.
26. What does IEBGENER do?
Used to copy one QSAM file to another. Source dataset should be described using SYSUT1 ddname. Destination dataset should be decribed using SYSUT2. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.
27. How do you send the output of a COBOL program to a member of a PDS?
Code the DSN as pds(member) with a DISP of SHR. The disp applies to the pds and not to a specific member.
28. I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I submit it?
Multiple jobs are submitted (as many jobs as the number of JOB cards).
29. I have a COBOL program that ACCEPTs some input data. How do you code the JCL statment for this? ( How do you code instream data in a JCL? )
//SYSIN DD*
input data
input data
/*
30. Can you code instream data in a PROC ?
No.
31. How do you overcome this limitation ?
One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.
32. How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
To run a non DB2 program,
//STEP001 EXEC PGM=MYPROG
To run a DB2 program,
//STEP001 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(....)
RUN PROGRAM(MYPROG)
PLAN(.....) LIB(....) PARMS(...)
/*
33. What is STEPLIB, JOBLIB? What is it used for? - GS
Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed.
STEPLIB applies only to the particular step, JOBLIB to all steps in the job.
34. What is order of searching of the libraries in a JCL? - GS
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The system libraries are specified in the linklist.
35. What happens if both JOBLIB & STEPLIB is specified ?
JOBLIB is ignored.
36. When you specify mutiple datasets in a JOBLIB or STEPLIB, what factor determines the order? - GS
The library with the largest block size should be the first one.
37. How to change default proclib ?
//ABCD JCLLIB ORDER=(ME.MYPROCLIB,SYS1.PROCLIB)
38. The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
Records will be written to end of file (append) when a WRITE is done in both cases.
39. What are the valid DSORG values ?
PS - QSAM, PO - Partitioned, IS - ISAM
40. What are the differences between JES2 & JES3 ?
JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step executes
1. What is primary allocation for a dataset?
The space allocated when the dataset is first created.
2. What is the difference between primary and secondary allocations for a dataset?
Secondary allocation is done when more space is required than what has already been allocated.
3. How many extents are possible for a sequential file ? For a VSAM file ?
16 extents on a volume for a sequential file and 123 for a VSAM file.
4. What does a disposition of (NEW,CATLG,DELETE) mean? - GS
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to delete the dataset if the step abends.
5. What does a disposition of (NEW,CATLG,KEEP) mean? - GS
That this is a new dataset and needs to be allocated, to CATLG the dataset if the step is successful and to KEEP but not CATLG the dataset if the step abends. Thus if the step abends, the dataset would not be catalogued and we would need to supply the vol. ser the next time we refer to it.
6. How do you access a file that had a disposition of KEEP? - GS
Need to supply volume serial no. VOL=SER=xxxx.
7. What does a disposition of (MOD,DELETE,DELETE) mean ?
The MOD will cause the dataset to be created (if it does not exist), and then the two DELETEs will cause the dataset to be deleted whether the step abends or not. This disposition is used to clear out a dataset at the beginning of a job.
8. What is the DD statement for a output file?
Unless allocated earlier, will have the foll parameters: DISP=(NEW,CATLG,DELETE), UNIT , SPACE & DCB .
9. What do you do if you do not want to keep all the space allocated to a dataset? - GS
Specify the parameter RLSE ( release ) in the SPACE e.g. SPACE=(CYL,(50,50),RLSE)
10. What is DISP=(NEW,PASS,DELETE)?
This is a new file and create it, if the step terminates normally, pass it to the subsequent steps and if step abends, delete it. This dataset will not exist beyond the JCL.
11. How do you create a temporary dataset? Where will you use them?
Temporary datasets can be created either by not specifying any DSNAME or by specifying the temporary file indicator as in DSN=&&TEMP.
We use them to carry the output of one step to another step in the same job. The dataset will not be retained once the job completes.
12. How do you restart a proc from a particular step? - GS
In job card, specify RESTART= procstep.stepname
where procstep = name of the jcl step that invoked the proc
and stepname = name of the proc step where you want execution to start
13. How do you skip a particular step in a proc/JOB? - GS
Can use either condition codes or use the jcl control statement IF (only in ESA JCL)
14. A PROC has five steps. Step 3 has a condition code. How can you override/nullify this condition code? - GS
Provide the override on the EXEC stmt in the JCL as follows:
//STEP001 EXEC procname,COND.stepname=value
All parameters on an EXEC stmt in the proc such as COND, PARM have to be overridden like this.
15. How do you override a specific DDNAME/SYSIN in PROC from a JCL?
// DSN=...
16. What is NOTCAT 2 - GS
This is an MVS message indicating that a duplicate catalog entry exists. E.g., if you already have a dataset with dsn = ‘xxxx.yyyy’ and u try to create one with disp new,catlg, you would get this error. the program open and write would go through and at the end of the step the system would try to put it in the system catalog. at this point since an entry already exists the catlg would fail and give this message. you can fix the problem by deleting/uncataloging the first data set and going to the volume where the new dataset exists(this info is in the msglog of the job) and cataloging it.
17. What is 'S0C7' abend? - GS
Caused by invalid data in a numeric field.
18. What is a S0C4 error ? - GS
Storage violation error - can be due to various reasons. e.g.: READING a file that is not open, invalid address referenced due to subscript error.
19. What are SD37, SB37, SE37 abends?
All indicate dataset out of space. SD37 - no secondary allocation was specified. SB37 - end of vol. and no further volumes specified. SE37 - Max. of 16 extents already allocated.
20. What is S322 abend ?
Indicates a time out abend. Your program has taken more CPU time than the default limit for the job class. Could indicate an infinite loop.
21. Why do you want to specify the REGION parameter in a JCL step? - GS
To override the REGION defined at the JOB card level.
REGION specifies the max region size. REGION=0K or 0M or omitting REGION means no limit will be applied.
22. What does the TIME parameter signify ? What does TIME=1440 mean ?
TIME parameter can be used to overcome S322 abends for programs that genuinely need more CPU time. TIME=1440 means no CPU time limit is to be applied to this step.
23. What is COND=EVEN ?
Means execute this step even if any of the previous steps, terminated abnormally.
24. What is COND=ONLY ?
Means execute this step only if any of the previous steps, terminated abnormally.
25. How do you check the syntax of a JCL without running it?
TYPERUN=SCAN on the JOB card or use JSCAN.
26. What does IEBGENER do?
Used to copy one QSAM file to another. Source dataset should be described using SYSUT1 ddname. Destination dataset should be decribed using SYSUT2. IEBGENR can also do some reformatting of data by supplying control cards via SYSIN.
27. How do you send the output of a COBOL program to a member of a PDS?
Code the DSN as pds(member) with a DISP of SHR. The disp applies to the pds and not to a specific member.
28. I have multiple jobs ( JCLs with several JOB cards ) in a member. What happens if I submit it?
Multiple jobs are submitted (as many jobs as the number of JOB cards).
29. I have a COBOL program that ACCEPTs some input data. How do you code the JCL statment for this? ( How do you code instream data in a JCL? )
//SYSIN DD*
input data
input data
/*
30. Can you code instream data in a PROC ?
No.
31. How do you overcome this limitation ?
One way is to code SYSIN DD DUMMY in the PROC, and then override this from the JCL with instream data.
32. How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
To run a non DB2 program,
//STEP001 EXEC PGM=MYPROG
To run a DB2 program,
//STEP001 EXEC PGM=IKJEFT01
//SYSTSIN DD *
DSN SYSTEM(....)
RUN PROGRAM(MYPROG)
PLAN(.....) LIB(....) PARMS(...)
/*
33. What is STEPLIB, JOBLIB? What is it used for? - GS
Specifies that the private library (or libraries) specified should be searched before the default system libraries in order to locate a program to be executed.
STEPLIB applies only to the particular step, JOBLIB to all steps in the job.
34. What is order of searching of the libraries in a JCL? - GS
First any private libraries as specified in the STEPLIB or JOBLIB, then the system libraries such as SYS1.LINKLIB. The system libraries are specified in the linklist.
35. What happens if both JOBLIB & STEPLIB is specified ?
JOBLIB is ignored.
36. When you specify mutiple datasets in a JOBLIB or STEPLIB, what factor determines the order? - GS
The library with the largest block size should be the first one.
37. How to change default proclib ?
//ABCD JCLLIB ORDER=(ME.MYPROCLIB,SYS1.PROCLIB)
38. The disp in the JCL is MOD and the program opens the file in OUTPUT mode. What happens ? The disp in the JCL is SHR and the pgm opens the file in EXTEND mode. What happens ?
Records will be written to end of file (append) when a WRITE is done in both cases.
39. What are the valid DSORG values ?
PS - QSAM, PO - Partitioned, IS - ISAM
40. What are the differences between JES2 & JES3 ?
JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step executes
Tips on DB2
Tips on DB2
1. In the WHERE clause what is BETWEEN and IN? - GS
BETWEEN supplies a range of values while IN supplies a list of values.
2. Is BETWEEN inclusive of the range values specified? - GS
Yes.
3. What is 'LIKE' used for in WHERE clause? What are the wildcard characters? - GS
LIKE is used for partial string matches. ‘%’ ( for a string of any character ) and ‘_’ (for any single character ) are the two wild card characters.
4. When do you use a LIKE statement?
To provide partial search facility e.g. to search employee by name, you need not specify the complete name, using LIKE, you can search for partial string matches.
5. What is the meaning of underscore ( ‘_’ ) in the LIKE statement? - GS
Match for any single character.
6. What do you accomplish by GROUP BY .... HAVING clause? - GS
Can think of the HAVING as a ‘WHERE’ clause on the GROUP
7. What is a cursor? why should it be used? - GS
When multiple of rows are to be retrieved with embedded SQL, a cursor should be used.
8. Where would you specify the DECLARE CURSOR statement? - GS
See answer to next question.
9. How do you specify and use a cursor in a COBOL program? - GS
Use DECLARE CURSOR statement either in working storage or in procedure division(before open cursor), to specify the SELECT statement. Then use OPEN, FETCH rows in a loop and finally CLOSE.
10. How would you retrieve rows from a DB2 table in embedded SQL? - GS
Either by using the single row SELECT statements,or by using the CURSOR.
11. What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)? - GS
PIC S9(9)V99 COMP-3.
Note: In DECIMAL(11,2), 11 indicates the size of the data type and 2 indicates the precision.
12. What is DCLGEN ? - GS
DeCLarations GENerator: used to create the host language copy books for the table definitions. Also creates the DECLARE table.
13. What are the contents of a DCLGEN? - GS
1. EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of DB2 datatypes.
2. A host language copy book that give the host variable definitions for the column names.
14. Is it mandatory to use DCLGEN? If not, why would you use it at all? - GS
It is not mandatory to use DCLGEN.
Using DCLGEN, helps detect wrongly spelt column names etc. during the precompile stage itself ( because of the DECLARE TABLE ). DCLGEN being a toll, would generate accurate host variable definitions for the table reducing chances of error.
15. Is DECLARE TABLE in DCLGEN necessary? Why it used?
It not necessary to have DECLARE TABLE statement in DCLGEN. This is used by the pre-compiler to validate the table-name, view-name, column name etc.
16. What is EXPLAIN? - GS
EXPLAIN is used to display the access path as determined by the optimizer for a SQL statement. It can be used in SPUFI (for single SQL statement ) or in BIND step (for embedded SQL ).
17. What do you need to do before you do EXPLAIN?
Make sure that the PLAN_TABLE is created. Do RUNSTATS. ( Any thing else? )
18. Where is the output of EXPLAIN stored? - GS
In userid.PLAN_TABLE
19. EXPLAIN has output with MATCHCOLS = 0. What does it mean? – GS
While doing the accesspath, objects accessed have matching cols as 0, in other words index scan or TS scan is used depending on access type R or I
20. How do you do the EXPLAIN of a dynamic SQL statement?
Using Spufi. At bind time, accesspath are not defined. So all permutation and combinations of SQLs need to be examined separately in spufi.
21. How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause.)
22. What are the isolation levels possible ? - GS
CS: Cursor Stability – A read lock is released as soon as access is moved to next page
RR: Repeatable Read – Lock is released only after commit or end of execution
23. Where do you specify them ?
ISOLATION LEVEL is a parameter for the bind process.
24. I use CS and update a page. Will the lock be released after I am done with that page?
No
25. What is ALTER ? - GS
SQL command used to change the definition of DB2 object.
26. What are PACKAGES ? - GS
They contain executable code for SQL statements. Can contain SQL statements for only one DBRM.
Non Executable accesspath instruction for a DBRM.
27. What are the advantages of using a PACKAGE?
In Online Systems – Where there is normally one plan used, You do not have to bind the plan again. So downtime is reduced.
If packages are used than binding changed program is required, however in other case you will have to bind whole plan.
28. What is RUNSTATS? - GS
A DB2 utility used to collect statistics about the data values in tables which can be used by the optimizer to decide the access path. These statistics are stored in DB2 catalog tables and is critical in determining accesspaths for a SQL
29. When will you chose to run RUNSTATS?
After a load, or after mass updates, inserts, deletes, or after REORG. And Periodically
30. Give some example of statistics collected during RUNSTATS?
Col Count – Number of unique values in a column (if high index access is used), Number of columns populated.
31. In SPUFI suppose you want to select max. of 1000 rows , but the select returns only 200 rows. What are the 2 sqlcodes that are returned? - GS
100 ( for successful completion of the query ), 0 (for successful COMMIT if AUTOCOMMIT is set to Yes).
32. How would you print the output of an SQL statement from SPUFI? - GS
Print the output dataset.
33. How do you pull up a query which was previously saved in QMF ? - GS
34. How do you select a row using indexes? - GS
Specify the indexed columns in the WHERE clause.
35. Lot of updates have been done ona table due to which indexes have gone haywire. What do you do? – GS
Reorg
36. What are split indexes? ( exact question is not known ) GS
Ramesh, I think they were talking about what do you do if index splits occur due to mass inserts/updates. I think the answer is a REORG is required.
37. What happens when you say OPEN CURSOR?
If there is an ORDER BY clause, rows are fetched, sorted and made available for the FETCH statement. Other wise simply the cursor is placed on the first row.
In case of Open Cursor
If Cursor statement is complex (i.e. multiple tables accessed, access path use multiple indexes etc.) than materialization happenes and a temporary table is created.
In other case cursor is simply placed on first row depending on Order By clause
38. Is DECLARE CURSOR executable?
No.
39. Can you have more than one cursor open at any one time in a program ? - GS
Yes.
40. How would you find out the total number of rows in a table? - GS
Use SELECT COUNT(*) ...
41. How do you eliminate duplicate values in SELECT? - GS
Use SELECT DISTINCT ...
42. How do you find the maximum value in a column? - GS
Use SELECT MAX(...
43. What does the sqlcode of -818 pertain to? - GS
This is generated when the consistency tokens in the DBRM and the load module are different.
44. What is UNION,UNION ALL? - GS
UNION : eliminates duplicates
UNION ALL: retains duplicates
Both these are used to combine the results of different SELECT statements.
45. Suppose I have five SQL SELECT statements connected by UNION/UNION ALL, how many times should I specify UNION to eliminate the duplicate rows? - GS
Once.
46. What is dynamic SQL? - GS Dynamic SQL is a SQL statement created at program execution time.
47. What else is there in the PLAN apart from the access path? - GS
PLAN has the executable code for the SQL statements in the host program
48. When is the access path determined for dynamic SQL? - GS
At run time, when the PREPARE statement is issued.
49. Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened? - GS
Probably RUN STATS is not done and the program is using a wrong index due to incorrect stats.
Probably RUNSTATS is done and optimizer has chosen a wrong access path based on the latest statistics.
50. Apart from cursor, what other ways are available to you to retrieve a row from a table in embedded SQL? - GS
Single row SELECTs.
51. How do you retrieve the data from a nullable column? - GS
Use null indicators. Syntax INTO :HOSTVAR:NULLIND
52. What is the picture clause of the null indicator variable? - GS
S9(4) COMP.
53. What does it mean if the null indicator has -1, 0, -2
-1 : the field is null
0 : the field is not null
-2 : the field value is truncated
54. How do you insert a record with a nullable column?
To insert a NULL, move -1 to the null indicator
To insert a valid value, move 0 to the null indicator
55. Some questions on concatenate, substring features of DB2. - GS
56. What is IMAGECOPY ? - GS
It is full backup of a DB2 table which can be used in recovery.
57. When do you use the IMAGECOPY? - GS
To take routine backup of tables
After a LOAD with LOG NO
58. What is a clustering index ? - GS
A mandatory index defined on a partitioned table space. Causes the data rows to be stored in the order specified in the index. Obviously a table can have only one clustering index.
59. What are correlated subqueries? - GS
.
One in which the lower level nested select refers back to the table in the higher level.
60. What are the issues related with correlated subqueries? - GS
61. What is sqlcode -922 ?
62. What is sqlcode -811?
63. What is a DBRM, PLAN ?
DBRM: DataBase Request Module, has the SQL statements extracted from the host language program by the SQL precompile.
PLAN: A result of the BIND process. It has the executable code for the SQL statements in the DBRM.
64. What happens to the PLAN if index used by it is dropped? Plan is marked as invalid. The next time the plan is invoked, it is recreated.
65. What is the difference between primary key & unique index ?
66. What is QUIESCE?
A QUIESCE flushes all DB2 buffers on to the disk. This gives a correct snapshot of the database and should be used before any IMAGECOPY to maintain consistency.
67. Are views updatable ?
Not all of them. Some views are updatable e.g. single table view with all the fields or mandatory fields. Examples of non-updatable views are views which are joins, views that contain aggregate functions(such as MIN).
68. If I have a view which is a join of two or more tables, can this view be updatable? - GS
No.
69. What is a synonym ?
Synonym is an alternate name for a table or view. A synonym is accessible only by the creator.
70. What is FREEPAGE and PCTFREE in TABLESPACE creation?
PCTFREE: percentage of each page to be left free
FREEPAGE: Number of pages to be loaded with data between each free page
71. What is CHECK PENDING ? Tips on Mainframe Pend status of table space to check for different values. Usuall before load TS is pended in four different pend status. After load a image copy job is run which will eliminate these pend statuses
72. What are the 4 environments which can access DB2 ?
TSO, CICS, IMS and BATCH
73. What is outer join ?
Outer join is one in which you want both matching and non matching rows to be returned. DB2 has no specific operator for outer joins, it can be simulated by combining a join and a correlated sub query with a UNION.
74. What are simple, segmented and partitioned table spaces ?
Simple Tablespace:
Can contain one or more tables
Rows from multiple tables can be interleaved on a page under the DBAs control and maintenance
Segmented Tablespace:
Can contain one or more tables
Tablespace is divided into segments of 4 to 64 pages in increments of 4 pages. Each segment is dedicated to single table. A table can occupy multiple segments
Partitioned Tablespace:
Can contain one table
Tablespace is divided into parts and each part is put in a separate VSAM dataset.
75. How is a typical DB2 batch pgm executed ? Tips on Mainframe Use DSN utility to run a DB2 batch program. An example is shown:
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB('EDGS01T.OBJ.LOADLIB')
END
Use IKJEFT01 utility program to run this command in a JCL.
76. Assuming that a site’s standard is that pgm name = plan name, what is the easiest way to find out which pgms are affected by change in a table’s structure ?
Query the catalogue table SYSPLANDEP.
77. Name some fields from SQLCA.
SQLCODE, SQLERRM, SQLERRD ...
78. When do you specify the isolation level? How?
During the BIND process. ISOLATION ( CS/RR )...
79. How can you quickly find out the # of rows updated after a mass update statement?
Check the value stored in SQLERRD(3).
80. Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned to any project?
SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;
81. Why SELECT * is not preferred in embedded SQL programs?
For three reasons:
• If the table structure is changed ( a field is added ), the program will have to be modified
• Program might retrieve the columns which it might not use, leading on I/O over head.
• The chance of an index only scan is lost.
82. What is filter factor?
Number of distinct col values/Number of rows in the table
83. What is index cardinality? - GS
84. What are the various locking levels available?
PAGE, TABLE, TABLESPACE
Subpage, row level with type2 indexes
85. How does DB2 determine what locking level to use?
Type of indexes, Bind
86. What are the disadvantages of PAGE level lock?
Concurrency is limited
87. What is lock escalation?
Lock moved from a subpage to page or page to tablespace
88. What are the various locks available?
SHARE, EXCLUSIVE, UPDATE
89. What is the difference between CS and RR isolation levels?
CS: Releases the lock on a page after use
RR: Retains all locks acquired till end of transaction
90. Can I use LOCK TABLE on a view?
No. To lock a view, take lock on the underlying tables.
91. What are COLLECTIONS?
Prefixes for a package name. Makes it convenient to use in PKLIST for plans.
92. When you COMMIT, is the cursor closed?
Yes.
93. How do you leave the cursor open after issuing a COMMIT? ( for DB2 2.3 or above only )
Use WITH HOLD option in DECLARE CURSOR statement. Has no effect in CICS. I believe CICS will retain posn after a SYNCPOINT???.
In pseudoconversation CURSOR with HOLD also gets closed
94. Give the COBOL definition of a VARCHAR field.
95. What is the physical storage length of each of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes
96. What is the COBOL picture clause of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: PIC X(10)
TIME : PIC X(08)
TIMESTAMP: PIC X(26)
97. What is the result of this query if no rows are selected:
SELECT SUM(SALARY)
FROM EMP
WHERE QUAL=‘MSC’;
NULL
98. What is the difference between SYNONYM and ALIAS?
SYNONYM: is dropped when the table or tablespace is dropped. Synonym is available only to the creator.
ALIAS: is retained even if table or tablespace is dropped. ALIAS can be created even if the table does not exist. It is used mainly in distributed environment to hide the location info from programs. Alias is a global object & is available to all.
99. My SQL statement SELECT AVG(SALARY) FROM EMP yields inaccurate results. Why?
Because SALARY is not declared to have NULLs and the employees for whom the salary is not known are also counted.
100.How do you retrieve the first 5 characters of FIRSTNAME column of EMP table?
SELECT SUBSTR(FIRSTNAME,1,5) FROM EMP;
101.How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name?
SELECT FIRSTNAME || ‘ ‘ || LASTNAME FROM EMP;
102.What is the use of VALUE function?
Avoid handling NULLable fields. It assigns a default of 0 to numeric fields which are NULL.
103.What do you mean by NOT NULL WITH DEFAULT? When will you use it?
In insert if column is not specified than default value is taken
104.What do you mean by NOT NULL? When will you use it?
Column needs to have some value specified.
105.What are aggregate functions?
Max, Sum, Avg
106.What is REORG? When is it used?
107.How do I create a table MANAGER ( EMP#, MANAGER) where MANAGER is a foreign key which references to EMP# in the same table? Give the exact DDL.
108.Will precompile of an DB2-COBOL program bomb, if DB2 is down?
No. Because the precompiler does not refer to the DB2 catalogue tables.
109.Can you use MAX on a CHAR column?
YES.
110.What is the restriction on using UNION in embedded SQL?
It has to be in a CURSOR.
111.When does the authorization check on DB2 objects is done - at BIND time or run time?
Both, there is bind authority and execution authority
112.What is COPY PENDING status?
A state in which, an image copy on a table needs to be taken, In this status, the table is available only for queries. You cannot update this table. To remove the COPY PENDING status, you take an image copy or use REPAIR utility.
113.How many clustering indexes can be defined for a table?
Only one.
114.How does DB2 store NULL physically?
High Values
115.When would you prefer to use VARCHAR?
116.What are the disadvantages of using VARCHAR?
117.What happens to the plans when an index used by them is dropped?
Marked as invalid
118.What is auditing?
Logging updates
119.What is ACQUIRE/RELEASE in BIND?
When to release the lock at commit or task termination point.
1. In the WHERE clause what is BETWEEN and IN? - GS
BETWEEN supplies a range of values while IN supplies a list of values.
2. Is BETWEEN inclusive of the range values specified? - GS
Yes.
3. What is 'LIKE' used for in WHERE clause? What are the wildcard characters? - GS
LIKE is used for partial string matches. ‘%’ ( for a string of any character ) and ‘_’ (for any single character ) are the two wild card characters.
4. When do you use a LIKE statement?
To provide partial search facility e.g. to search employee by name, you need not specify the complete name, using LIKE, you can search for partial string matches.
5. What is the meaning of underscore ( ‘_’ ) in the LIKE statement? - GS
Match for any single character.
6. What do you accomplish by GROUP BY .... HAVING clause? - GS
Can think of the HAVING as a ‘WHERE’ clause on the GROUP
7. What is a cursor? why should it be used? - GS
When multiple of rows are to be retrieved with embedded SQL, a cursor should be used.
8. Where would you specify the DECLARE CURSOR statement? - GS
See answer to next question.
9. How do you specify and use a cursor in a COBOL program? - GS
Use DECLARE CURSOR statement either in working storage or in procedure division(before open cursor), to specify the SELECT statement. Then use OPEN, FETCH rows in a loop and finally CLOSE.
10. How would you retrieve rows from a DB2 table in embedded SQL? - GS
Either by using the single row SELECT statements,or by using the CURSOR.
11. What is the COBOL picture clause for a DB2 column defined as DECIMAL(11,2)? - GS
PIC S9(9)V99 COMP-3.
Note: In DECIMAL(11,2), 11 indicates the size of the data type and 2 indicates the precision.
12. What is DCLGEN ? - GS
DeCLarations GENerator: used to create the host language copy books for the table definitions. Also creates the DECLARE table.
13. What are the contents of a DCLGEN? - GS
1. EXEC SQL DECLARE TABLE statement which gives the layout of the table/view in terms of DB2 datatypes.
2. A host language copy book that give the host variable definitions for the column names.
14. Is it mandatory to use DCLGEN? If not, why would you use it at all? - GS
It is not mandatory to use DCLGEN.
Using DCLGEN, helps detect wrongly spelt column names etc. during the precompile stage itself ( because of the DECLARE TABLE ). DCLGEN being a toll, would generate accurate host variable definitions for the table reducing chances of error.
15. Is DECLARE TABLE in DCLGEN necessary? Why it used?
It not necessary to have DECLARE TABLE statement in DCLGEN. This is used by the pre-compiler to validate the table-name, view-name, column name etc.
16. What is EXPLAIN? - GS
EXPLAIN is used to display the access path as determined by the optimizer for a SQL statement. It can be used in SPUFI (for single SQL statement ) or in BIND step (for embedded SQL ).
17. What do you need to do before you do EXPLAIN?
Make sure that the PLAN_TABLE is created. Do RUNSTATS. ( Any thing else? )
18. Where is the output of EXPLAIN stored? - GS
In userid.PLAN_TABLE
19. EXPLAIN has output with MATCHCOLS = 0. What does it mean? – GS
While doing the accesspath, objects accessed have matching cols as 0, in other words index scan or TS scan is used depending on access type R or I
20. How do you do the EXPLAIN of a dynamic SQL statement?
Using Spufi. At bind time, accesspath are not defined. So all permutation and combinations of SQLs need to be examined separately in spufi.
21. How do you simulate the EXPLAIN of an embedded SQL statement in SPUFI/QMF? Give an example with a host variable in WHERE clause.)
22. What are the isolation levels possible ? - GS
CS: Cursor Stability – A read lock is released as soon as access is moved to next page
RR: Repeatable Read – Lock is released only after commit or end of execution
23. Where do you specify them ?
ISOLATION LEVEL is a parameter for the bind process.
24. I use CS and update a page. Will the lock be released after I am done with that page?
No
25. What is ALTER ? - GS
SQL command used to change the definition of DB2 object.
26. What are PACKAGES ? - GS
They contain executable code for SQL statements. Can contain SQL statements for only one DBRM.
Non Executable accesspath instruction for a DBRM.
27. What are the advantages of using a PACKAGE?
In Online Systems – Where there is normally one plan used, You do not have to bind the plan again. So downtime is reduced.
If packages are used than binding changed program is required, however in other case you will have to bind whole plan.
28. What is RUNSTATS? - GS
A DB2 utility used to collect statistics about the data values in tables which can be used by the optimizer to decide the access path. These statistics are stored in DB2 catalog tables and is critical in determining accesspaths for a SQL
29. When will you chose to run RUNSTATS?
After a load, or after mass updates, inserts, deletes, or after REORG. And Periodically
30. Give some example of statistics collected during RUNSTATS?
Col Count – Number of unique values in a column (if high index access is used), Number of columns populated.
31. In SPUFI suppose you want to select max. of 1000 rows , but the select returns only 200 rows. What are the 2 sqlcodes that are returned? - GS
100 ( for successful completion of the query ), 0 (for successful COMMIT if AUTOCOMMIT is set to Yes).
32. How would you print the output of an SQL statement from SPUFI? - GS
Print the output dataset.
33. How do you pull up a query which was previously saved in QMF ? - GS
34. How do you select a row using indexes? - GS
Specify the indexed columns in the WHERE clause.
35. Lot of updates have been done ona table due to which indexes have gone haywire. What do you do? – GS
Reorg
36. What are split indexes? ( exact question is not known ) GS
Ramesh, I think they were talking about what do you do if index splits occur due to mass inserts/updates. I think the answer is a REORG is required.
37. What happens when you say OPEN CURSOR?
If there is an ORDER BY clause, rows are fetched, sorted and made available for the FETCH statement. Other wise simply the cursor is placed on the first row.
In case of Open Cursor
If Cursor statement is complex (i.e. multiple tables accessed, access path use multiple indexes etc.) than materialization happenes and a temporary table is created.
In other case cursor is simply placed on first row depending on Order By clause
38. Is DECLARE CURSOR executable?
No.
39. Can you have more than one cursor open at any one time in a program ? - GS
Yes.
40. How would you find out the total number of rows in a table? - GS
Use SELECT COUNT(*) ...
41. How do you eliminate duplicate values in SELECT? - GS
Use SELECT DISTINCT ...
42. How do you find the maximum value in a column? - GS
Use SELECT MAX(...
43. What does the sqlcode of -818 pertain to? - GS
This is generated when the consistency tokens in the DBRM and the load module are different.
44. What is UNION,UNION ALL? - GS
UNION : eliminates duplicates
UNION ALL: retains duplicates
Both these are used to combine the results of different SELECT statements.
45. Suppose I have five SQL SELECT statements connected by UNION/UNION ALL, how many times should I specify UNION to eliminate the duplicate rows? - GS
Once.
46. What is dynamic SQL? - GS Dynamic SQL is a SQL statement created at program execution time.
47. What else is there in the PLAN apart from the access path? - GS
PLAN has the executable code for the SQL statements in the host program
48. When is the access path determined for dynamic SQL? - GS
At run time, when the PREPARE statement is issued.
49. Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened? - GS
Probably RUN STATS is not done and the program is using a wrong index due to incorrect stats.
Probably RUNSTATS is done and optimizer has chosen a wrong access path based on the latest statistics.
50. Apart from cursor, what other ways are available to you to retrieve a row from a table in embedded SQL? - GS
Single row SELECTs.
51. How do you retrieve the data from a nullable column? - GS
Use null indicators. Syntax INTO :HOSTVAR:NULLIND
52. What is the picture clause of the null indicator variable? - GS
S9(4) COMP.
53. What does it mean if the null indicator has -1, 0, -2
-1 : the field is null
0 : the field is not null
-2 : the field value is truncated
54. How do you insert a record with a nullable column?
To insert a NULL, move -1 to the null indicator
To insert a valid value, move 0 to the null indicator
55. Some questions on concatenate, substring features of DB2. - GS
56. What is IMAGECOPY ? - GS
It is full backup of a DB2 table which can be used in recovery.
57. When do you use the IMAGECOPY? - GS
To take routine backup of tables
After a LOAD with LOG NO
58. What is a clustering index ? - GS
A mandatory index defined on a partitioned table space. Causes the data rows to be stored in the order specified in the index. Obviously a table can have only one clustering index.
59. What are correlated subqueries? - GS
.
One in which the lower level nested select refers back to the table in the higher level.
60. What are the issues related with correlated subqueries? - GS
61. What is sqlcode -922 ?
62. What is sqlcode -811?
63. What is a DBRM, PLAN ?
DBRM: DataBase Request Module, has the SQL statements extracted from the host language program by the SQL precompile.
PLAN: A result of the BIND process. It has the executable code for the SQL statements in the DBRM.
64. What happens to the PLAN if index used by it is dropped? Plan is marked as invalid. The next time the plan is invoked, it is recreated.
65. What is the difference between primary key & unique index ?
66. What is QUIESCE?
A QUIESCE flushes all DB2 buffers on to the disk. This gives a correct snapshot of the database and should be used before any IMAGECOPY to maintain consistency.
67. Are views updatable ?
Not all of them. Some views are updatable e.g. single table view with all the fields or mandatory fields. Examples of non-updatable views are views which are joins, views that contain aggregate functions(such as MIN).
68. If I have a view which is a join of two or more tables, can this view be updatable? - GS
No.
69. What is a synonym ?
Synonym is an alternate name for a table or view. A synonym is accessible only by the creator.
70. What is FREEPAGE and PCTFREE in TABLESPACE creation?
PCTFREE: percentage of each page to be left free
FREEPAGE: Number of pages to be loaded with data between each free page
71. What is CHECK PENDING ? Tips on Mainframe Pend status of table space to check for different values. Usuall before load TS is pended in four different pend status. After load a image copy job is run which will eliminate these pend statuses
72. What are the 4 environments which can access DB2 ?
TSO, CICS, IMS and BATCH
73. What is outer join ?
Outer join is one in which you want both matching and non matching rows to be returned. DB2 has no specific operator for outer joins, it can be simulated by combining a join and a correlated sub query with a UNION.
74. What are simple, segmented and partitioned table spaces ?
Simple Tablespace:
Can contain one or more tables
Rows from multiple tables can be interleaved on a page under the DBAs control and maintenance
Segmented Tablespace:
Can contain one or more tables
Tablespace is divided into segments of 4 to 64 pages in increments of 4 pages. Each segment is dedicated to single table. A table can occupy multiple segments
Partitioned Tablespace:
Can contain one table
Tablespace is divided into parts and each part is put in a separate VSAM dataset.
75. How is a typical DB2 batch pgm executed ? Tips on Mainframe Use DSN utility to run a DB2 batch program. An example is shown:
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD) LIB('EDGS01T.OBJ.LOADLIB')
END
Use IKJEFT01 utility program to run this command in a JCL.
76. Assuming that a site’s standard is that pgm name = plan name, what is the easiest way to find out which pgms are affected by change in a table’s structure ?
Query the catalogue table SYSPLANDEP.
77. Name some fields from SQLCA.
SQLCODE, SQLERRM, SQLERRD ...
78. When do you specify the isolation level? How?
During the BIND process. ISOLATION ( CS/RR )...
79. How can you quickly find out the # of rows updated after a mass update statement?
Check the value stored in SQLERRD(3).
80. Consider the employee table with column PROJECT nullable. How can you get a list of employees who are not assigned to any project?
SELECT EMPNO
FROM EMP
WHERE PROJECT IS NULL;
81. Why SELECT * is not preferred in embedded SQL programs?
For three reasons:
• If the table structure is changed ( a field is added ), the program will have to be modified
• Program might retrieve the columns which it might not use, leading on I/O over head.
• The chance of an index only scan is lost.
82. What is filter factor?
Number of distinct col values/Number of rows in the table
83. What is index cardinality? - GS
84. What are the various locking levels available?
PAGE, TABLE, TABLESPACE
Subpage, row level with type2 indexes
85. How does DB2 determine what locking level to use?
Type of indexes, Bind
86. What are the disadvantages of PAGE level lock?
Concurrency is limited
87. What is lock escalation?
Lock moved from a subpage to page or page to tablespace
88. What are the various locks available?
SHARE, EXCLUSIVE, UPDATE
89. What is the difference between CS and RR isolation levels?
CS: Releases the lock on a page after use
RR: Retains all locks acquired till end of transaction
90. Can I use LOCK TABLE on a view?
No. To lock a view, take lock on the underlying tables.
91. What are COLLECTIONS?
Prefixes for a package name. Makes it convenient to use in PKLIST for plans.
92. When you COMMIT, is the cursor closed?
Yes.
93. How do you leave the cursor open after issuing a COMMIT? ( for DB2 2.3 or above only )
Use WITH HOLD option in DECLARE CURSOR statement. Has no effect in CICS. I believe CICS will retain posn after a SYNCPOINT???.
In pseudoconversation CURSOR with HOLD also gets closed
94. Give the COBOL definition of a VARCHAR field.
95. What is the physical storage length of each of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: 4bytes
TIME: 3bytes
TIMESTAMP: 10bytes
96. What is the COBOL picture clause of the following DB2 data types:
DATE, TIME, TIMESTAMP?
DATE: PIC X(10)
TIME : PIC X(08)
TIMESTAMP: PIC X(26)
97. What is the result of this query if no rows are selected:
SELECT SUM(SALARY)
FROM EMP
WHERE QUAL=‘MSC’;
NULL
98. What is the difference between SYNONYM and ALIAS?
SYNONYM: is dropped when the table or tablespace is dropped. Synonym is available only to the creator.
ALIAS: is retained even if table or tablespace is dropped. ALIAS can be created even if the table does not exist. It is used mainly in distributed environment to hide the location info from programs. Alias is a global object & is available to all.
99. My SQL statement SELECT AVG(SALARY) FROM EMP yields inaccurate results. Why?
Because SALARY is not declared to have NULLs and the employees for whom the salary is not known are also counted.
100.How do you retrieve the first 5 characters of FIRSTNAME column of EMP table?
SELECT SUBSTR(FIRSTNAME,1,5) FROM EMP;
101.How do you concatenate the FIRSTNAME and LASTNAME from EMP table to give a complete name?
SELECT FIRSTNAME || ‘ ‘ || LASTNAME FROM EMP;
102.What is the use of VALUE function?
Avoid handling NULLable fields. It assigns a default of 0 to numeric fields which are NULL.
103.What do you mean by NOT NULL WITH DEFAULT? When will you use it?
In insert if column is not specified than default value is taken
104.What do you mean by NOT NULL? When will you use it?
Column needs to have some value specified.
105.What are aggregate functions?
Max, Sum, Avg
106.What is REORG? When is it used?
107.How do I create a table MANAGER ( EMP#, MANAGER) where MANAGER is a foreign key which references to EMP# in the same table? Give the exact DDL.
108.Will precompile of an DB2-COBOL program bomb, if DB2 is down?
No. Because the precompiler does not refer to the DB2 catalogue tables.
109.Can you use MAX on a CHAR column?
YES.
110.What is the restriction on using UNION in embedded SQL?
It has to be in a CURSOR.
111.When does the authorization check on DB2 objects is done - at BIND time or run time?
Both, there is bind authority and execution authority
112.What is COPY PENDING status?
A state in which, an image copy on a table needs to be taken, In this status, the table is available only for queries. You cannot update this table. To remove the COPY PENDING status, you take an image copy or use REPAIR utility.
113.How many clustering indexes can be defined for a table?
Only one.
114.How does DB2 store NULL physically?
High Values
115.When would you prefer to use VARCHAR?
116.What are the disadvantages of using VARCHAR?
117.What happens to the plans when an index used by them is dropped?
Marked as invalid
118.What is auditing?
Logging updates
119.What is ACQUIRE/RELEASE in BIND?
When to release the lock at commit or task termination point.
Tips on COBOL
Tips on COBOL
1. Name the divisions in a COBOL program. - GS
IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.
2. What are the different data types available in COBOL?
Alpha-numeric (X), alphabetic (A) and numeric (9).
3. What does the INITIALIZE verb do? - GS
Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.
Numeric, Numeric edited items set to ZERO.
FILLER , OCCURS DEPENDING ON items left untouched.
4. What is 77 level used for ?
Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.
5. What is 88 level used for ?
For condition names.
6. What is level 66 used for ?
For RENAMES clause.
7. What does the IS NUMERIC clause establish ?
IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .
8. How do you define a table/array in COBOL? Tips on Mainframe 01 ARRAYS.
05 ARRAY1 PIC X(9) OCCURS 10 TIMES.
05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.
9. Can the OCCURS clause be at the 01 level?
No.
10. What is the difference between index and subscript? - GS
Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.
Need to have index for a table in order to use SEARCH, SEARCH ALL.
11. What is the difference between SEARCH and SEARCH ALL? - GS
SEARCH - is a serial search.
SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.
12. What should be the sorting order for SEARCH ALL? - GS
It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).
13. What is binary search? Tips on Mainframe Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.
14. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?
Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.
15. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning. - GS
Syntax:
SORT file-1 ON ASCENDING/DESCENDING KEY key....
USING file-2
GIVING file-3.
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.
file-1 is the sort workfile and must be described using SD entry in FILE SECTION.
file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.
file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.
file-1, file-2 & file-3 should not be opened explicitly.
INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.
OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.
16. How do you define a sort file in JCL that runs the COBOL program?
Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.
17. What are the two ways of doing sorting in a COBOL program? Give the formats. - GS
See question 16.
18. Give the format of USING and GIVING in SORT statement. What are the restrictions with it? - GS
See question 16. Restrictions - Cannot massage records, canot select records to be sorted.
19. What is the difference between performing a SECTION and a PARAGRAPH? - GS
Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.
Performing a PARAGRAPH will cause only that paragraph to be performed.
20. What is the use of EVALUATE statement? - GS
Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no ‘break’ is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.
21. What are the different forms of EVALUATE statement?
EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS
WHEN A=B AND C=D WHEN 100 ALSO ‘00’
imperative stmt imperative stmt
WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32’
imperative stmt imperative stmt
WHEN OTHER WHEN OTHER
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B
imperative stmt imperative stmt
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
22. How do you come out of an EVALUATE statement? - GS
After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.
23. In an EVALUATE statement, can I give a complex condition on a when clause?
Yes.
24. What is a scope terminator? Give examples.
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.
25. How do you do in-line PERFORM? - GS
PERFORM ... ...
END PERFORM
26. When would you use in-line perform?
When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.
27. What is the difference between CONTINUE & NEXT SENTENCE ?
CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)
28. What does EXIT do ?
Does nothing ! If used, must be the only sentence within a paragraph in OSVS COBOL. In COBOL II you can have other statements along with EXIT.
29. Can I redefine an X(100) field with a field of X(200)? Tips on Mainframe Yes. Redefines just causes both fields to start at the same location. For example:
01 WS-TOP PIC X(1)
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).
If you MOVE ‘12’ to WS-TOP-RED,
DISPLAY WS-TOP will show 1 while
DISPLAY WS-TOP-RED will show 12.
This works only if the level number is 01. If the respective level numbers were say 05, then you will get a severe error in compilation.
30. Can I redefine an X(200) field with a field of X(100) ?
Yes.
31. What do you do to resolve SOC-7 error? - GS
Basically you need to correct the offending data.
Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.
Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation
output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL.
If none of these are helpful, use judgement and DISPLAY to localize the source of error.
Some installtion might have batch program debugging tools. Use them.
32. How is sign stored in Packed Decimal fields and Zoned Decimal fields?
Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.
Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last byte.
33. How is sign stored in a comp-3 field? - GS
It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...
34. How is sign stored in a COMP field ? - GS
In the most significant bit. Bit is on if -ve, off if +ve.
35. What is the difference between COMP & COMP-3 ?
COMP is a binary storage format while COMP-3 is packed decimal format.
36. What is COMP-1? COMP-2?
COMP-1 - Single precision floating point. Uses 4 bytes.
COMP-2 - Double precision floating point. Uses 8 bytes.
37. How do you define a variable of COMP-1? COMP-2?
No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.
38. How many bytes does a S9(7) COMP-3 field occupy ?
Will take 4 bytes. Sign is stored as hex value in the last nibble.
General formula is INT((n/2) + 1)), where n=7 in this example.
39. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?
Will occupy 8 bytes (one extra byte for sign).
40. How many bytes will a S9(8) COMP field occupy ?
4 bytes.
41. What is the maximum value that can be stored in S9(8) COMP?
99999999
42. What is COMP SYNC?
Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.
For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next
one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the
binary data item will start from address 4. You might see some wastage of memory, but the access to this
computational field is faster.
43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?
In COBOL II: 16777215
44. How do you reference the following file formats from COBOL programs:
Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .
Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS
Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4
Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.
ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.
KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS
RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
45. What are different file OPEN modes available in COBOL?
Open for INPUT, OUTPUT, I-O, EXTEND.
46. What is the mode in which you will OPEN a file for writing? - GS
OUTPUT, EXTEND
47. In the JCL, how do you define the files referred to in a subroutine ?
Supply the DD cards just as you would for files referred to in the main program.
48. Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
Can rewrite(record length must be same), but not delete.
49. What is file status 92? - GS
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
50. What is file status 39 ?
Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You will get file status 39 on an OPEN.
51. What is Static, Dynamic linking?
In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).
A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.
52. What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to only MVS/ESA Enterprise Server).
These are compile/link edit options.
AMODE - Addressing mode. RMODE - Residency mode.
AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing. AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE.
RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only).
RMODE(ANY) - Can reside above or below 16 Meg line.
53. What compiler option would you use for dynamic linking?
DYNAM.
1. Name the divisions in a COBOL program. - GS
IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION, PROCEDURE DIVISION.
2. What are the different data types available in COBOL?
Alpha-numeric (X), alphabetic (A) and numeric (9).
3. What does the INITIALIZE verb do? - GS
Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.
Numeric, Numeric edited items set to ZERO.
FILLER , OCCURS DEPENDING ON items left untouched.
4. What is 77 level used for ?
Elementary level item. Cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.
5. What is 88 level used for ?
For condition names.
6. What is level 66 used for ?
For RENAMES clause.
7. What does the IS NUMERIC clause establish ?
IS NUMERIC can be used on alphanumeric items, signed numeric & packed decimal items and unsigned numeric & packed decimal items. IS NUMERIC returns TRUE if the item only consists of 0-9. However, if the item being tested is a signed item, then it may contain 0-9, + and - .
8. How do you define a table/array in COBOL? Tips on Mainframe 01 ARRAYS.
05 ARRAY1 PIC X(9) OCCURS 10 TIMES.
05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.
9. Can the OCCURS clause be at the 01 level?
No.
10. What is the difference between index and subscript? - GS
Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.
Need to have index for a table in order to use SEARCH, SEARCH ALL.
11. What is the difference between SEARCH and SEARCH ALL? - GS
SEARCH - is a serial search.
SEARCH ALL - is a binary search & the table must be sorted ( ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.
12. What should be the sorting order for SEARCH ALL? - GS
It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).
13. What is binary search? Tips on Mainframe Search on a sorted array. Compare the item to be searched with the item at the center. If it matches, fine else repeat the process with the left half or the right half depending on where the item lies.
14. My program has an array defined to have 10 items. Due to a bug, I find that even if the program access the 11th item in this array, the program does not abend. What is wrong with it?
Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE.
15. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning. - GS
Syntax:
SORT file-1 ON ASCENDING/DESCENDING KEY key....
USING file-2
GIVING file-3.
USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2
GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2.
file-1 is the sort workfile and must be described using SD entry in FILE SECTION.
file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.
file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL.
file-1, file-2 & file-3 should not be opened explicitly.
INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure.
OUTPUT PROCEDURE is executed after all records have been sorted. Records from the sort work file must be RETURNed one at a time to the output procedure.
16. How do you define a sort file in JCL that runs the COBOL program?
Use the SORTWK01, SORTWK02,..... dd names in the step. Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required.
17. What are the two ways of doing sorting in a COBOL program? Give the formats. - GS
See question 16.
18. Give the format of USING and GIVING in SORT statement. What are the restrictions with it? - GS
See question 16. Restrictions - Cannot massage records, canot select records to be sorted.
19. What is the difference between performing a SECTION and a PARAGRAPH? - GS
Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.
Performing a PARAGRAPH will cause only that paragraph to be performed.
20. What is the use of EVALUATE statement? - GS
Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no ‘break’ is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.
21. What are the different forms of EVALUATE statement?
EVALUATE EVALUATE SQLCODE ALSO FILE-STATUS
WHEN A=B AND C=D WHEN 100 ALSO ‘00’
imperative stmt imperative stmt
WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32’
imperative stmt imperative stmt
WHEN OTHER WHEN OTHER
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE
WHEN 100 ALSO TRUE WHEN 100 ALSO A=B
imperative stmt imperative stmt
WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)
imperative stmt imperative stmt
END-EVALUATE END-EVALUATE
22. How do you come out of an EVALUATE statement? - GS
After the execution of one of the when clauses, the control is automatically passed on to the next sentence after the EVALUATE statement. There is no need of any extra code.
23. In an EVALUATE statement, can I give a complex condition on a when clause?
Yes.
24. What is a scope terminator? Give examples.
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-EVALUATE; IF, END-IF.
25. How do you do in-line PERFORM? - GS
PERFORM ... ...
END PERFORM
26. When would you use in-line perform?
When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.
27. What is the difference between CONTINUE & NEXT SENTENCE ?
CONTINUE is like a null statement (do nothing) , while NEXT SENTENCE transfers control to the next sentence (!!) (A sentence is terminated by a period)
28. What does EXIT do ?
Does nothing ! If used, must be the only sentence within a paragraph in OSVS COBOL. In COBOL II you can have other statements along with EXIT.
29. Can I redefine an X(100) field with a field of X(200)? Tips on Mainframe Yes. Redefines just causes both fields to start at the same location. For example:
01 WS-TOP PIC X(1)
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).
If you MOVE ‘12’ to WS-TOP-RED,
DISPLAY WS-TOP will show 1 while
DISPLAY WS-TOP-RED will show 12.
This works only if the level number is 01. If the respective level numbers were say 05, then you will get a severe error in compilation.
30. Can I redefine an X(200) field with a field of X(100) ?
Yes.
31. What do you do to resolve SOC-7 error? - GS
Basically you need to correct the offending data.
Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first.
Many installations provide you a dump for run time abends ( it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the abend occurred. Examine the compilation
output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc ) in the JCL.
If none of these are helpful, use judgement and DISPLAY to localize the source of error.
Some installtion might have batch program debugging tools. Use them.
32. How is sign stored in Packed Decimal fields and Zoned Decimal fields?
Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.
Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last byte.
33. How is sign stored in a comp-3 field? - GS
It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...
34. How is sign stored in a COMP field ? - GS
In the most significant bit. Bit is on if -ve, off if +ve.
35. What is the difference between COMP & COMP-3 ?
COMP is a binary storage format while COMP-3 is packed decimal format.
36. What is COMP-1? COMP-2?
COMP-1 - Single precision floating point. Uses 4 bytes.
COMP-2 - Double precision floating point. Uses 8 bytes.
37. How do you define a variable of COMP-1? COMP-2?
No picture clause to be given. Example 01 WS-VAR USAGE COMP-1.
38. How many bytes does a S9(7) COMP-3 field occupy ?
Will take 4 bytes. Sign is stored as hex value in the last nibble.
General formula is INT((n/2) + 1)), where n=7 in this example.
39. How many bytes does a S9(7) SIGN TRAILING SEPARATE field occupy ?
Will occupy 8 bytes (one extra byte for sign).
40. How many bytes will a S9(8) COMP field occupy ?
4 bytes.
41. What is the maximum value that can be stored in S9(8) COMP?
99999999
42. What is COMP SYNC?
Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.
For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next
one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the
binary data item will start from address 4. You might see some wastage of memory, but the access to this
computational field is faster.
43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?
In COBOL II: 16777215
44. How do you reference the following file formats from COBOL programs:
Fixed Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0 .
Fixed Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, do not use BLOCK CONTAINS
Variable Block File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, BLOCK CONTAINS 0. Do not code the 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4
Variable Unblocked - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS V, do not use BLOCK CONTAINS. Do not code 4 bytes for record length in FD ie JCL rec length will be max rec length in pgm + 4.
ESDS VSAM file - Use ORGANISATION IS SEQUENTIAL.
KSDS VSAM file - Use ORGANISATION IS INDEXED, RECORD KEY IS, ALTERNATE RECORD KEY IS
RRDS File - Use ORGANISATION IS RELATIVE, RELATIVE KEY IS
Printer File - Use ORGANISATION IS SEQUENTIAL. Use RECORDING MODE IS F, BLOCK CONTAINS 0. (Use RECFM=FBA in JCL DCB).
45. What are different file OPEN modes available in COBOL?
Open for INPUT, OUTPUT, I-O, EXTEND.
46. What is the mode in which you will OPEN a file for writing? - GS
OUTPUT, EXTEND
47. In the JCL, how do you define the files referred to in a subroutine ?
Supply the DD cards just as you would for files referred to in the main program.
48. Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?
Can rewrite(record length must be same), but not delete.
49. What is file status 92? - GS
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
50. What is file status 39 ?
Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You will get file status 39 on an OPEN.
51. What is Static, Dynamic linking?
In static linking, the called subroutine is link-edited into the calling program , while in dynamic linking, the subroutine & the main program will exist as separate load modules. You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. (Even if you choose NODYNAM, a CALL identifier (as opposed to a CALL literal), will translate to a DYNAMIC call).
A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.
52. What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)? ( applicable to only MVS/ESA Enterprise Server).
These are compile/link edit options.
AMODE - Addressing mode. RMODE - Residency mode.
AMODE(24) - 24 bit addressing. AMODE(31) - 31 bit addressing. AMODE(ANY) - Either 24 bit or 31 bit addressing depending on RMODE.
RMODE(24) - Resides in virtual storage below 16 Meg line. Use this for 31 bit programs that call 24 bit programs. (OS/VS Cobol pgms use 24 bit addresses only).
RMODE(ANY) - Can reside above or below 16 Meg line.
53. What compiler option would you use for dynamic linking?
DYNAM.
Subscribe to:
Posts (Atom)