This test covers the material on:
It is intended that most of the questions will be about material included on assignments 1 through 4.
You may also want to look at the web pages on QSAM, and you may want to use the worksheets on COBOL arithmetic and edited output.
On this particular test, there is very little about macros other than the QSAM macros. The last topic, control break processing, is only about 10 percent of the test. COBOL tables are not included on this test.
QSAM and macros
You need to know the DCB parameters.
You need to know how to open and close files.
You need to know how to use GET and PUT in both modes.
You need to know which registers can be affected by QSAM macros and how.
You need to be aware that DCB data is found here and there in a COBOL program.
JCL
You need to understand the basic structure of a job: line length, columns, character set, // at the beginning of a line.
You need to understand the 3 major kinds of JCL statements (JOB, EXEC and DD) and the parameters for each.
You need to know the comment format.
You need to be aware of JOBLIB and STEPLIB.
Possible questions might involve writing DD statements or interpreting an EXEC statement.
JCL for common steps
You need to understand the compile & link-edit & fetch process and also the compile & load process.
For each of these common steps, you need to know the DD names, where they are used, and whether they are input or output in each step. (For instance, where is SYSLOUT used?) You do not need to memorize the names of the libraries.
You need to understand the basic concepts of buffers and blocking.
Utilities
You should understand IEFBR14 thoroughly. (This is not difficult).
Basic structure of a COBOL program
Data Division entries
Procedure Division code
control-break processing
You need to understand the logic of a control-break program: nested loops, rolling totals, etc.
True or False
If Field-A is Not Greater than Field-B
If Field-A Not > Field-B
Multiple Choice
01 Field-1 Pic 99V999 Value 54.729.
01 Field-2 Pic 99V99.
This statement:
Move Field-1 to Field-2 Rounde
A. will place the digits 5472 in Field-2.
B. will place the digits 5473 in Field-2.
C. will place the digits 54729 in Field-2.
D. will cause a message about a syntax error.
E. will cause an ABEND at run time.
A. If A = B or C = D
B. If A = B or B = C or C = D
C. If A = B or A = C or A = D
D. If A = B or A = C or C = D
A. an Else
B. an End-If
C. a period
D. any of the above
A. a single digit ranging from 1 to 7.
B. 6 digits in the form mmddyy.
C. 6 digits in the form yymmdd.
D. a Julian date in the form yyddd.
A. DSN, UNIT, SPACE, DISP
B. DSN, UNIT, DISP
C. DSN, DISP
D. DATA, DLM
E. None of the above sets of keyword parameters are correct
A. Job names, step names and DD names may be 1 to 8 characters
long.
B. The name (if any) of a temporary file begins with '&&'.
C. Every job must have at least one step.
D. We must always code the UNIT parameter on a DD statement.
E. JOBLIB is the DD name of a PDS containing load modules.
A. 66.
B. 10.
C. 64.
D. 94.
E. None of the above.
A. KC01234.MYPDS.CS465
B. KC01234.MYDATASET.CS465
C. KC01234.DATASET.FOR.MYPROG.PART1
D. All of the above are valid data set names.
E. B and C.
A. 28.
B. 128.
C. 256.
D. 512.
E. None of the above.
A. Program source code.
B. An executable object module.
C. A non-executable load module.
D. An executable load module.
E. A non-executable object module.
F. D and E
A. If zero is not equal to the return code from the previous step,
execute this step.
B. If zero is not equal to the return code from the previous step,
skip this step.
C. If zero is not equal to the return code from all previous steps,
execute this step.
D. If zero is not equal to the return code from all previous steps,
skip this step.
A. DSN, DISP
B. DSN, UNIT, SPACE
C. DSN, UNIT, DISP, SPACE
D. DSN, DISP, SPACE
E. None of the above
A. Assembler.
B. Compiler.
C. Loader.
D. Linkage Editor.
E. A and B.
A. Assembler.
B. Compiler.
C. Loader.
D. Linkage Editor.
E. C and D.
A. 12.
B. 8.
C. 74.
D. It depends on the length of the member name.
E. A or C, depending on type of PDS member.
A. SYSOUT.
B. SYSLOUT.
C. SYSLMOD.
D. SYSLIN.
E. None of the above.
A. An object module.
B. A load module.
C. A source module.
D. A utility module.
E. None of the above.
A. JOB card
B. DD card
C. EXEC card
D. A or C
E. None of the above.
01 Num-1 Pic 99V99 Value 12.89.
01 Num-2 Pic 999V9.
What digits are in Num-2 after execution of this statement?
Move Num-1 to Num-2.
A. 0128
B. 1280
C. 1239
D. 1300
E. This move is not allowed.
A. The DCB in the JCL is examined, the DCB in the program is
examined, and then the label records are examined.
B. The DCB in the program is examined, the DCB in the JCL is
examined, and then the label records are examined.
C. The buffers are examined, the OPEN statement is executed,
and the label records are used to construct the DCB.
D. The label records are examined, the DCB in the program is
examined, and then the DCB in the JCL is examined.
E. None of the above.
05 Num-A Pic $$$$,$$9.99CR.How many spaces will be needed to print Num-A ?
A. 8
B. 10
C. 11
D. 13
E. 14
A. DSN, UNIT, SPACE, DISP
B. DSN, UNIT, DISP
C. DSN, DISP
D. DATA, DLM
E. None of the above sets of keyword parameters are correct.
A. DSN
B. UNIT
C. SPACE
D. DISP
E. none of the above
A. catalog a data set
B. delete a data set
C. uncatalog a data set
D. create a new data set or PDS
E. grant permission to other users to read or modify a data set
Coding problems, long and short
Add Num-1 Num-2 Num-3 Giving Num-4 Rounded.
Columns Contents
1-5 Item ID
6-8 Quantity Sold
9-14 Price Each (dollars and cents)
15-34 Description
35-80 Unused
And A Few More Problems
You may assume the main program contains these lines:
Move 0 to Company-Total.
Read Sales-File At end Move 'Y' to S-EOF.
Perform 100-Process-One-Region until S-EOF = 'Y'.
Write the procedure division code for 100-Process-One-Region. Do not attempt to write the whole program. (15 points)
You do not need to show any data division code, but use good data names that show what you are incrementing, saving, or comparing.
//MYJOB JOB, 'MICKEY MOUSE',TIME=(5,),PARM='ALL'
// STEP1 EXEC IEBPTPCH,REGION=1592
//INPUTDATA DD DSN=KC0ABCD.CSCI465.AUTUMN09.HW6.DATA.V1
// UNIT=SYSALLDA,SPACE=(TRK,(5,1)
DISP=(OLD,KEEP,KEEP)
//WKSP DD DSN=&&TEMP,UNIT=SYSALLDA,
// SPACE=(TRK,(1,1)),DISP=(NEW,KEEP)
PUT TRDCB,TRLINEAt another point in the same program, I write this line:
GET TRDCBWhat is the MACRF in this DCB?
01 Bonus Pic 9(4)V99.
01 Salary Pic 9(5)V99.
01 Total-Salary Pic 9(5)V99.
Now suppose that at some point in our program, Bonus contains the
value 2080.00 and Salary contains the value 98000.00. Suppose we
now execute this statement:
Add Bonus to Salary Giving Total-Salary
(a) What value will appear in Total-Salary?
(b) If this referred to your total annual salary, would you be happy with this result?
(c) How can the code be improved to catch errors like this? (This is a short answer.)
05 T-Amount Pic S9(4)V9(3).How many bytes of space are used to store T-Amount?
Select In-Data Assign To DATAIN.Assume that the COBOL program input records are instream. The in-stream data may include lines that begin with // or /*. Code the DD statement for this file, including the delimiter.
01 First-Field Pic X(10) Value 'MAYBEMAYBE'.
01 Second-Field Pic X(6) Value 'OKOKOK'.
What are the contents of First-Field after execution of this
statement?
Move Second-Field to First-Field.
A. Accepts as input one or more object modules.
B. Creates a load module in memory.
C. Executes the program.
D. Saves the load module as a member of a PDS.
E. None of the above.
STEPA needs 704K of memory to execute.
STEPB needs 320K of memory to execute.
STEPC needs 448K of memory to execute.
If I want to put the REGION parameter on the JOB statement instead of the EXEC statements, how should it be coded to use no more memory than necessary?