Tips On Mainframe
Tips On Mainframe
Tips on Mainframe
This BOK is organised in the from of questions and answers. These are some tips on the
TSO environment which makes working on TSO easier.
ISPF Environment
12. If I am using 3.4 and try to create a new member in an empty PDS, I can’t ?
A. Use option 2 and the new member name.
13. I got a B37 abend when tried to save the file.
A. Your PDS is out of space. Start another session open this PDS in 3.4 and put a ‘z’
next to it. It will compress the PDS. All x37 abends are ‘out of space’ situations.
14. I got an error message ‘NO SPACE IN DIRECTORY’ while creating a member in
PDS.
A. Your PDS can no longer accommodate more members in it. You need to increase
the ‘Directory blocks’. Each directory block can hold at least 4 members.
15. I want to copy only the first 500 records of my file.
A. Use file-aid or dataexpert and give the number of records in the option.
16. The dataset I want is migrated, but I don’t want my screen to be frozen when I recall
it.
A. Type HRECALL next to the dataset name in 3.4
17. I want to send a message to another person logged on to TSO
A. Say ‘ TSO SEND ‘message line’ U(user_id)’. If the person in not logged on but
you want to send a message which he can read when he logs on say ‘ TSO SEND
‘message line’ U(user_id) LOGON’
18. I want to see the LIMIT of a GDG.
A. Use LISTCAT in TSO or File-Aid option 3.2
19. I want to know the % free and other statistics of my dataset.
A. If you press ‘right or PF11’ on your 3.4 listing you can see the dataset statistics or
use option 3.1 and I
20. I keep using certain commands that I want to save.
A. The commands you use regularly can be saved as a function key. E.g. – if you
often change a JCL, save it, submit it and then go to the job spool. You could save
a PF key as ‘save; sub; =IOF’ . To do this type ‘KEYS’ on ‘command line’ and
make the necessary entries.
21. I am not able to delete a dataset that resides on a tape.
A. Yes. You cannot delete/rename a tape dataset. Only you can uncatalog it.
ISPF Editor
22. How do I see only those lines that contain a particular string?
A. Type ‘X all’ then ‘F all ‘search-string’
23. Now I want to see only those lines that contain a particular value in the display I get
after doing an ‘X all, F all’.
A. Type ‘ F new_value all nx’. ‘nx’ will restrict the search only to the displayed lines.
24. How do I go to a particular line numbers ?
A. Use ‘L search-string’ command. This is the Label command.
25. I want to find for a search-string that is Not prefix/suffix of another word. I want to
find for an instance of a search-string that is whole word by itself. How can I do this?
A. Use keyword ‘word’ at the end of find command. E.g., ‘f job word’ will find for
the whole word ‘job’.
26. How do I specify the direction of search i.e., how do I search for a string in backward
/ forward direction (w.r.t., your current cursor position)?
A.
27. How do I search for a value say '0980312' stored in comp-3 format?
A. Type F X’0980312’.
28. How do I do case sensitive search find for a given search-string?
A. Just, enclose the search-string within quotes and have a letter C in front of the
string itself. For e.g., F C’FindMe’ will find all FindMe strings only if the case
matches.
29. How do I find for any non-blank characters?
A. Use picture string ‘^’. E.g., “F P’^’ 36” will find the next non-blank characters in
column 36.
30. How do I find for any numeric character?
A. Use picture string ‘#’. E.g., 1. “F p’#’” finds the next numeric character. 2. “F
‘PAGE ##’ will find the next instance of the string ‘page followed by a blank
followed by 2 numeric characters’.
42. How do I make the numbers on Col 1-6 contiguous, i.e., the COBOL numbers
A. Type 'RENUM'. ISPF sometimes recommends you to do this. You can ignore it.
43. How do I replace a particular value in a particular column with a constant value?
A. Type c ‘from_value’ ‘to_value’ 6 all. If you want this change in a particular range
of rows, you’ll have to block the rows with ‘xx’ and say ‘c from_value to_value 6
x all’. Here ‘6’ is the column number.
44. I want to copy a block of records from one dataset to another.
A. Block the records and type ‘CUT’ at the command line. Open the other dataset in
edit mode and type ‘PASTE’ at the command line and type ‘a’ or ‘b’ on the row
after / before which you want these records.
45. I have a file of record length 240 and want to know in which column the value I am
looking at occurs.
A. Say cols on the Command line if in browse mode and in the column command if
in edit mode.
File-Aid
Common Abends:
COBOL-FAQs
Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES.
Numeric, Numeric edited items set to ZERO.
FILLER , OCCURS DEPENDING ON items left untouched.
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 - .
01 ARRAYS.
05 ARRAY1 PIC X(9) OCCURS 10 TIMES.
05 ARRAY2 PIC X(6) OCCURS 20 TIMES INDEXED BY WS-INDEX.
No.
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.
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:
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
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.
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.
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.
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.
Yes.
Scope terminator is used to mark the end of a verb e.g. EVALUATE, END-
EVALUATE; IF, END-IF.
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.
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.
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).
Yes.
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.
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...
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 ?
4 bytes.
41. What is the maximum value that can be stored in S9(8) COMP?
99999999
43. What is the maximum size of a 01 level item in COBOL I? in COBOL II?
44. How do you reference the following file formats from COBOL programs:
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?
Logic error. e.g., a file is opened for input and an attempt is made to write to it.
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.
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.
53. What compiler option would you use for dynamic linking?
DYNAM.
Db2 Faqs
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.
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.
When multiple of rows are to be retrieved with embedded SQL, a cursor should be used.
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
DeCLarations GENerator: used to create the host language copy books for the table
definitions. Also creates the DECLARE table.
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 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.
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 ).
Make sure that the PLAN_TABLE is created. Do RUNSTATS. ( Any thing else? )
In userid.PLAN_TABLE
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.)
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
24. I use CS and update a page. Will the lock be released after I am done with that page?
No
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.
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
After a load, or after mass updates, inserts, deletes, or after REORG. And Periodically
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
32. How would you print the output of an SQL statement from SPUFI? - GS
33. How do you pull up a query which was previously saved in QMF ? - GS
35. Lot of updates have been done ona table due to which indexes have gone haywire.
What do you do? – GS
Reorg
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.
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
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
This is generated when the consistency tokens in the DBRM and the load module are
different.
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.
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
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
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.
.
One in which the lower level nested select refers back to the table in the higher level.
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.
65. What is the difference between primary key & unique index ?
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.
Synonym is an alternate name for a table or view. A synonym is accessible only by the
creator.
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.
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.
DSN SYSTEM(DSP3)
RUN PROGRAM(EDD470BD) PLAN(EDD470BD)
LIB('EDGS01T.OBJ.LOADLIB')
END
79. How can you quickly find out the # of rows updated after a mass update statement?
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;
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
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?
NULL
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?
101.How do you concatenate the FIRSTNAME and LASTNAME from EMP table to
give a complete name?
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?
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.
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.
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.
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.
9. What do you do if you do not want to keep all the space allocated to a dataset? - GS
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?
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
//<stepname.dd> DSN=...
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.
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.
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.
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
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.
Means execute this step even if any of the previous steps, terminated abnormally.
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?
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
/*
No.
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?
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.
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.
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.
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.
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.
CICS-FAQs
6. What are the 3 working storage fields used for every field on the map? - GS
Length, attribute and input/output field.
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
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.
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.
32. What are SEND MAP MAPONLY & SEND MAP DATAONLY ?
Yes, the called routine must be defined in PPT and the calling program must use CALL
identifier..
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 ?
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.
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
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???
54. Can you simply check if length = 0 for checking if a field was modified?
No, not if ERASE EOF was used.
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.
62. Can you have CICS code in a copybook? If yes, what happens during compilation?
Yes. Needs to be preprocessed.
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.
67. I have TSQ with 15 items. I want to delete the 10th item. How do I do that?
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?
VSAM-FAQs
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..).
Yes
Note: these can be used only under IDCAMS and not from the TSO prompt.
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.
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 ?
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.
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).
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
?
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..
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.
17. How do you calculate record size of an alternate cluster? Give your values for both
unique and non-unique.
18. What is the difference between sequential files and ESDS files?
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.
23. Suppose 3 generations of a GDG exist. How would you reference the 1 st generation
in the JCL? - GS
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 ?
27. During processing of a VSAM file, some system error occurs and it is subsequently
unusable . What do you do ?
Run VERIFY.
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?
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.
OS/VS Cobol follows ANSI 74 stds while VS COBOL II follows ANSI 85 stds.
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.
If DB2 program, create plan by binding the DBRMs.