with_ans

August 21, 2017 | Author: sivakumar1.7.855836 | Category: Subroutine, Software Development, Computer Programming, Software, Software Engineering
Share Embed Donate


Short Description

IBM...

Description

1) PROGRAM-ID. MI030001 IS INITIAL PROGRAM. .... PROCEDURE DIVISION. .... PERFORM 0100-READ-INPUT THRU 0100-EXIT UNTIL END-OF-FILE. DISPLAY INPUT-RECORD-COUNT. GOBACK. .... 0100-READ-INPUT. READ INFILE AT END MOVE 'Y' TO END-OF-FILE-FLAG NOT AT END ADD +1 TO INPUT-RECORD-COUNT PERFORM 1000-PROCESS-RECORD. 0100-EXIT. EXIT. Referring to the sample code above, the INITIAL attribute is described by which one of the following statements? Choice 1 Only on dynamic CALLs will the called program's WORKING-STORAGE fields have the initial values that are coded for them. Choice 2 Only on static CALLs will the called program's WORKING-STORAGE fields have the initial values that are coded for them. Choice 3 It informs the compiler that each time the program is called, all WORKING-STORAGE fields will have the initial values that are coded for them. Choice 4 Coding this attribute for a statically or dynamically CALLed program has the same effect as coding the CANCEL command before issuing the next CALL to it. Choice 5 When called, all files defined with the EXTERNAL attribute are closed when the program returns control to the calling program. 2) WORKING-STORAGE SECTION. 77 77 77

OT-HOURS PIC S9(3) COMP-3. REG-HOURS PIC S9(3) COMP-3. OT-COUNT PIC S9(3) COMP-3 VALUE +1.

PROCEDURE DIVISION. .... IF REG-HOURS > +40 COMPUTE OT-HOURS = REG-HOURS - 40 ADD +1 TO OT-COUNT. .... Given that OT-COUNT is not modified anywhere else in the sample code above, after executing the segment 1000 times, which one of the following is the value contained in the field OT-COUNT? Choice 1 000 Choice 2 001 Choice 3 999

Choice 4 1000 Choice 5 1001 3) WORKING-STORAGE SECTION. 01 STATE-CODE PIC XX. 88 CALIFORNIA VALUE 'CA'. 88 COLORADO VALUE 'CO'. 88 CONNECTICUT VALUE 'CT'. 01 STATE-NAME PIC X(20). PROCEDURE DIVISION. IF CALIFORNIA MOVE 'CALIFORNIA' TO STATE-NAME ELSE IF COLORADO MOVE 'COLORADO' TO STATE-NAME ELSE MOVE 'CONNECTICUT' TO STATE-NAME. Assume a value of TN is stored in the field STATECODE. Which one of the following logic errors is embedded in the scenario above? Choice 1 TN is not defined as a valid value. Choice 2 The scenario will abend. Choice 3 The scenario assumes there are only three possible values for STATE-CODE. Choice 4 An EVALUATE statement should be used. Choice 5 The scenario will execute efficiently. 4) REPORT SECTION. RD SalesReport CONTROLS ARE FINAL CityCode SalesPersonNum PAGE LIMIT IS 66 HEADING 1 FIRST DETAIL 6 LAST DETAIL 42 FOOTING 52. In the sample record layout above, which one of the following is the maximum number of lines of detail will be written per page of this report? Choice 1 37 Choice 2 42 Choice 3 52 Choice 4 60 Choice 5 66 0100 IF EMPLOYEE-CLASS = '01' 0200 IF EMPLOYEE-TYPE = 'SE' 0300 PERFORM SPECIAL-EMPLOYEE 0400 ELSE 0500 NEXT SENTENCE 0600 END-IF 0700 PERFORM SPECIAL-CLASS 0800 ELSE 0900 PERFORM MANAGER-CLASS

1000 IF EMPLOYEE-TYPE = 'SE' 1100 PERFORM SPECIAL-EMPLOYEE 1200 END-IF 1300 END-IF. 1400 PERFORM GET-NEXT-EMPLOYEE Referring to the sample code above, if: employee-class='01' employee-type = 'XE' which perform statement is executed? Choice 1 0300 Choice 2 0700 Choice 3 0900 Choice 4 1100 Choice 5 1400 Sample Code 0100 IF EMPLOYEE-CLASS = '01' 0200 IF EMPLOYEE-TYPE = 'SE' 0300 IF EMPLOYEE-AGE > 50 0400 PERFORM PERFORM BONUS-APPLICATION 0500 END-IF 0600 ELSE 0700 PERFORM SPECIAL-EMPLOYEE 0800 END-IF 0900 PERFORM SPECIAL-CLASS 1000 END-IF. 1100 PERFORM NEXT-TASK. In the sample code above, if employee-class = '01' and employee-type = 'SE' and employee-age = 50; which one of the following statements is executed? Choice 1 0400 Choice 2 0600 Choice 3 0700 Choice 4 0900 Choice 5 1200 0100 IF EMPLOYEE-CLASS = '01' 0200 IF EMPLOYEE-TYPE = 'SE' 0300 NEXT SENTENCE 0400 ELSE 0500 PERFORM ORDINARY-EMPLOYEE 0600 END-IF 0700 IF EMPLOYEE-TYPE = 'ES' 0800 PERFORM EXTRAORDINARY-EMPLOYEE 0900 END-IF 1000 END-IF. 1100 PERFORM NEXT-TASK. Referring to the sample code above, if employee-class ='01' and employee-type ='SE', which one of the following statements is executed? Choice 1

0400 Choice 0600 Choice 0700 Choice 0800 Choice 1100

2 3 4 5

0100 IF EMPLOYEE-CLASS = '01' 0200 IF EMPLOYEE-TYPE = 'SE' 0300 NEXT SENTENCE 0400 ELSE 0500 PERFORM ORDINARY-EMPLOYEE 0600 END-IF 0700 IF EMPLOYEE-TYPE = 'ES' 0800 PERFORM EXTRAORDINARY-EMPLOYEE 0900 END-IF 1000 END-IF. 1100 PERFORM NEXT-TASK. In the sample code above, if employee-class is equal to '01' and employee-type is NOT equal to 'SE', which one of the following statements is executed? Choice 1 0400 Choice 2 0500 Choice 3 0600 Choice 4 0800 Choice 5 1100 05 DUMP-CODE PIC S9(4) VALUE 4. 05 DUMP-REGISTER PIC S9(4) VALUE ZEROS. 05 DUMP-RESULT PIC S9(4) VALUE ZEROS. DIVIDE DUMP-CODE BY DUMP-REGISTER GIVING DUMP-RESULT. The sample code above causes an error when left as is. Which one of the following, when added to the statement, avoids this error and allows the program to continue? Choice 1 ON OVERFLOW MOVE 1 TO DUMP-RESULT Choice 2 IF DUMP-REGISTER = 0 END-PROGRAM. Choice 3 ON ERROR INITIALIZE DUMP-RESULT Choice 4 ON SIZE ERROR MOVE 0 to DUMP-RESULT Choice 5 IF DUMP-RESULT NOT NUMERIC MOVE ZERO TO DUMP-RESULT

DATA DIVISION. FILE SECTION. FD INPUT-FILE GLOBAL. 01 INPUT-RECORD. 05 INPUT-DATA PIC X(80). Which one of the following statements describes what the GLOBAL clause feature as illustrated in the sample code above provides?

Choice 1 Any data item subordinate to a GLOBAL data item is considered GLOBAL. Choice 2 The record is available for use in the contained program, while issuing I/O upon the file is not. Choice 3 File Descriptions may be declared as GLOBAL. Choice 4 Any program directly or indirectly contained within the program which has the GLOBAL File Description can use the file. Choice 5 The GLOBAL clause may only be coded on 01 level data items. 05 S-A02-CHECK PIC X(01). 88 S-A02-FOUND VALUE 'Y'. 88 S-A02-NOT-FOUND VALUE 'N'. S0300-PROCESS-A02. IF I-RECORD-TYPE = 'A02' SET S-A02-FOUND TO TRUE ADD 1 TO A-A02-RECORD-COUNT END-IF. PERFORM S0400-WRITE-RECORD. S0400-WRITE-RECORD. IF S-A02-FOUND MOVE I-RECORD WRITE O-A02-RECORD END-IF.

TO O-A02-RECORD

Referring to the above Working Storage field and sample code, a problem has occurred with records that are NOT A02 records being written to the A02 report. Which one of the following statements do you add to S0400 to correct this problem? Choice 1 MOVE 'N' TO S-A02-FOUND Choice 2 SET S-A02-NOT-FOUND TO TRUE Choice 3 INITIAL S-A02-CHECK Choice 4 RESET S-A02-CHECK Choice 5 SET S-A02-FOUND TO TRUE 0100 INITIAL-READ. 0110 READ MASTER-FILE 0120 AT END MOVE 'Y' TO MASTER-EOF-SW. 0130 READ TRANSACTION-FILE 0140 AT END MOVE 'Y' TO TRANSACTION-EOF-SW. 0150 PERFORM PROCESS-FILE 0160 UNTIL END-OF-MASTER OR WORKING-STORAGE SECTION. 01 FIELDA PIC S9(1)V9(3) COMP-3 VALUE +1.123. 01 FIELDB PIC S9(1)V9(3) COMP-3 VALUE +1.678. 01 FINAL-RESULT PIC S9(2)V9(2) COMP-3. PROCEDURE DIVISION. MULTIPLY FIELDA BY FIELDB GIVING FINAL-RESULT ON SIZE ERROR MOVE 1 TO FINAL-RESULT. Upon execution of the sample code above, the field FINAL-RESULT contains which one of the following values? Choice 1 1 Choice 2 1V8

Choice 3 1V88 Choice 4 1V89 Choice 5 1V884 05 S-A02-CHECK 88 S-A02-FOUND 88 S-A02-NOT-FOUND

PIC X(01). VALUE 'Y'. VALUE 'N'.

05 A-A02-RECORD-COUNT

PIC 9(03).

Code needs to be added to a program to determine if any A02 record types are processed and a switch set to that effect. Using the fields in the sample code above, which one of the following is the correct modification? Choice 1 IF I-RECORD-TYPE = 'A02' SET S-A02-NOT-FOUND TO TRUE END-IF. Choice 2 IF I-RECORD-TYPE = 'A02' SET S-A02-CHECK TO TRUE END-IF. Choice 3 IF I-RECORD-TYPE = MOVE 'N' END-IF. Choice 4 IF I-RECORD-TYPE = SET S-A02-FOUND END-IF. Choice 5 IF I-RECORD-TYPE = MOVE 'Y' END-IF.

'A02' TO S-A02-NOT-FOUND 'A02' TO TRUE 'A02' TO S-A02-FOUND

01 X PIC 9. 01 DATA-FIELDS. 05 FLDA PIC X(11) VALUE 'SNOOKIEPOOH'. 05 FLDB PIC X(11) VALUE 'SNOOKIEbbbb'. 05 FLDC PIC X(11) VALUE 'WOOKIEbbbbb'. 05 FLDD PIC X(11) VALUE 'WICKIEWOCKb' ... COMPUTE X = ORD-MIN(FLDA FLDB FLDC FLDD). Which one of the following values is contained in X following execution of the COMPUTE statement in the sample code above? Choice 1 0 Choice 2 1 Choice 3 2 Choice 4 3 Choice 5 4 DATA DIVISION. WORKING-STORAGE SECTION. 01 FIELDA PIC S9(7) COMP-3 VALUE +1234567. 01 FIELDB PIC Z(3).99. PROCEDURE DIVISION. MOVE FIELDA TO FIELDB.

The receiving field contains which one of the following values upon execution of the sample code above? Choice 1 123.00 Choice 2 123.45 Choice 3 345.67 Choice 4 567.00 Choice 5 12345.67 Which one of the following statements describes what the TEST option does? Choice 1 It is used only when testing batch programs. Choice 2 It allows interactive debugging of batch or online programs. Choice 3 It provides the ability to restart a full-screen debugging session. Choice 4 It is used only when testing CICS programs. Choice 5 It invokes the full-screen version of the debugger for online programs. EVALUATE HEIGHT ALSO WEIGHT WHEN 60 THRU 67 ALSO 140 THRU 170 MOVE 'GOOD' TO BMR-INDEX WHEN 60 THRU 67 ALSO 171 THRU 999 MOVE 'BAD ' TO BMR-INDEX END-EVALUATE. Which one of the following correctly explains the sample code shown above? Choice 1 IF HEIGHT > 59 AND IF HEIGHT < 68 AND IF WEIGHT > 139 AND IF WEIGHT < 171 MOVE 'GOOD' TO BMR-INDEX. Choice 2 IF HEIGHT > 59 IF HEIGHT < 68 IF WEIGHT > 139 IF WEIGHT < 171 MOVE 'GOOD' TO BMR-INDEX ELSE MOVE 'BAD ' TO BMR-INDEX. Choice 3 [Assume inclusive values!] It checks height and weight. If height is 60-67 inches and weight is 140-170 pounds, it is considered GOOD. If height is 60-67 inches and weight is 171-999 pounds, it is considered BAD. Choice 4 It checks height and weight. If height is between 59 and 68 inches and weight is between 140 and 170 pounds, it is considered GOOD. If height is between 59 and 68 inches and weight is between 171 and 999 pounds, it is considered BAD. Choice 5

IF HEIGHT > 60 AND HEIGHT < 67 IF WEIGHT > 140 AND WEIGHT < 170 MOVE 'GOOD' TO BMR-INDEX ELSE NEXT SENTENCE ELSE CONTINUE. DATA DIVISION. WORKING-STORAGE SECTION. 01 PTR PIC S9(3) COMP-3. 01 TBL. 05 TBL-ENTRY OCCURS 5 TIMES PIC S9(3) COMP-3. 01 AFIELD PIC S9(3) COMP-3. 01 BFIELD PIC S9(3) COMP-3. PROCEDURE DIVISION. ADD AFIELD BFIELD TO PTR TBL-ENTRY (PTR). The sample code shown above is equivalent to which one of the following? Choice 1 ADD BFIELD BFIELD GIVING INTERMEDIATE-FIELD. ADD INTERMEDIATE-FIELD TO PTR. ADD INTERMEDIATE-FIELD TO TBL-ENTRY (PTR) Choice 2 ADD AFIELD BFIELD GIVING INTERMEDIATE-FIELD. ADD INTERMEDIATE-FIELD TO PTR. ADD INTERMEDIATE-FIELD TO TBL-ENTRY (AFIELD). Choice 3 ADD AFIELD BFIELD TO PTR. ADD BFIELD BFIELD TO TBL-ENTRY (PTR). Choice 4 ADD AFIELD AFIELD TO PTR. ADD BFIELD BFIELD TO TBL-ENTRY (PTR). Choice 5 ADD AFIELD BFIELD GIVING INTERMEDIATE-FIELD. ADD INTERMEDIATE-FIELD TO PTR. ADD INTERMEDIATE-FIELD TO TBL-ENTRY (PTR).

01) 0000-MAINLINE. 02) READ INPUT-RECORD 03) NOT AT END 04) PERFORM 0100-CHECK-PAGE-BREAKS 05) AT END ... 06) 0100-CHECK-PAGE-BREAKS. 07) IF INPUT-DIVISION NOT = CURRENT-DIVISION 08) PERFORM 0110-DIVISION-BREAK 09) ELSE 10) IF INPUT-DISTRICT NOT = CURRENT-DISTRICT 11) PERFORM 0120-DISTRICT-BREAK 12) ELSE 13) IF INPUT-SECTION NOT = CURRENT-SECTION 14) PERFORM 0130-SECTION-BREAK. 15) 0110-DIVISION-BREAK. .. 16) 0120-DISTRICT-BREAK. 17) PERFORM 0150-NEW-PAGE-TOTALS.

18) MOVE INPUT-DIVISION TO CURRENT-DIVISION. 19) MOVE INPUT-DISTRICT TO CURRENT-DISTRICT. 20) 0130-SECTION-BREAK. .. There is a logic error in the sample code above. Divisions contain Districts: Districts contain Sections. Page breaks should occur whenever division, district, or section changes. Which line of code must be changed in order to accomplish this? Choice 1 Line 18: MOVE INPUT-SECTION TO CURRENT-SECTION Choice 2 Line 18: MOVE INPUT-DISTRICT TO CURRENT-DISTRICT Choice 3 Line 18: MOVE INPUT-DIVISION TO INPUT-DISTRICT Choice 4 Line 19: MOVE INPUT-DIVISION TO CURRENT-DIVISION Choice 5 Line 19: MOVE INPUT-SECTION TO CURRENT-SECTION

EVALUATE TRUE ALSO TRUE WHEN SALARY + OVERTIME > 30000 ALSO YRS-OF-SVC > 5 COMPUTE OVERTIME = OVERTIME * 1.01 WHEN OTHER CONTINUE END-EVALUATE. Which one of the following correctly reflects the logic of the EVALUATE statement shown in the sample code above? Choice 1 COMPUTE SALARY = SALARY + OVERTIME. IF OVERTIME > 30000 IF YRS-OF-SVC > 5 COMPUTE OVERTIME = OVERTIME * 1.01. Choice 2 COMPUTE TEST-RESULT = SALARY + OVERTIME. IF TEST-RESULT > 30000 IF YRS-OF-SVC 5 COMPUTE OVERTIME = OVERTIME * 1.01. Choice 3 COMPUTE TEST-RESULT = SALARY + OVERTIME. IF TEST-RESULT 30000 IF YRS-OF-SVC > 5 COMPUTE OVERTIME = OVERTIME * 1.01. Choice 4 COMPUTE OVERTIME = SALARY + OVERTIME. IF SALARY > 30000 IF YRS-OF-SVC > 5 COMPUTE OVERTIME = OVERTIME * 1.01. Choice 5 COMPUTE TEST-RESULT = SALARY + OVERTIME. IF TEST-RESULT > 30000 IF YRS-OF-SVC > 5 COMPUTE OVERTIME = OVERTIME * 1.01

DATA DIVISION. WORKING-STORAGE SECTION. 01 DATA-AREA1. 05 DATA-AREA2 PIC S9(5). 01 DATA-AREA3 PIC S9(5) COMP-3 VALUE +12345. PROCEDURE DIVISION. MOVE DATA-AREA3 TO DATA-AREA1. ADD +1 TO DATA-AREA2. Which one of the following exceptions results from the execution of the ADD statement in the sample code above? Choice 1 data exception Choice 2 fixed-point overflow exception Choice 3 specification exception Choice 4 decimal divide exception Choice 5 The value of DATA-AREA2 becomes +12346.

0080 IF PROCESS-FILE-TRUE 0090 READ INPUT-FILE AT END 0100 IF INPUT-COUNTER = ZERO 0110 PERFORM EMPTY-FILE 0120 ELSE 0130 PERFORM NON-EMPTY-FILE 0140 END-IF 0150 END-READ 0160 ELSE 0170 PERFORM SKIP-PROCESSING 0180 END-IF. In the example shown in the sample code above, the END-IF on line 0140 terminates the statement on which one of the following lines? Choice 1 0080 Choice 2 0100 Choice 3 0160 Choice 4 0170 Choice 5 0180

IF I-PLAYER-POSITION = '1' ADD 1 TO A-PITCHER-COUNT ELSE IF I-PLAYER-POSITION = '2' ADD 1 TO A-CATCHER-COUNT ELSE IF I-PLAYER-POSITION = '3' ADD 1 TO A-FIRST-COUNT ELSE IF I-PLAYER-POSITION = '4' ADD 1 TO A-SECOND-COUNT ELSE IF I-PLAYER-POSITION = '5' ADD 1 TO A-THIRD-COUNT END-IF

END-IF END-IF END-IF END-IF. Which one of the following Working Storage fields is used in an EVALUATE statement to replace the IF/ELSE logic in the sample code above? Choice 1 05 W-PLAYER-POSITION PIC X(01) VALUE '1' '2' '3' '4' '5'. Choice 2 05 W-PLAYER-POSITION PIC X(01). 88 W-PITCHER VALUE '1'. Choice 3 05 W-PLAYER-POSITION PIC X(01). 88 W-PITCHER VALUE '1'. 88 W-CATCHER VALUE '2'. 88 W-FIRST VALUE '3'. 88 W-SECOND VALUE '4'. 88 W-THIRD VALUE '5'. Choice 4 05 W-PITCHER PIC X(01) VALUE '1'. 05 W-CATCHER PIC X(01) VALUE '2'. 05 W-FIRST PIC X(01) VALUE '3'. 05 W-SECOND PIC X(01) VALUE '4'. 05 W-THIRD PIC X(01) VALUE '5'. Choice 5 05 W-PLAYER-POSITION PIC X(01).

Which one of the following sets of sections are found in the Environment Division? Choice 1 Communication Section and File Section Choice 2 Configuration Section and Input-Output Section Choice 3 Configuration Section and Data Section Choice 4 File Section and Data Definition Storage Section Choice 5 Data Section and Procedure Section

A large text field contains all the first names of the students in a first grade class with each entry separated by a comma. Use the INSPECT statement to determine the number of names in the text field. If the text field contained only three names, there would be only two commas, for example, "BARRY, BRETT, HAL." 05 W-TEXT-FIELD PIC X(500). 05 W-NUM-OF-STUDENTS PIC 9(03). 05 A-COUNT1 PIC 9(03). Referring to the Working Storage fields in the scenario above, which one of the following correctly handles these requirements? Choice 1 MOVE 0 TO A-COUNT1 INSPECT W-TEXT-FIELD TALLYING A-COUNT1 FOR ALL ',' ADD 1 TO A-COUNT1 GIVING W-NUM-OF-STUDENTS. Choice 2 MOVE 0 TO A-COUNT1 INSPECT W-TEXT-FIELD REPLACING A-COUNT1 FOR ALL ',' ADD 1 TO A-COUNT1 GIVING W-NUM-OF-STUDENTS. Choice 3

MOVE 0 TO A-COUNT1 INSPECT W-TEXT-FIELD TALLYING A-COUNT1 FOR ALL ','. Choice 4 MOVE 0 TO A-COUNT1 INSPECT W-TEXT-FIELD TALLYING A-COUNT1 FOR LEADING ',' ADD 1 TO A-COUNT1 GIVING W-NUM-OF-STUDENTS. Choice 5 INSPECT W-TEXT-FIELD ADD 1 TO A-COUNT1 FOR ALL ',' ADD 1 TO A-COUNT1 GIVING W-NUM-OF-STUDENTS

05 W-CLASS-GRADE 88 W-GRADE-EXCELLENT 88 W-GRADE-GOOD 88 W-GRADE-AVG 88 W-GRADE-POOR 88 W-GRADE-FAIL

PIC X(01). VALUE 'A'. VALUE 'B'. VALUE 'C'. VALUE 'D'. VALUE 'F'.

S0400-VERIFY-GRADE IF W-GRADE-EXCELLENT MOVE C-EXCELLENT-WORK TO W-COMMENT ELSE IF W-GRADE-GOOD MOVE C-GOOD-WORK TO W-COMMENT ELSE MOVE C-NO-COMMENT TO W-COMMENT END-IF. Referring to the above Working Storage field and sample code, which one of the following errors, if any, occurs in the sample code? Choice 1 TRUE or FALSE should be used on the IF statements. Choice 2 All '88 levels that were defined must be used in the IF statement. Choice 3 The statement does not contain any errors. Choice 4 Grades 'C', 'D', and 'F' all fall into the "no comment" range. Choice 5 Relational operators cannot be used when a data name is used for the IF statement.

AC = (AB SQUARED + BC SQUARED) Which one of the following correctly computes the value AC in the formula above? Choice 1 COMPUTE AC = (AB * AB) + (BC ** .5) + (BC ** .5) Choice 2 COMPUTE AC = .5 * (AB ** 2 + BC ** 2) Choice 3 MULTIPLY AB BY AB GIVING AB-SQRD. MULTIPLY BC BY BC GIVING BC-SQRD. ADD AB-SQRD, BC-SQRD GIVING ABC-TOTAL. COMPUTE AC = ABC-TOTAL * .5 Choice 4 COMPUTE AC = (BC + AB) * 2 Choice 5 COMPUTE AC = (AB ** 2) + (BC **2)

DATA DIVISION.

WORKING-STORAGE SECTION. 01 INPUT-POINTER USAGE IS INDEX GLOBAL. 01 INPUT-WORK-AREA GLOBAL. 05 DATA-INDEX1 USAGE IS INDEX. 05 DATA-INDEX2 USAGE IS INDEX. Referring to the sample code above, which one of the following statements describes what the GLOBAL clause feature provides? Choice 1 It provides a means to define a field that may be used in the subordinate programs nested within a superordinate program. Choice 2 It allows multiple programs to use the same field, defined at the 01 level, without passing it between programs via a CALL statement. Choice 3 Fields defined as elementary items may be passed between programs without using a CALL statement. Choice 4 It allows implicitly defined indexes to be used by multiple programs. Choice 5 Any field defined in WORKING-STORAGE with the GLOBAL clause may be passed between programs without using a CALL statement.

DATA DIVISION. WORKING-STORAGE SECTION. 01 COST-CENTER-TABLE. 05 COST-CENTER OCCURS 1000 TIMES PIC 9(8) VALUE 97516438. 01 COST-CENTER-INDEX USAGE IS INDEX. 01 COST-CENTER-RECEIVING PIC 9(4). ... PROCEDURE DIVISION. ... SET COST-CENTER-INDEX TO 930. MOVE COST-CENTER (COST-CENTER-INDEX) (5: ) TO COST-CENTER-RECEIVING. The sample code above moves which one of the following values to COST-CENTER-RECEIVING? Choice 1 6348 Choice 2 6438 Choice 3 6834 Choice 4 9571 Choice 5 9751

Main routine.... CALL subroutine USING BY CONTENT '0123'. Subroutine.... LINKAGE SECTION. 01 PASSED-FIELD PIC X(5). PROCEDURE DIVISION USING PASSED-FIELD. IF PASSED-FIELD = '0123 ' .....

The code shown above causes which one of the following exceptions to be raised? Choice 1 Data exception Choice 2 Decimal divide exception Choice 3 Execute exception Choice 4 Protection exception Choice 5 Operation exception

Code segment 1... EVALUATE TYPE-CODE = 'FM' ALSO FREQUENCY > 82 WHEN TRUE ALSO TRUE PERFORM ROUTINE-A WHEN TRUE ALSO FALSE PERFORM ROUTINE-B WHEN FALSE ALSO TRUE PERFORM ROUTINE-C WHEN OTHER PERFORM ROUTINE-D END-EVALUATE. Code Segment 2... IF TYPE-CODE = 'FM' AND FREQUENCY > 82 PERFORM ROUTINE-A ELSE IF TYPE-CODE = 'FM' AND FREQUENCY NOT > 82 PERFORM ROUTINE-B ELSE IF TYPE-CODE NOT = 'FM' AND FREQUENCY > 82 PERFORM ROUTINE-C ELSE PERFORM ROUTINE-D. Which one of the following describes the code segments shown in the sample code above? Choice 1 Inefficient Choice 2 Not equivalent Choice 3 Unbalanced Choice 4 Equivalent Choice 5 Illogical

FD O-REPORT-FILE. 01 O-REPORT-REC. 05 O-REPORT-HDR 05 05 O-REPORT-DATE. 10 O-REPORT-MM 10 10 O-REPORT-YY 05 O-REPORT-TIME

PIC X(40). PIC X(02) VALUE SPACES. PIC PIC PIC PIC

X(02). X(01) VALUE '/'. X(02). X(05).

01 WORK-AREAS. 05 W-DATE PIC X(08) VALUE '08/17/06'. 05 W-TIME PIC X(08) VALUE '03:10:44'.

Program Sample: 1) MOVE 'WORK HISTORY REPORT FOR: ' TO O-REPORT-HDR 2) MOVE W-DATE (1:2) TO O-REPORT-MM 3) MOVE W-DATE (7:2) TO O-REPORT-YY 4) MOVE W-TIME (1:8) TO O-REPORT-TIME When a page break occurs, a new heading is printed which includes the date and time as specified below. Which lines of code above prevent this from being produced correctly? Date 08/06 or MM/YY Time 03:10 or HH:MM Choice 1 Line 1 Choice 2 Line 2 Choice 3 Lines 2 and 3 Choice 4 Line 3 Choice 5 Line 4

INITIALIZE has NO effect on which one of the following types of fields? Choice 1 PIC 9(..) Choice 2 PIC S9(..) Choice 3 PIC ZZ,ZZ9.99 Choice 4 PIC S9(..) COMP-3 Choice 5 FILLER or index items

0010 MAIN-LINE. 0020 OPEN INPUT T-FILE. 0030 OPEN I-O M-FILE. 0040 PERFORM UNTIL EOF-T-FILE 0050 READ T-FILE NEXT 0060 AT END MOVE 'Y' TO SW-EOF-T-FILE 0070 NOT AT END 0080 MOVE T-FILE-KEY TO M-FILE-KEY 0090 READ M-FILE 0100 INVALID KEY 0110 MOVE T-INFO to M-INFO 0120 WRITE M-REC 0130 INVALID KEY 0140 PERFORM BAD-M-IO 0150 END-WRITE 0160 NOT INVALID KEY 0170 MOVE T-INFO TO M-INFO 0180 REWRITE M-REC 0190 INVALID KEY 0200 PERFORM BAD-M-IO 0210 END-REWRITE 0220 END-READ 0230 END-READ 0240 END-PERFORM. The code shown in the scenario above is an example of a sequential transaction file updating an indexed master file. Which one of the following statements or clauses causes the perform loop to end?

Choice 1 Line 0060 Choice 2 Line 0100 Choice 3 Line 0130 Choice 4 Line 0140 Choice 5 Line 0190

WORKING-STORAGE SECTION. 01 FIELDA PIC S9(3)V9(2) COMP-3 VALUE +1.12. 01 FIELDB PIC S9(3)V9(2) COMP-3 VALUE +1.07. 01 FINAL-RESULT PIC S9(3)V9(3) COMP-3. PROCEDURE DIVISION. COMPUTE FINAL-RESULT = FIELDA * FIELDB. Considering truncation may result, upon execution of the sample code above, the field FINAL-RESULT contains which one of the following values? Choice 1 1V19 Choice 2 1V20 Choice 3 1V198 Choice 4 1V199 Choice 5 1V1984

Which one of the following sets of sections is used in the Data Division? Choice 1 Configuration File Working-Storage Linkage Choice 2 File Working-Storage Linkage Report Choice 3 File Working-Storage Communication Linkage Choice 4 File Working-Storage External-Storage Reporting Choice 5 I-O File Working-Storage Linkage

W-TOTAL-STUDENTS = Total number of students in Grade 5. W-TOTAL-PERMISSION = Total number of students in Grade 5 with permission slips for a field trip.

One teacher is required for every 10 students who will NOT be attending. Referring to the sample code above, which one of the following correctly calculates the number of teachers required to stay with the students who will NOT be attending the trip because they do NOT have permission slips? Choice 1 (W-TOTAL-STUDENTS - W-TOTAL-PERMISSION) / 10 GIVING WTOTAL-TEACHERS Choice 2 W-TOTAL-TEACHERS = W-TOTAL-STUDENTS - W-TOTALPERMISSION / 10 Choice 3 W-TOTAL-TEACHERS = (W-TOTAL-STUDENTS - W-TOTALPERMISSION) / 10 Choice 4 COMPUTE W-TOTAL-TEACHERS = (W-TOTAL-STUDENTS - WTOTAL-PERMISSION) / 10 Choice 5 CALCULATE W-TOTAL-TEACHERS = (W-TOTAL-STUDENTS - WTOTAL-PERMISSION) / 10

DATA DIVISION. WORKING-STORAGE SECTION. 01 AFIELD PIC S9(3) COMP-3 VALUE +020. 01 BFIELD PIC S9(3) COMP-3 VALUE +5. PROCEDURE DIVISION. DISPLAY BFIELD. Which one of the following values is displayed by the DISPLAY statement in the sample code above? Choice 1 +0 Choice 2 +1 Choice 3 +4 Choice 4 +6 Choice 5 +8

EVALUATE A * B WHEN 175 EVALUATE C + D WHEN 234 CONTINUE WHEN 432 PERFORM 432-ROUTINE WHEN OTHER PERFORM NOT-234-ROUTINE END-EVALUATE WHEN NOT 232 PERFORM NOT-232-ROUTINE WHEN OTHER PERFORM NOT-175-ROUTINE END-EVALUATE. Assume A = 25, B = 7, C = 186, and D = 48. Which one of the following paragraphs is performed as a result of the above sample code? Choice 1 NOT-175-ROUTINE Choice 2 NOT-232-ROUTINE Choice 3

NOT-234-ROUTINE Choice 4 432-ROUTINE Choice 5 None of the paragraphs specified will be performed ****************************??????????????????? Choice 1 FIELDB = $,$12,345.00 FIELDC = b,+12,345.00 FIELDD = $b,b12,345.00 Choice 2 FIELDB = $b12,345.00 FIELDC = +b12,345.00 FIELDD = $b12,345.00 Choice 3 FIELDB = b$b12,345.00 FIELDC = b+b12,345.00 FIELDD = $bb12,345.00 Choice 4 FIELDB = bb$12,345.00 FIELDC = bb+12,345.00 FIELDD = b$b12,345.00 Choice 5 FIELDB = $$12,345.00 FIELDC = bb+12,345.00 FIELDD = $bb12,345.00 ****** 0100 INITIAL-READ. 0110 READ MASTER-FILE 0120 AT END MOVE 'Y' TO MASTER-EOF-SW. 0130 READ TRANSACTION-FILE 0140 AT END MOVE 'Y' TO TRANSACTION-EOF-SW. 0150 PERFORM PROCESS-FILE 0160 UNTIL END-OF-MASTER OR 0170 END-OF-TRANSACTIONS. 0180 GOBACK. 0190 PROCESS-FILE. 0200 PERFORM UNTIL MASTER-KEY >= TRANSACTION-KEY 0210 WRITE MASTER-RECORD 0220 READ MASTER-RECORD AT END MOVE 'Y' TO MASTER-EOF-SW 0230 END-PERFORM. 0240 IF NOT MASTER-EOF 0250 EVALUATE TRUE 0260 WHEN TRANSACTION-IS-DELETE 0270 PERFORM DELETE-MASTER 0280 WHEN TRANSACTION-IS-ADD 0290 PERFORM ADD-MASTER 0300 WHEN TRANSACTION-IS-UPDATE 0310 PERFORM UPDATE-MASTER 0320 END-EVALUATE. 0330 DELETE-MASTER. 0340 IF MASTER-KEY TRANSACTION-KEY 0350 DISPLAY '??????' 0360 WRITE MASTER-RECORD. 0370 READ MASTER-FILE AT END MOVE 'Y' TO MASTER-EOFSW. 0380 PERFORM GET-NEXT-TRANSACTION. 0390 ADD-MASTER. ... 0460 UPDATE-MASTER. ... 0540 GET-NEXT-TRANSACTION. ... This is a tape-based master-transaction program segment. Assume the files are sorted into ascending sequence by key fields. Transactions may add, delete, or update master file records. Referring to statement #0350, what error, if any, has been detected? Choice 1

There is no corresponding transaction record for the master record being processed following the initial read. Choice 2 The master file is out of sequence. Choice 3 A logic error has occurred. Choice 4 The master record to be deleted does not exist. Choice 5 The transaction file is out of sequence. The RMODE(24) parameter specifies which one of the following in reference to a COBOL II program? Choice 1 Run above or below the 16-megabyte line. Choice 2 Run in regions up to 24-megabytes. Choice 3 Run in regions below the 24-megabyte line. Choice 4 Run only below the 16-megabyte line. Choice 5 Run only above the 16-megabyte line. IF S04-MBN = '1234' PERFORM HANDLE-SPECIAL-CUSTOMER END-IF. IF S04-MBN = '5678' PERFORM HANDLE-REGULAR-CUSTOMER END-IF. Which one of the following statements is equivalent to the sample code shown above? Choice 1 EVALUATE TRUE ALSO TRUE WHEN '1234' PERFORM HANDLE-REGULAR-CUSTOMER WHEN '5678' PERFORM HANDLE-SPECIAL-CUSTOMER END-EVALUATE. Choice 2 EVALUATE S04-MBN WHEN '1234' PERFORM HANDLE-SPECIAL-CUSTOMER WHEN '5678' PERFORM HANDLE-REGULAR-CUSTOMER END-EVALUATE. Choice 3 EVALUATE S04-MBN ALSO S04-MBN WHEN '1234' PERFORM HANDLE-REGULAR-CUSTOMER WHEN '5678' PERFORM HANDLE-SPECIAL-CUSTOMER END-EVALUATE. Choice 4 EVALUATE S04-MBN WHEN '1234' PERFORM HANDLE-REGULAR-CUSTOMER WHEN '5678' PERFORM HANDLE-SPECIAL-CUSTOMER END-EVALUATE. Choice 5 EVALUATE TRUE WHEN S04-MBN = '1234' PERFORM HANDLE-REGULAR-CUSTOMER WHEN S04-MBN = '5678' PERFORM HANDLE-SPECIAL-CUSTOMER END-EVALUATE. 5. 05 FIELDA

PIC X(20)

VALUE "ABCDEABCDEABCDEABCDE". Using the above definition, what value is stored in FIELDA after the execution of the following? PERFORM 4 TIMES INSPECT FIELDA REPLACING "B" BY X BEFORE INITIAL "D" END-PERFORM Choice 1 ABCDEABCDEABCDEABCDE Choice 2 AXCDEABCDEABCDEABCDE Choice 3 AXCDEAXCDEABCDEABCDE Choice 4 AXCDEAXCDEAXCDEABCDE Choice 5 AXCDEAXCDEAXCDEAXCDE

6. WORKING-STORAGE SECTION. 01 WORK-TABLE. 05 WK-ALPHA PIC A(2) VALUE 'AB'. 05 FILLER PIC X VALUE '*'. 05 WK-ALPHANUM PIC X(4) VALUE 'CDEF'. 05 PIC X VALUE '*'. 05 WK-NUM PIC 999. 05 PIC X VALUE '*'. PROCEDURE DIVISION. .... INITIALIZE WORK-TABLE. After execution of the statement in the sample code above, which one of the following values does WORKTABLE contain? NOTE: b = BLANK or UNPRINTABLE HEXADECIMAL character Choice 1 bb*bbbb*bb0* Choice 2 ABbCDEFb000b Choice 3 AB*CDEF*bb0* Choice 4 bbbbbbbb000b Choice 5 bb*bbbb*000*

7. Copy Member PLAYER. 01 I-PLAYER-REC. 05 I-PLAYER-LAST-NAME PIC X(20). 05 I-PLAYER-FIRST-NAME PIC X(10). 05 I-PLAYER-SALARY PIC 9(09)V99. For a new program, the player record layout needs to be used for an output file. Which one of the following COPY statements will imbed the above copy member and change the prefix of I- with O-? Choice 1 COPY PLAYER USING "O-" INSTEAD OF "I-" Choice 2 COPY PLAYER replacing ==I-== BY ==O-==.

Choice 3 COPY PLAYER CHANGE ALL "I-" "O-". Choice 4 COPY PLAYER remove "I-" add "O-". Choice 5 COPY O-PLAYER. DATA DIVISION. WORKING-STORAGE SECTION. 01 FLOATING-INSERTION-EDITS. 05 FIELDA PIC S9(5) COMP-3 VALUE +12345. 05 FIELDB PIC $,$$$,$$$.99. 05 FIELDC PIC +,+++,+++.++. 05 FIELDD PIC $ZZZ,ZZZ.99. PROCEDURE DIVISION. MOVE FIELDA TO FIELDB FIELDC FIELDD. Which one of the following represents the final values of FIELDB, FIELDC, and FIELDD after execution of the sample code above? NOTE: 'b' represents blank Choice 1 FIELDB = $$12,345.00 FIELDC = bb+12,345.00 FIELDD = $bb12,345.00 Choice 2 FIELDB = b$b12,345.00 FIELDC = b+b12,345.00 FIELDD = $bb12,345.00 Choice 3 FIELDB = bb$12,345.00 FIELDC = bb+12,345.00 FIELDD = b$b12,345.00 Choice 4 FIELDB = $b12,345.00 FIELDC = +b12,345.00 FIELDD = $b12,345.00 Choice 5 FIELDB = $,$12,345.00 FIELDC = b,+12,345.00 FIELDD = $b,b12,345.00

0100 INITIAL-READ. 0110 READ MASTER-FILE 0120 AT END MOVE 'Y' TO MASTER-EOF-SW. 0130 READ TRANSACTION-FILE 0140 AT END MOVE 'Y' TO TRANSACTION-EOF-SW. 0150 PERFORM PROCESS-FILE 0160 UNTIL END-OF-MASTER OR 0170 END-OF-TRANSACTIONS. 0180 GOBACK. 0190 PROCESS-FILE. 0200 PERFORM UNTIL MASTER-KEY >= TRANSACTION-KEY 0210 WRITE MASTER-RECORD 0220 READ MASTER-RECORD AT END MOVE 'Y' TO MASTER-EOF-SW 0230 END-PERFORM. 0240 IF NOT MASTER-EOF 0250 EVALUATE TRUE 0260 WHEN TRANSACTION-IS-DELETE 0270 PERFORM DELETE-MASTER 0280 WHEN TRANSACTION-IS-ADD 0290 PERFORM ADD-MASTER 0300 WHEN TRANSACTION-IS-UPDATE

0310 PERFORM UPDATE-MASTER 0320 END-EVALUATE. 0330 DELETE-MASTER. ... 0390 ADD-MASTER. 0400 IF MASTER-KEY = TRANSACTION-KEY 0410 DISPLAY '??????' 0420 WRITE MASTER-RECORD 0430 ELSE 0440 WRITE MASTER-RECORD FROM TRANSACTION-RECORD 0450 PERFORM GET-NEXT-TRANSACTION. 0460 UPDATE-MASTER. ... 0540 GET-NEXT-TRANSACTION. ... This is a tape-based master-transaction program segment. Assume the files are sorted into ascending sequence by key fields. Transactions may add, delete, or update master file records. Referring to statement #0410, what error, if any, has been detected? Choice 1 The master file is out of sequence. Choice 2 An add transaction has been encountered for an existing master. Choice 3 The master record to be deleted does not exist. Choice 4 The transaction file is out of sequence. Choice 5 No error has occurred.

10. You have been requested to create a sales report with totals and subtotals for salesmen, districts in the footers of the section breaks, and and national sales totals at the end of the report. Referring to the above, using COBOL REPORT WRITER, where do you calculate the sum totals for the report footer containing the National Totals? Choice 1 In a standard paragraph contained in the PROCEDURE DIVISION. Choice 2 By using the SUM clause on the fields in the TYPE IS CONTROL FOOTING FINAL line in the REPORT SECTION. Choice 3 In the FIGURATIVE CONSTANTS section Choice 4 Numeric fields defined in a FOOTER automatically sum the numeric fields from the control break one level up. Choice 5 It is calculated by coding an add of the fields in the DECLARATIVES SECTION.

Field in working storage: 05 S-EOF-CHECK 88 S-NOT-END-OF-FILE 88 S-END-OF-FILE

PIC X(01). VALUE 'N'. VALUE 'Y'.

MAINLINE. SET S-END-OF-FILE TO TRUE PERFORM A0100-PRINT-DETAIL-AND-FOOTERS UNTIL S-END-OF-FILE END-PERFORM.

Using the sample working storage and mainline section of a program, which one of the following is the logical error that occurred in the sample code above? Choice 1 Value checking on a switch is not valid on the UNTIL statement. Choice 2 The READ statement should be coded in the MAINLINE section, after the PERFORM. Choice 3 S-END-OF-FILE should not be set to true prior to this PERFORM. Choice 4 MAINLINE cannot contain any statements other than the PERFORM. Choice 5 S-END-OF-FILE should be initialized, not SET to true.

EVALUATE TRUE WHEN A >= B ALSO C NOT = B ALSO E NOT > F PERFORM FOUND-THIS END-EVALUATE. Which one of the following is the code segment in the scenario above equivalent to? Choice 1 IF A >= B IF C D IF E = B IF C B IF E NOT > F PERFORM FOUND-THIS. Choice 3 IF A NOT LESS B IF C NOT EQUAL D IF E NOT GREATER F PERFORM FOUND-THAT. Choice 4 IF A >= B IF C D IF E = TRANSACTION-KEY 0210 WRITE MASTER-RECORD 0220 READ MASTER-RECORD AT END MOVE 'Y' TO MASTER-EOF-SW 0230 END-PERFORM. 0240 ... 0250 DELETE-MASTER. 0260 ... 0270 ADD-MASTER. 0280 ... 0290 UPDATE-MASTER. 0300 ... This is a tape-based master-transaction program segment. Referring to statements #0200 through #0230, what condition is trapped by continuously reading the master file until its key is equal to or greater than the transaction file key? Choice 1 This code processes master records remaining after the other has encountered end-of-file. Choice 2 This code processes the remaining transaction records when the master file ends first. Choice 3 This code resequences the master file. Choice 4 This code processes the remaining transaction records when the master file starts first. Choice 5 This code traps the condition where there are no transactions for one or more master records. 36. Which one of the following statements is NOT permissible in COBOL II? Choice 1 INSPECT field REPLACING ALL value BY value Choice 2

EXAMINE field REPLACING ALL value BY value Choice 3 TRANSFORM field CHARACTERS FROM 'value' TO 'value' Choice 4 INSPECT field REMOVING CHARACTERS 'value' BY 'value' Choice 5 EXAMINE field REPLACING FIRST 'value' WITH 'value' SELECT INPUT-MASTER-FILE ASSIGN TO IMASTER ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS IMF-BILLING-TELENO FILE STATUS IS IMASTER-FILE-STATUS. ... PROCEDURE DIVISION. 0010-OPEN-FILES. OPEN INPUT INPUT-MASTER-FILE. 0020-START-FILES. MOVE '0000000001' TO IMF-BILLING-TELENO. START INPUT-MASTER-FILE. IF IMASTER-FILE-STATUS1 NOT = ZERO PERFORM 999-ABEND-ROUTINE GOBACK. 0030-READ-FILES. READ INPUT-MASTER-FILE. IF IMASTER-FILE-STATUS1 = ZERO PERFORM 100-UPDATE-RECORD ELSE IF IMASTER-FILE-STATUS = '23' PERFORM 200-NOT-FOUND ELSE PERFORM 999-ABEND-ROUTINE GOBACK. Which one of the following describes why the START statement in paragraph 0020-START-FILES in the scenario above is necessary? Choice 1 In order to initiate a browse operation on a VSAM file Choice 2 In order to prevent browsing by other programs Choice 3 In order to ensure that the file is available for further processing Choice 4 In order to lock access to the file preventing I-O activity by other tasks Choice 5 In order to unlock access to the control interval containing the data 38. PROCEDURE DIVISION. 0000-INITIALIZE. MOVE FIELDA TO FIELDB. INSPECT FIELDA REPLACING LEADING ZEROS BY SPACES. INITIALIZE FIELDC. ... 0010-ENTRY-POINT. ENTRY 'PEIPP024' USING DFHEIBLK. Which one of the following statements summarizes what facility the ENTRY statement in the sample code above provides? Choice 1 The ENTRY statement establishes the entry point into a COBOL called program. Choice 2 The ENTRY statement is not a valid COBOL statement.

Choice 3 The ENTRY statement provides an alternate entry point into a COBOL called program or subprogram. Choice 4 The ENTRY statement establishes an alternate entry point into a COBOL called program. Choice 5 The ENTRY statement establishes an alternate entry point into a COBOL called subprogram. CALL 'PROGRAMA' USING FIELDA, FIELDB, FIELDC. Referring to the sample code above, the CALLED program must have a PROCEDURE DIVISION header as shown in which one of the following? Choice 1 PROCEDURE DIVISION RECEIVING FIELDA, FIELDB, FIELDC. Choice 2 PROCEDURE DIVISION USING FIELDA, FIELDB, FIELDC. Choice 3 PROCEDURE DIVISION USAGE IS FIELDA, FIELDB, FIELDC. Choice 4 PROCEDURE DIVISION USING FIELDC, FIELDB, FIELDA. Choice 5 PROCEDURE DIVISION INCOMING FIELDA, FIELDB, FIELDC. 0100 IF EMPLOYEE-CLASS = '01' 0200 IF EMPLOYEE-TYPE = 'SE' 0300 NEXT SENTENCE 0400 ELSE 0500 PERFORM ORDINARY-EMPLOYEE 0600 END-IF 0700 IF EMPLOYEE-TYPE = 'ES' 0800 PERFORM EXTRAORDINARY-EMPLOYEE 0900 END-IF 1000 END-IF. 1100 PERFORM NEXT-TASK. Referring to the sample code above, if employee-class ='01' and employee-type ='SE', which one of the following statements is executed? Choice 1 0400 Choice 2 0600 Choice 3 0700 Choice 4 0800 Choice 5 1100 COBOL II, Question 1 of 40 INITIALIZE has NO effect on which one of the following types of fields? Choice 1 PIC 9(..) Choice 2 PIC S9(..) COMP-3 Choice 3 PIC S9(..) Choice 4 FILLER or index items Choice 5 PIC ZZ,ZZ9.99 Which one of the following contains the four DIVISIONS used in COBOL?

Choice 1 Identification Data Linkage Procedure Choice 2 Identification Environment Data Procedure Choice 3 Identification Environment Working-Storage Procedure Choice 4 Identification Input-Output Data Procedural Choice 5 Identification Configuration Working Storage Procedure 0100 0200 0300 0400 0500 0600 0700 0800 0900 1000 1100 In

IF EMPLOYEE-CLASS = '01' IF EMPLOYEE-TYPE = 'SE' IF EMPLOYEE-AGE > 50 PERFORM PERFORM BONUS-APPLICATION END-IF ELSE PERFORM SPECIAL-EMPLOYEE END-IF PERFORM SPECIAL-CLASS END-IF. PERFORM NEXT-TASK. the sample code above, if

employee-class = '01' and employee-type = 'SE' and employee-age = 50; which one of the following statements is executed? Choice 1 0400 Choice 2 0600 Choice 3 0700 Choice 4 0900 Choice 5 1200 Sample Code DATA DIVISION. WORKING-STORAGE SECTION. 01 FILLER. 05 DATA-ITEM PIC X(10) VALUE '0011237695'. 05 RECEIVING-FIELD PIC X(4). ... PROCEDURE DIVISION. ... MOVE DATA-ITEM (7:3) TO RECEIVING-FIELD. ... Assuming 'b' is space, which one of the following values does RECEIVING-FIELD contain following execution of the MOVE statement in the sample code above? Choice 1 695b

Choice b695 Choice 769b Choice b769 Choice 7695

2 3 4 5

Sample Code 01 FIELD1 PIC 9(5) VALUE -123. 01 FIELD2 PIC S99 VALUE -12. 01 FIELD3 PIC S99 VALUE 99. Which one of the following is the reason the sample code above is INCORRECT? Choice 1 The VALUE clause for FIELD2 is not matched with the PICTURE clause. Choice 2 The VALUE clause and the PICTURE clause must match usage. Choice 3 The VALUE clause for FIELD1 is signed and the PICTURE clause is unsigned. Choice 4 The VALUE clause for FIELD3 is unsigned and the PICTURE clause is signed. Choice 5 The VALUE clause for FIELD2 is signed and the PICTURE clause is signed. COBOL II, Question 11 of 40 Sample Code DATA DIVISION. WORKING-STORAGE SECTION. 01 AFIELD PIC S9(3) COMP-3 VALUE +996. 01 BFIELD PIC S9(3) COMP-3 VALUE +117. PROCEDURE DIVISION. ADD AFIELD TO BFIELD. DISPLAY BFIELD. Which one of the following values is displayed as a result of the DISPLAY statement in the sample code above? Choice 1 +013 Choice 2 +113 Choice 3 +114 Choice 4 +1013 Choice 5 +1113 Sample Code 0100 IDENTIFICATION DIVISION. 0200 PROGRAM-NAME. AM82P115. Which one of the following is INCORRECT in the sample code above? Choice 1 The first two statements should not end with a period. Choice 2 Line 0200 should be Program-ID. AM820115. Choice 3 NAME should not be capitalized. Choice 4 Line 0200 should be Program-Identification. AM820115. Choice 5

There should not be a hyphen between PROGRAM and NAME.

In which one of the following areas are the parameters defined that are passed from the calling program? Choice 1 WORKING-STORAGE SECTION Choice 2 REPORT SECTION Choice 3 LINKAGE SECTION Choice 4 INPUT-OUTPUT SECTION Choice 5 PROCEDURE DIVISION USING Sample Code 0080 IF PROCESS-FILE-TRUE 0090 READ INPUT-FILE AT END 0100 IF INPUT-COUNTER = ZERO 0110 PERFORM EMPTY-FILE 0120 ELSE 0130 PERFORM NON-EMPTY-FILE 0140 END-IF 0150 END-READ 0160 ELSE 0170 PERFORM SKIP-PROCESSING 0180 END-IF. In the sample code above, the END-IF on line 0180 terminates the statement on which one of the following lines? Choice 1 0080 Choice 2 0100 Choice 3 0160 Choice 4 0170 Choice 5 0180

FD OUTPUT-CALL-DETAIL-FILE RECORD CONTAINS 13 CHARACTERS. 01 O-BILL-TO-RECORD. 05 O-BTN PIC X(13). SD

SORT-FILE RECORD CONTAINS 13 CHARACTERS. 01 SORT-BILL-TO-RECORD. 05 SORT-BTN. 10 SORT-TN. 15 SORT-NPA PIC 9(3). 15 SORT-NNX PIC 9(3). 15 SORT-LINE PIC 9(4). 10 SORT-CUSTCODE PIC X(3). SORT SORT-FILE ON ASCENDING KEY ???????? WITH DUPLICATES IN ORDER USING INPUT-CALL-DETAIL-FILE GIVING OUTPUT-CALL-DETAIL-FILE. Referring to the sample code above, which one of the following fields do you specify in the ASCENDING KEY clause in order to sort the input file by the first ten (10) characters present on the input record? Choice 1 SORT-NNX Choice 2 SORT-TN Choice 3 SORT-BILL-TO-RECORD Choice 4 SORT-NPA Choice 5 SORT-BTN WORKING-STORAGE SECTION. 01 ZZ-TOP PIC S9 COMP-3 VALUE +9. PROCEDURE DIVISION. ... ADD +1 TO ZZ-TOP.

Field Definitions W-TOTAL-AMT = total amount from all records W-NUM-RECS = total number of records W-AVG-AMT = average amount per record Using the field definitions above, which one of the following correctly computes the average amount per record? Choice 1 DIVIDE W-TOTAL-AMT BY W-NUM-RECS GIVING W-AVG-AMT. Choice 2 W-TOTAL-AMT / W-NUM-RECS = W-AVG-AMT. Choice 3 DIVIDE W-TOTAL-AMT INTO W-NUM-RECS GIVING W-AVG-AMT. Choice 4 DIVIDE W-AVG-AMT INTO W-TOTAL-AMT. Choice 5 W-TOTAL-AMT DIVIDED BY W-NUM-RECS EQUALS W-AVG-AMT. FILE SECTION. FD INPUT-CALL-DETAIL-FILE RECORD CONTAINS 13 CHARACTERS. 01 I-BILL-TO-RECORD. 05 I-BTN PIC X(13).

... Which one of the following is the value of ZZ-TOP after execution of the ADD instruction shown in the sample code above? Choice 1 +4 Choice 2 +5 Choice 3 +10 Choice 4 Unpredictable Choice 5 Zero Which one of the following statements describes the function of the debugging option WHEN? Choice 1 It allows you to check for a specific condition while debugging. [not sure] Choice 2 It is an efficient tool to use during initial compiler debugging phases. Choice 3 It provides the ability to select whether compilation is aborted while debugging. Choice 4

It checks for specific conditions after each paragraph is executed during a debugging session. Choice 5 It structures compiler output for debugging in a specific order under certain conditions. 0100 INITIAL-READ. 0110 READ MASTER-FILE 0120 AT END MOVE 'Y' TO MASTER-EOF-SW. 0130 PERFORM PROCESS-FILE 0140 UNTIL END-OF-TRANSACTIONS. 0150 GOBACK. 0160 PROCESS-FILE. 0170 READ TRANSACTION-FILE 0180 AT END MOVE 'Y' TO TRANSACTION-EOF-SW 0190 NOT AT END PERFORM PROCESS-A-RECORD. 0200 PROCESS-A-RECORD. 0210 IF TRANSACTION-KEY < PREVIOUS-KEY 0220 DISPLAY '??????' 0230 ELSE 0240 MOVE TRANSACTION-KEY TO PREVIOUS-KEY 0250 PERFORM UNTIL MASTER-KEY >= TRANSACTION-KEY 0260 READ MASTER-FILE 0270 AT END MOVE 'Y' TO MASTER-EOF-SW 0280 END-READ 0290 END-PERFORM 0300 IF MASTER-KEY = TRANSACTION-KEY 0310 MOVE TRANSACTION-RECORD TO MASTERRECORD 0320 REWRITE MASTER-RECORD 0330 ELSE 0340 DISPLAY '??????' 0350 END-IF 0360 END-IF. The scenario above presents a simple mastertransaction update program segment. Assume both files have been sorted into ascending sequence by the respective key fields. Referring to statement #0340, which one of the following errors has been detected? Choice 1 The master file is out of sequence. Choice 2 There is no corresponding master record for the transaction record being processed. Choice 3 A logic error has occurred. Choice 4 There is no corresponding transaction record for the master being processed. Choice 5 The transaction file is out of sequence. DATA DIVISION. WORKING-STORAGE SECTION. 01 DATA-ARRAY. 05 DATA-FIELD OCCURS 10 TIMES PIC S9(3) COMP-3. PROCEDURE DIVISION. MOVE ZEROS TO DATA-ARRAY. ADD +1 TO DATA-FIELD (9). When executed, the sample code above results in which one of the following, exception codes? Choice 1 Data exception [not sure] Choice 2 Protection exception Choice 3 Boundary Violation Exception Choice 4

Decimal divide exception Choice 5 Operation exception Which one of the following statements causes a header line to be written at the top of a new page of a report? Choice 1 WRITE RPT-RCD FROM RPT-HEADER BEFORE ADVANCING PAGE Choice 2 WRITE RPT-RCD FROM RPT-HEADER AFTER ADVANCING PAGE Choice 3 ADVANCE RPT-FILE PAGE WRITE RPT-HEADER Choice 4 WRITE RPT-RCD AFTER ADVANCING FROM RPT-HEADER Choice 5 WRITE RPT-RCD FROM RPT-HEADER Which one of the following is INCORRECT? Choice 1 01 FIELD1 PIC 9(5) VALUE ZEROS. Choice 2 01 FIELD1 PIC 9(5) VALUE 123. Choice 3 01 FIELD1 PIC S9(5)V9 VALUE 12345.6. Choice 4 01 FIELD1 PIC S9(3)V99 VALUE +123.45. Choice 5 01 FIELD1 PIC 9(5) VALUE -123. DATA DIVISION. WORKING-STORAGE SECTION. 01 AFIELD PIC S9(3) COMP-3 VALUE +021. 01 BFIELD PIC S9(3) COMP-3 VALUE +005. PROCEDURE DIVISION. MULTIPLY AFIELD BY BFIELD. DISPLAY BFIELD. Which one of the following values is displayed by the DISPLAY statement in the sample code above? Choice 1 +005 Choice 2 +021 Choice 3 +105 Choice 4 +232 Choice 5 +323 Which one of the following is the implicit scope terminator that ends the scope of any statement NOT explicitly terminated? Choice 1 END-EVALUATE Choice 2 END-IF Choice 3 END-READ Choice 4 END-PERFORM Choice 5 Period 0100 IDENTIFICATION DIVISION. 0200 PROGRAM-ID. AM822P115. Which one of the following is INCORRECT in the sample code above? Choice 1

There should not Choice 2 Line 0200 is not Choice 3 Line 0200 should Choice 4 ID should not be Choice 5 The program name

be a hyphen between PROGRAM and ID. a valid statement. be Program Identification. AM8220115. capitalized. is too long.

Which one of the following statements describes the functions provided by the compile option FLAG(x,y)? Choice 1 It places messages directly into the compiler listing. Choice 2 This option informs the compiler to only list error messages with a specified warning level. Choice 3 It provides a way to fix compiler errors that are flagged. Choice 4 It organizes the procedure division into sections that are easily readable. Choice 5 It flags errors that occur in the data division. IF W-AMT1 EQUALS W-AMT2 ELSE MOVE 100 TO A-COUNT1 END-IF Which one of the following errors occurs in the sample code above? Choice 1 EQUALS should be replaced with IS EQUAL TO. Choice 2 0 cannot be moved to a counter. Choice 3 ELSE should be replaced with ELSEIF. Choice 4 END-IF should be replaced with ENDIF. Choice 5 THEN should follow the IF statement. Which one of the following COPY statements is correct? Choice 1 COPY COPYFILE REPLACE ==PRE-== ==WK-== Choice 2 COPY COPYFILE REPLACING =PRE-= =WK-= Choice 3 COPY REPLACING ==PRE-== ==WK-== COPYFILE Choice 4 COPY COPYFILE SUPPRESS Choice 5 COPY SUPPRESS COPYFILE Which one of the following addressing modes does the parameter AMODE(ANY) specify? Choice 1 16, 24 or 31-bit addressing modes Choice 2 24 or 31-bit addressing modes Choice 3 Any mode up to 64-bit addressing mode Choice 4 24-bit addressing mode Choice 5 16-bit addressing mode 01

WORK-AREA. 05 WORK-FIELDA

PIC ZZ9.

05 05 05 05

WORK-FIELDB WORK-FIELDC WORK-FIELDD WORK-FIELDE

PIC PIC PIC PIC

XXX. XXBXXX. $$$Z9.99. 999.

... INITIALIZE WORK-AREA REPLACING ALPHANUMERIC-EDITED BY ZEROS. Which one of the following fields, if any, will be INITIALIZEd by the statement in the sample code above? Choice 1 WORK-FIELDD Choice 2 WORK-FIELDE Choice 3 WORK-FIELDB Choice 4 WORK-FIELDA Choice 5 WORK-FIELDC[not sure] WORKING-STORAGE SECTION. 01 AFIELD PIC S9(3) COMP-3 VALUE +981. 01 BFIELD PIC S9(3) COMP-3 VALUE +017. PROCEDURE DIVISION. ADD AFIELD TO BFIELD. MULTIPLY AFIELD BY BFIELD GIVING BFIELD. DISPLAY BFIELD. Which one of the following values is displayed by the DISPLAY statement in the sample code above? Choice 1 +8 Choice 2 +38 Choice 3 +79038 Choice 4 +79938 Choice 5 +979038 FD O-REPORT-FILE. 01 O-REPORT-REC. 05 O-REPORT-HDR 05 05 O-REPORT-DATE. 10 O-REPORT-MM 10 O-REPORT-YY 05 O-REPORT-TIME

PIC X(40). PIC X(02) VALUE SPACES. PIC X(03). PIC X(02). PIC X(08).

01 WORK-AREAS. 05 W-DATE PIC X(08) VALUE '08/17/06'. 05 W-TIME PIC X(08) VALUE '03:10:44'. Program Sample: 1) MOVE 'WORK HISTORY REPORT FOR: ' TO O-REPORT-HDR 2) MOVE W-DATE (1:3) TO O-REPORT-MM 3) MOVE W-DATE (4:2) TO O-REPORT-YY 4) MOVE W-TIME (1:5) TO O-REPORT-TIME When a page break occurs, a new heading is printed which includes the date and time as specified below. Which lines of code above prevent this from being produced correctly? Date 08/06 or MM/YY Time 03:10:44 or HH:MM:SS

Choice 1

Line 1 Choice 2 Line 2 Choice 3 Lines 2 and 3 Choice 4 Lines 3 and 4 Choice 5 Line 4 01 FROM-AREA. 05 FIELDA PIC X(10) VALUE 'ABCDEFGHIJ'. 05 PTR USAGE IS POINTER. 05 ARRAY OCCURS 3 TIMES PIC X(10) VALUE SPACES. 05 AREA-INDEX USAGE IS INDEX. 01 TO-AREA. 05 FIELDA PIC X(10). 05 PTR USAGE IS POINTER. 05 ARRAY OCCURS 3 TIMES PIC X(10). 05 AREA-INDEX USAGE IS INDEX. s ... MOVE CORRESPONDING FROM-AREA TO TO-AREA. Which one of the following is moved as a result of the MOVE CORRESPONDING statement in the sample code above? Choice 1 AREA-INDEX and PTR are the only fields moved. Choice 2 None of the fields are moved. Choice 3 All fields are moved. Choice 4 FIELDA and AREA-INDEX are the only fields moved. Choice 5 FIELDA and ARRAY are the only fields moved. Which one of the following is one of the standard clauses used with the COPY statement? Choice 1 REPLACING Choice 2 ALL Choice 3 UNTIL Choice 4 FROM Choice 5 MEMBER INITIALIZE has NO effect on which one of the following types of fields? Choice 1 PIC ZZ,ZZ9.99 Choice 2 PIC S9(..) COMP-3 Choice 3 PIC S9(..) Choice 4 FILLER or index items Choice 5 PIC 9(..) Sample Code DATA DIVISION. WORKING-STORAGE SECTION. 01 AFIELD PIC S9(3) COMP-3 VALUE +996. 01 BFIELD PIC S9(3) COMP-3 VALUE +117. PROCEDURE DIVISION.

ADD AFIELD TO BFIELD. DISPLAY BFIELD. Which one of the following values is displayed as a result of the DISPLAY statement in the sample code above? Choice 1 +013 Choice 2 +113 Choice 3 +114 Choice 4 +1013 Choice 5 +1113 Scenario Which one of the following statements causes a header line to be written at the top of a new page of a report? Choice 1 WRITE RPT-RCD FROM RPT-HEADER Choice 2 ADVANCE RPT-FILE PAGE WRITE RPT-HEADER Choice 3 WRITE RPT-RCD FROM RPT-HEADER BEFORE ADVANCING PAGE Choice 4 WRITE RPT-RCD AFTER ADVANCING FROM RPT-HEADER Choice 5 WRITE RPT-RCD FROM RPT-HEADER AFTER ADVANCING PAGE Sample Code 05 TAX-AMT PIC 9(02)V99 VALUE 30. 05 INTEREST-AMT PIC 9(02)V99 VALUE 10. 05 TOTAL-AMT PIC 9(03)V99 VALUE 100. Using the Working Storage fields above, what value is in TOTAL-AMT after the following statement? SUBTRACT 10.35 TAX-AMT FROM TOTAL-AMT. Choice 1 -29.8 Choice 2 49.65 Choice 3 89.8 Choice 4 92 Choice 5 149.65

INTEREST-AMT

Layout of library member IRECORD: 01 INPUT-RECORD. 05 INPUT-LAST-NAME PIC X(20). 05 INPUT-FIRST-NAME PIC X(10). 05 INPUT-TELENO PIC X(10). Referring to the sample code above, which one of the following is the correct sequence of instructions that will cause IRECORD to be copied into the program? Choice 1 FD INPUT-FILE. 01 COPY IRECORD. Choice 2 FD INPUT-FILE. COPY I-RECORD. Choice 3 FD INPUT-FILE COPY IRECORD.

Choice 4 FD INPUT-FILE. COPY MEMBER IRECORD. Choice 5 FD INPUT-FILE. COPY IRECORD.

IDENTIFICATION DIVISION. PROGRAM-ID. AM82P001 IS COMMON. .... PROCEDURE DIVISION. ... CALL 'AM82P002'. GOBACK. END PROGRAM AM82P001. IDENTIFICATION DIVISION. PROGRAM-ID. AM82P002. ... PROCEDURE DIVISION. ... CALL 'AM82P003'. EXIT PROGRAM. END PROGRAM AM82P002. IDENTIFICATION DIVISION. PROGRAM-ID. AM82P003 IS COMMON. ... PROCEDURE DIVISION. ... MOVE 'X' TO SERVICE-AND-EQUIPMENT. ... STOP RUN. END PROGRAM AM82P003. Which one of the following states why the COMMON clause in the sample code above is coded incorrectly? Choice 1 COMMON may only be coded in a contained program. Choice 2 EXIT PROGRAM nor STOP RUN may be used in a nested program unless the COMMON clause is coded. Choice 3 The COMMON clause can only be coded on the PROGRAM-ID of a program to increase the scope of programs that it can call. Choice 4 When COMMON is coded on a PROGRAM-ID clause of a contained program, the contained program may only be called by a program in which it is directly contained. Choice 5 COMMON may not be coded within the same program in which the COMMON program is contained. WORKING-STORAGE SECTION. 01 FIELDA PIC S9(2)V9(1) COMP-3 VALUE +11.0. 01 FIELDB PIC S9(2)V9(1) COMP-3 VALUE +12.0. 01 FINAL-RESULT PIC S9(2)V9(2) COMP-3 VALUE +50.0. PROCEDURE DIVISION. MULTIPLY FIELDA BY FIELDB GIVING FINAL-RESULT ON SIZE ERROR

DISPLAY FINAL-RESULT. Upon execution of the sample code above, the field FINAL-RESULT contains which one of the following values when displayed? Choice 1 0 Choice 2 13V20 Choice 3 32V00 Choice 4 50V00 Choice 5 132V00 IF A NOT < B IF C NOT = D IF E NOT > F PERFORM FOUND-THIS. Which one of the following is the code segment in the scenario above equivalent to? Choice 1 EVALUATE TRUE WHEN A GREATER THAN B ALSO C D ALSO E B ALSO C D ALSO E = B ALSO C D ALSO E 6 ADD CORRESPONDING DATA-ITEM-2 TO DATA-ITEM-1 (X) END-PERFORM. Referring to the sample code above, which one of the following sets of fields in DATA-ITEM-2 are added to the fields in DATA-ITEM-1? Choice 1 ITEM-A ITEM-B ITEM-E Choice 2 ITEM-A ITEM-B Choice 3 ITEM-A ITEM-B ITEM-D Choice 4 ITEM-A ITEM-E Choice 5 ITEM-A ITEM-B ITEM-D ITEM-E

A worker's total pay is calculated as the sum of the following: a) wage-rate multiplied by 40 hours b) (wage-rate multiplied by 1.5) multiplied by (hours-worked - 40) where item 'b' above is only calculated when hoursworked exceeds 40. Assume a minimum of 40 hours are worked. You are given W-RATE and W-HRS-WORKED. Overtime Hours can be calculated as hours worked in excess of 40 hours. Which one of the following statements correctly calculates Total Wages using the formula shown above? Choice 1 COMPUTE W-TOTAL-WAGES = W-RATE * (40 + 1.5) 40) Choice 2 COMPUTE W-TOTAL-WAGES = W-RATE X 40 + 1.5 X 40) Choice 3 COMPUTE W-TOTAL-WAGES = W-RATE * 40 + 1.5 * Choice 4 COMPUTE W-TOTAL-WAGES = W-RATE * 40 + 1.5 * 40) Choice 5 COMPUTE W-TOTAL-WAGES = W-RATE * 40 + (1.5 *

* W-RATE * (W-HRS-WORKED -

W-RATE X (W-HRS-WORKED -

W-RATE * W-HRS-WORKED W-RATE * (W-HRS-WORKED -

W-RATE * W-HRS-WORKED)

Sample Code 0080 IF PROCESS-FILE-TRUE 0090 READ INPUT-FILE AT END 0100 IF INPUT-COUNTER = ZERO 0110 PERFORM EMPTY-FILE 0120 ELSE 0130 PERFORM NON-EMPTY-FILE 0140 END-IF 0150 END-READ 0160 ELSE 0170 PERFORM SKIP-PROCESSING 0180 END-IF. In the sample code above, the END-IF on line 0180 terminates the statement on which one of the

In calling program: 01 WK-DAYS PIC S9(9) BINARY. 01 WK-YYYYMMDD. 02 WK-YYYY PIC X(4). 02 WK-MM PIC X(2). 02 WK-DD PIC X(2). In called program GETDAYS: LINKAGE SECTION. 01 LK-YYYYMMDD. 05 LK-YYYY PIC X(04). 05 LK-MM PIC X(02). 05 LK-DD PIC X(02). 01 LK-DAYS PIC S9(9) BINARY. PROCEDURE DIVISION USING LK-YYYYMMDD LK-DAYS. Assuming the sample code above is part of the program GETDAYS, which one of the following is a

following lines? Choice 1 0080 Choice 2 0100 Choice 3 0160 Choice 4 0170 Choice 5 0180

valid CALL to GETDAYS? Choice 1 CALL 'GETDAYS' USING WK-YYYY WK-MM WK-DD WK-DAYS Choice 2 CALL 'GETDAYS' USING WK-YYYYMMDD WK-DAYS Choice 3 CALL 'GETDAYS' USING WK-DAYS WK-YYYYMMDD Choice 4 CALL 'GETDAYS' USING WK-YYYY WK-MM WK-DD Choice 5 CALL 'GETDAYS' USING WK-YYYYMMDD WK-YYYY WK-MM WK-DD WK-DAYS COMPUTE TOTAL = FUNCTION SUM (ARRAY(1, ALL, ALL))

Formula

Assuming that ARRAY is a 2x2x2 table, the statement in the sample code above causes which one of the following sets of dimensions, if any, to be summed? Choice 1 ARRAY (1, 1, 1) ARRAY (1, 1, 2) ARRAY (1, 2, 1) ARRAY (1, 2, 2) Choice 2 ARRAY (1, 2, 1) ARRAY (1, 2, 2) ARRAY (1, 2, 1) ARRAY (1, 2, 2) Choice 3 ARRAY (1, 1, 1) ARRAY (1, 1, 2) ARRAY (2, 2, 1) ARRAY (2, 2, 2) Choice 4 ALL is not a valid subscript or index. Choice 5 ARRAY (2, 1, 1) ARRAY (2, 1, 2) ARRAY (2, 2, 1) ARRAY (2, 2, 2) A batch program has been written to post transactions to a Master File. Unfortunately, the programmer who wrote the module did not request the file status clause in the SELECT statement. The module abends at a mission-critical point in time, with a VSAM error producing a standard dump. Referring to the scenario above, at which one of the following locations is the file status information located within the FCB printed in the storage dump? Choice 1 At hexadecimal displacement 'A3' Choice 2 At hexadecimal displacement 'A4' Choice 3 At hexadecimal displacement 'B3' Choice 4 At hexadecimal displacement 'B9' Choice 5 At hexadecimal displacement 'C4'

0100 EVALUATE TRUE 0110 WHEN CALIFORNIA 0120 IF TAX-REBATE 0130 PERFORM HANDLE-TAX-REBATE THRU PRINTCHECK 0140 ELSE 0150 MOVE +5 TO TAX-COUNTER 0160 PERFORM UNTIL TAX-COUNTER = ZERO 0170 SUBTRACT +1 FROM TAX-COUNTER 0180 END-PERFORM 0190 END-IF 0200 WHEN NEW-YORK 0210 IF TAX-REBATE 0220 NEXT SENTENCE 0230 ELSE

0240 PERFORM CALC-TAX-DUE 0250 END-IF 0260 WHEN OTHER 0270 CONTINUE 0280 END-EVALUATE. 0290 PERFORM UPDATE-RECORD. Referring to the sample code above, assume NEW-YORK and TAX-REBATE are true. Upon execution of statement 0220, which one of the following statements is executed? Choice 1 0250 Choice 2 0260 Choice 3 0270 Choice 4 0280 Choice 5 0290 0100 INITIAL-READ. 0110 READ MASTER-FILE 0120 AT END MOVE 'Y' TO MASTER-EOF-SW. 0130 READ TRANSACTION-FILE 0140 AT END MOVE 'Y' TO TRANSACTION-EOF-SW. 0150 PERFORM PROCESS-FILE 0160 UNTIL END-OF-MASTER OR 0170 END-OF-TRANSACTIONS. 0180 ?????? 0190 GOBACK. 0200 PROCESS-FILE. 0210 PERFORM UNTIL MASTER-KEY >= TRANSACTION-KEY 0220 WRITE MASTER-RECORD 0230 READ MASTER-RECORD AT END MOVE 'Y' TO MASTER-EOF-SW 0240 END-PERFORM. 0250 IF NOT MASTER-EOF 0260 EVALUATE TRUE 0270 WHEN TRANSACTION-IS-DELETE 0280 PERFORM DELETE-MASTER 0290 WHEN TRANSACTION-IS-ADD 0300 PERFORM ADD-MASTER 0310 WHEN TRANSACTION-IS-UPDATE 0320 PERFORM UPDATE-MASTER 0330 END-EVALUATE. 0340 DELETE-MASTER. 0350 ... 0360 ADD-MASTER. 0370 ... 0380 UPDATE-MASTER. 0390 ... This is a tape-based master-transaction program segment. There are a number of complications that can arise in processing a transaction file against a master file. Referring to statement #0180, what code, if any, has been omitted? Choice 1 Code to resequence the transaction file Choice 2 Code to resequence the master file Choice 3 Code to process either file which has records remaining after the other has encountered

end-of-file Choice 4 Code to process the remaining transaction records when the master file ends first Choice 5 Code to process the remaining master records when the transaction file ends first 05 FIELDA PIC X(23) VALUE 'JOHNSON, WILLIAM, HENRY'. 05 COUNTER PIC S9(3) COMP-3. ... INSPECT FIELDA TALLYING COUNTER FOR CHARACTERS BEFORE INITIAL ','. Which one of the following is the value of COUNTER following execution of the INSPECT statement in the sample code above? Choice 1 5 Choice 2 6 Choice 3 7 Choice 4 8 Choice 5 9

giving due consideration to the number of entries to be searched? Choice 1 A partitioned search Choice 2 A binary search Choice 3 A serial search Choice 4 Sequential IF statements checking for each possible value Choice 5 A serialized binary search SELECT INPUT-MASTER-FILE ASSIGN TO IMASTER ORGANIZATION IS INDEXED ACCESS MODE IS RANDOM RECORD KEY IS IMF-BILLING-TELENO FILE STATUS IS IMASTER-FILE-STATUS. ... FD INPUT-MASTER-FILE 01 INPUT-MASTER-RECORD. 05 IMF-BILLING-TELENO PIC X(10). 05 IMF-PAID-SW PIC X. ... PROCEDURE DIVISION. OPEN INPUT INPUT-MASTER-FILE. MOVE '9999999999' TO IMF-BILLING-TELENO.

DATA DIVISION. WORKING-STORAGE SECTION. 01 FLOATING-INSERTION-EDITS. 05 FIELDA PIC S9(5) COMP-3 VALUE +12345. 05 FIELDB PIC $,$$$,$$$.99. 05 FIELDC PIC +,+++,+++.++. 05 FIELDD PIC $ZZZ,ZZZ.99. PROCEDURE DIVISION. MOVE FIELDA TO FIELDB FIELDC FIELDD. Which one of the following represents the final values of FIELDB, FIELDC, and FIELDD after execution of the sample code above? NOTE: 'b' represents blank Choice 1 FIELDB = bb$12,345.00 FIELDC = bb+12,345.00 FIELDD = b$b12,345.00 Choice 2 FIELDB = b$b12,345.00 FIELDC = b+b12,345.00 FIELDD = $bb12,345.00 Choice 3 FIELDB = $b12,345.00 FIELDC = +b12,345.00 FIELDD = $b12,345.00 Choice 4 FIELDB = $$12,345.00 FIELDC = bb+12,345.00 FIELDD = $bb12,345.00 Choice 5 FIELDB = $,$12,345.00 FIELDC = b,+12,345.00 FIELDD = $b,b12,345.00 01 NPA-ARRAY. 05 NPA OCCURS 25 TIMES PIC 999. Referring to the sample code above, which one of the following search methods performs fastest,

READ INPUT-MASTER-FILE INVALID KEY PERFORM 999-ABEND-ROUTINE NOT INVALID KEY MOVE 'Y' TO IMF-PAID-SW. REWRITE INPUT-MASTER-RECORD INVALID KEY PERFORM 999-ABEND-ROUTINE. ASSUME: - All working storage fields required have been defined - All performed paragraphs exist - The open is successful Which one of the following statements correctly describes what, if anything, is WRONG in the above segment of code? Choice 1 The file was not opened I-O. Choice 2 The file was not opened for output. Choice 3 The read statement did not specify the KEY phrase. Choice 4 The rewrite statement should rewrite INPUT-MASTERFILE. Choice 5 The file was not opened EXTEND. 05 IN-NAME PIC X(3) VALUE 'TOM'. .... DISPLAY FUNCTION LOWER-CASE(IN-NAME (2: )). Which one of the following sets lists the (a) content of FIELDA and (b) value displayed, following execution of the sample code above? Choice 1 (a) oM (b) oM Choice 2

(a) om (b) om Choice 3 (a) TOM (b) oM Choice 4 (a) TOM (b) Tom Choice 5 (a) Tom (b) om 01 DATA-FIELD 01 TALLY-FIELD

END-PERFORM Choice 5 PERIOD

PIC 9(8) VALUE 99888381. PIC 9(3) VALUE 1

INSPECT DATA-FIELD TALLYING TALLY-FIELD FOR CHARACTERS AFTER INITIAL 8 Which one of the following is the value of TALLYFIELD following execution of the INSPECT statement in the sample code above? Choice 1 3 Choice 2 4 Choice 3 5 Choice 4 6 Choice 5 7 01 X PIC 9. 01 DATA-FIELDS. 05 FLDA PIC X(11) VALUE 'SNOOKIEPOOH'. 05 FLDB PIC X(11) VALUE 'SNOOKIEbbbb'. 05 FLDC PIC X(11) VALUE 'WOOKIEbbbbb'. 05 FLDD PIC X(11) VALUE 'WICKIEWOCKb' ... COMPUTE X = ORD-MIN(FLDA FLDB FLDC FLDD). Which one of the following values is contained in X following execution of the COMPUTE statement in the sample code above? Choice 1 0 Choice 2 1 Choice 3 2 Choice 4 3 Choice 5 4 IF RECORD-FOUND SEARCH ALL RECORD-TYPE-TABLE WHEN TBL-TYPE=RECORD-TYPE PERFORM 5000-UPDATE-RECORD With respect to the sample code above, which one of the following is NOT an acceptable scope terminator for the SEARCH or SEARCH ALL command? Choice 1 END-SEARCH Choice 2 END-IF Choice 3 ELSE Choice 4

DATA DIVISION. WORKING-STORAGE SECTION. 01 COMPLETE-NAME PIC X(30) VALUE SPACES. 01 LAST-NAME PIC X(15) VALUE SPACES. 01 LNM-POINTER PIC S999 COMP-3 VALUE ZERO. PROCEDURE DIVISION. ACCEPT COMPLETE-NAME FROM COMMAND-LINE. MOVE COMPLETE-NAME (LNM-POINTER: ) TO LAST-NAME. ... When using reference modification with a MOVE statement, a pointer to the starting position for the move is required and the length value is optional. In order to make the MOVE statement in the scenario above work, what else do you need to do? Choice 1 COMPLETE-NAME should be defined with an OCCURS clause. Choice 2 An index must be set to point to LAST-NAME. Choice 3 Set LNM-POINTER to point to the first character of the last name. Choice 4 Nothing. Choice 5 The ADDRESS OF the field LAST-NAME must be specified. Main routine.... CALL subroutine USING BY CONTENT 'OHIO'. Subroutine.... LINKAGE SECTION. 01 PASSED-FIELD PIC X(5). PROCEDURE DIVISION USING PASSED-FIELD. IF PASSED-FIELD = 'OHIO' ..... Passing a literal BY CONTENT that is shorter in the calling program than its definition in the called program is risky. Which one of the following occurs as a result of the compare shown above? Choice 1 Protection exception Choice 2 Data exception [not sure] Choice 3 Decimal divide exception Choice 4 Operation exception Choice 5 Unpredictable results

Which one of the following statements describes the function performed by the compiler option SSRANGE? Choice 1 SSRANGE checks references to working storage fields for field type and values being placed in those fields. Choice 2 SSRANGE adds code to the object to verify subscripts, indexes, and OCCURS clauses. Choice 3

SSRANGE adds code to the object module that will prevent range errors from occurring during runtime execution of the module. Choice 4 SSRANGE checks that each subscript of a multisubscripted table element is valid. Choice 5 SSRANGE instructs the compiler to ensure that valid values are used in a reference modification statement. Which one of the following is a correct SEARCH statement that uses the COST-TABLE in the sample code above? Choice 1 SEARCH ALL COST-TABLE WHEN ITEM-CD(COST-TABLE-INDEX) = WK-ITEM-CD MOVE ITEM-COST(COST-TABLE-INDEX) TO WK-COST END-SEARCH. Choice 2 SEARCH ALL COST-GROUP WHEN ITEM-CD(COST-TABLE-INDEX) = WK-ITEM-CD MOVE ITEM-COST(COST-TABLE-INDEX) TO WK-COST END-SEARCH. Choice 3 SEARCH ALL ITEM-CD WHEN ITEM-CD(COST-TABLE-INDEX) = WK-ITEM-CD MOVE ITEM-COST(COST-TABLE-INDEX) TO WK-COST END-SEARCH. Choice 4 SEARCH ALL ITEM-COST WHEN ITEM-CD(COST-TABLE-INDEX) = WK-ITEM-CD MOVE ITEM-COST(COST-TABLE-INDEX) TO WK-COST END-SEARCH. Choice 5 SEARCH ALL COST-TABLE-INDEX WHEN ITEM-CD(COST-TABLE-INDEX) = WK-ITEM-CD MOVE ITEM-COST(COST-TABLE-INDEX) TO WK-COST END-SEARCH. Which one of the following coding schemes does the mainframe use to represent the characters that can be stored in a byte? Choice 1 ASCII Choice 2 Binary Choice 3 EBCDIC Choice 4 Hollerith Choice 5 ISO 646

CEE3207S THE SYSTEM DETECTED A DATA EXCEPTION (SYSTEM COMPLETION CODE=0C7) AT 001B2D03 (DISPLACEMENT 001208 IN LOAD MODULE FRG0253)

The above message appears in the SYSOUT for your job. Where do you look to find the line of code in which the error occurred? Choice 1 Search for '1B2D03' in the SYSOUT for the job. Choice 2 Look for line 1208 in the source file for FRG0253. Choice 3 Look for displacement 001208 in the DUMP section in the SYSOUT for the job. Choice 4 Search for '1208' in the load module for FRG0253. Choice 5 Look in the cross reference from FRG0253 for displacement 001208. Field in working storage: 05 S-PLAYER-FILE-CHECK 88 S-PLAYER-FILE-NOT-EOF 88 S-PLAYER-FILE-EOF 05 S-TEAM-FILE-CHECK 88 S-TEAM-FILE-NOT-EOF 88 S-TEAM-FILE-EOF 05 S-TEAM-TOTALS-CHECK 88 S-TEAM-TOTALS-NOT-DONE 88 S-TEAM-TOTALS-DONE

the compile of PIC X(01). VALUE 'N'. VALUE 'Y'. PIC X(01). VALUE 'N'. VALUE 'Y'. PIC X(01). VALUE 'N'. VALUE 'Y'.

1) MAINLINE. 2) 3) 4)

SET S-PLAYER-FILE-NOT-EOF SET S-TEAM-FILE-NOT-EOF SET S-TEAM-TOTALS-NOT-DONE

TO TRUE TO TRUE TO TRUE

5) 5) 5)

PERFORM S0100-PROCESS-PLAYER-FILE UNTIL S-PLAYER-FILE-EOF END-PERFORM

6) 6) 6)

PERFORM S0200-PROCESS-TEAM-FILE UNTIL S-TEAM-FILE-EOF END-PERFORM

7) 7) 7)

PERFORM S0400-PRINT-TEAM-TOTALS UNTIL S-TEAM-FILE-EOF END-PERFORM . The statement numbers for the perform are for all three lines of the perform. A logic error is occurring in the Working Storage and Mainline section of the sample code above. Which one of the following statements do you modify to correct the problem? Choice 1 Line 2 Choice 2 Line 4 Choice 3 Line 5 Choice 4 Line 6

Choice 5 Line 7 MOVE FIELDA (PTR) TO PTR, FIELDB (PTR). The sample code shown above is equivalent to which one of the following? Choice 1 MOVE FIELDA (PTR) TO TEMP. MOVE TEMP TO PTR. MOVE TEMP TO FIELDB (PTR). Choice 2 MOVE FIELDB (PTR) TO TEMP. MOVE TEMP TO PTR. MOVE TEMP TO FIELDA (PTR). Choice 3 MOVE FIELDA (PTR) TO TEMP. MOVE TEMP TO PTR. MOVE TEMP TO FIELDB (TEMP). Choice 4 MOVE FIELDA (PTR) TO TEMP. MOVE PTR TO TEMP. MOVE TEMP TO FIELDB (PTR). Choice 5 MOVE FIELDA (TEMP) TO PTR. MOVE TEMP TO PTR. MOVE TEMP TO FIELDB (PTR). 100 IF EMPLOYEE-CLASS = '01' 200 IF EMPLOYEE-TYPE = 'SE' 300 PERFORM SPECIAL-EMPLOYEE 400 ELSE 500 NEXT SENTENCE 600 END-IF 700 PERFORM SPECIAL-CLASS 800 END-IF. 900 PERFORM NEXT-TASK. Referring to the sample code above, if employee-class = '01' and employee-type = 'SE', which one of the following statements is executed following execution of paragraph SPECIAL-EMPLOYEE? Choice 1 400 Choice 2 600 Choice 3 700 Choice 4 800 Choice 5 900 Which of the following is a c? Choice 1 columns: 1 2 3 123456789012345678901234567890... * THIS IS A VALID COMMENT Choice 2 columns: 1 2 3 123456789012345678901234567890... /* THIS IS A VALID COMMENT */ Choice 3 columns: 1 2 3

123456789012345678901234567890... - THIS IS A VALID COMMENT Choice 4 columns: 1 2 3 123456789012345678901234567890... === THIS IS A VALID COMMENT === Choice 5 columns: 1 2 3 123456789012345678901234567890... "THIS IS A VALID COMMENT" //STEP001 EXEC PGM=KFG00257 //IOIN DD DSN=CORP.MASTERS(LOCKS),DISP=SHR //IOOUT DD DSN=CORP.NEW.MASTERS(NEWLOCKS),DISP=OLD Which of the following SELECT statements works for the above JCL? Choice 1 SELECT IOIN ASSIGN TO LOCKS. SELECT IOOUT ASSIGN TO NEWLOCKS. Choice 2 SELECT LOCKS ASSIGN TO IOIN. SELECT NEWLOCKS ASSIGN TO IOOUT. Choice 3 SELECT IOIN ASSIGN TO IOIN. SELECT IOOUT ASSIGN TO IOOUT. Choice 4 SELECT LOCKS ASSIGN TO AS-IOIN. SELECT NEWLOCKS ASSIGN TO AS-IOOUT. Choice 5 SELECT IOIN ASSIGN TO AS-LOCKS. SELECT IOOUT ASSIGN TO AS-NEWLOCKS.

CALL 'CALCNPV' USING VALUES-ARRAY NET-P-VALUE. Referring the to the sample code above, which one of the following statements is correct? Choice 1 CALCNPV requires a pre-compiler to translate the USING clauses. Choice 2 CALCNPV is a subroutine that can be written in another language. Choice 3 Paragraphs VALUES-ARRAY and NRT-P-VALUE will be copied from the source file named "CALCNPV". Choice 4 CALCNPV is a PROCEDURE paragraph in the same program. Choice 5 CALCNPV is a COBOL function. Which one of the following is the proper coding for a group item with an elementary item? Choice 1 05 GROUP. 10 INDIVIDUAL PIC X. Choice 2 01 GROUP PIC X. 05 INDIVIDUAL. Choice 3 05 GROUP. 10 INDIVIDUAL. Choice 4 01 GROUP. 01 INDIVIDUAL PIC X. Choice 5 01 GROUP PIC X.

05

INDIVIDUAL

PIC X.

SELECT MASTER-FILE ASSIGN TO MASTER. Which one of the following is the correct way to code the FILE SECTION for MASTER-FILE, which contains 100byte fixed length records with the record key located in the first 10 bytes? Choice 1 FD MASTER-FILE. 01 MASTER-RECORD PIC X(100). 01 MASTER-KEY PIC X(10). Choice 2 FD MASTER-FILE RECORD CONTAINS 100 CHARACTERS. 01 MASTER-RECORD PIC X(100). Choice 3 FD MASTER-FILE. 01 MASTER-RECORD PIC X(100). Choice 4 FD MASTER-FILE RECORD CONTAINS 100 CHARACTERS. 01 FILLER PIC X(100). Choice 5 FD MASTER-FILE. 01 MASTER-RECORD. 05 MASTER-KEY PIC X(10). 05 MASTER-DATA PIC X(90). 01 01 01 01 01

NOT-FILLER PIC X. WORKING-STORAGE PIC X. 01-X PIC X. THIS-IS-A-VERY-LONG-NAME PIC X. I PIC X. Which of the following statements concerning the above code is correct?[Incorrect shud be the ques] Choice 1 01 I PIC X. is invalid since I must be defined as numeric. Choice 2 01 THIS-IS-A-VERY-LONG-NAME PIC X. is invalid since the dataname is longer than 20 characters. Choice 3 01 01-X PIC X. is invalid since the dataname cannot start with a number. Choice 4 01 NOT-FILLER PIC X. is invalid since FILLER must not be combined with other words. Choice 5 01 WORKING-STORAGE PIC X. is invalid since WORKING-STORAGE is a reserved word. Which one of the following factors does the RENT compiler option specify about a batch COBOL II program? Choice 1 It is pre-loadable. Choice 2 Re-entrant and eligible to be loaded in the LPA Choice 3 It is serially re-usable. Choice 4

It runs in subpool 1 storage. Choice 5 It allocates a TGT area. 01 DATA-FIELD PIC X(20) VALUE 'John Johnson'. 01 NAME1 PIC X(10) VALUE SPACES. 01 NAME2 PIC X(10) VALUE SPACES. 01 NAME3 PIC X(10) VALUE SPACES. 01 TALLY-FIELD PIC 9(3) VALUE 1. UNSTRING DATA-FIELD DELIMITED BY ALL ' ' INTO NAME1 NAME2 NAME3 TALLYING IN TALLY-FIELD. Following execution of the UNSTRING statement in the sample code above, what are the values of NAME1, NAME2, and NAME3? Choice 1 NAME1 = SPACES NAME2 = 'John' NAME3 = 'Johnson' Choice 2 NAME1 = SPACES NAME2 = SPACES NAME3 = SPACES Choice 3 NAME1 = SPACES NAME2 = 'John' NAME3 = SPACES Choice 4 NAME1 = 'John' NAME2 = 'Johnson' NAME3 = SPACES Choice 5 NAME1 = 'John' NAME2 = SPACES NAME3 = SPACES Item Price Location -----------------D00025A 23.50 DTW D00025B 29.50 DTW D00025C 33.99 PHL D00026A 11.20 DTW continues... total of 50 entries maximum The above table is defined as: 01

PRICE-TABLE. 05 PRICE-GROUP 10 ITEM-CODE 10 ITEM-PRICE 10 ITEM-LOC

OCCURS 50 TIMES. PIC X(7). PIC 99V99. PIC X(3).

Referring to the table definition above, which one of the following moves the value of PHL for item D00025C to SAVED-LOC? Choice 1 MOVE ITEM-LOC(3) TO SAVED-LOC. Choice 2 MOVE ITEM-CODE(3) TO SAVED-LOC. Choice 3 MOVE ITEM-LOC(D00025C) TO SAVED-LOC.

Choice 4 MOVE ITEM-LOC TO SAVED-LOC. Choice 5 MOVE ITEM-LOC(3) OF PRICE-TABLE TO SAVED-LOC. Which one of the following does the compiler option XREF produce? Choice 1 A data description listing Choice 2 An unsorted cross-reference of data and procedure names Choice 3 A listing of line numbers that are in ascending sequence in the source program Choice 4 A compiler-generated listing of the numbers associated with each statement included in the program as a result of using the COPY directive Choice 5 A sorted cross-reference of data names, procedure names, and program names Which one of the following statements is true? Choice 1 CALL WS-PROGNAME. always results in a dynamic call; CALL 'PROGNAME'. results in a static call if the DYNAM compile option is not used. Choice 2 CALL WS-PROGNAME. results in a static call if the NODYNAM compiler option is used; CALL 'PROGNAME'. results in a dynamic call if the DYNAM compiler option is used. Choice 3 CALL WS-PROGNAME. results in a static call if the NODYNAM compiler option is used; CALL 'PROGNAME'. always results in a static call. Choice 4 CALL WS-PROGNAME. always results in a dynamic call; CALL 'PROGNAME'. results in a dynamic call if the DYNAM compiler option

FD MASTER-DATE. 01 MASTDATE-RECORD ... PROCEDURE DIVISION. OPEN I-O SYSTEM-DATE MASTER-DATE.

READ SYSTEM-DATE. READ MASTER-DATE. MOVE SYSDATE-RECORD TO MASTDATE-RECORD. WRITE MASTDATE-RECORD. CLOSE SYSTEM-DATE MASTER-DATE. What is WRONG in the above code? Choice 1 WRITE MASTER-DATE needs to be replaced with REWRITE MASTER-DATE. Choice 2 MASTER-DATE needs to be opened as OUTPUT, not I-O. Choice 3 SYSTEM-DATE needs to be opened as INPUT, not I-O. Choice 4 The files were closed before reading to EOF. Choice 5 SYSDATE is a reserved word. ISPF Screen: COMMAND ===> =BNDS> < > 000153 * SALES RECORD FOLLOWS 000154 01 SALES-TOTALS. 000155 05 ST-SALES-YTD PIC 000156 * FOLLOWING CODES ARE USED: 000157 * 000158 * ISLANDS 000159 05 ST-NA-YTD PIC 000160 05 ST-SA-YTD PIC 000161 05 ST-AI-YTD PIC 000178 *

dynamic call. SELECT SYSTEM-DATE ASSIGN TO SYSDATE. SELECT MASTER-DATE ASSIGN TO MASTDATE. ... FD SYSTEM-DATE. 01 SYSDATE-RECORD PIC X(10).

9(7)V99. NA = NORTH ALASKA SA = SOUTH ALASKA AI = ALEUTIAN 9(7)V99. 9(7)V99. 9(7)V99.

On the command line for the scenario above, you type "F SA" (without the quotes) and press the enter key. On which line is your cursor placed as a result of this action? Choice 1 Line 153

is used. Choice 5 CALL WS-PROGNAME. results in a dynamic call if the DYNAM compiler option is used; CALL 'PROGNAME'. always results in a

PIC X(10).

Choice 2 Line 154 Choice 3 Line 155 Choice 4 Line 157 Choice 5 Line 160

DATA DIVISION. WORKING-STORAGE SECTION. 01 COMPLETE-NAME PIC X(30). 01 LAST-NAME PIC 9(15). 01 LNM-POINTER PIC S999 COMP-3. PROCEDURE DIVISION. ... MOVE COMPLETE-NAME (LNM-POINTER: ) TO LAS T-NAME. ... Which one of the following needs to be done to make the statement shown in the scenario above work? Choice 1 An index must be set to point to LAST-NAME. Choice 2 Set LNM-POINTER to point to the first character of the last name and define LAST-NAME as a display format field. Choice 3 COMPLETE-NAME should be defined with an OCCURS clause. Choice 4 This statement will work as illustrated. Choice 5 The ADDRESS OF the field LAST-NAME must be specified. 1) 2) 3)

IDENTIFICATION DIVISION. PROGRAM-ID. ABCD3000. DATA DIVISION.

4) 5)

WORKING-STORAGE SECTION. 01 W-PLAYER-RECORD-AREA

PIC X(120).

6) 7) 8)

LINKAGE SECTION. 01 L-PLAYER-NAME 01 L-PLAYER-AVG

PIC X(30). PIC 9(03).

WORKING-STORAGE SECTION. 01 INPUT-POINTER USAGE IS INDEX EXTERNAL. 01 INPUT-WORK-AREA EXTERNAL. 05 DATA-INDEX1 USAGE IS INDEX. 05 DATA-INDEX2 USAGE IS INDEX. Referring to the sample code above, which one of the statements below describes what the EXTERNAL attribute feature provides? Choice 1 It allows implicitly defined indexes to be used by multiple programs. Choice 2 It provides a means to define a field that may be used in the LINKAGE SECTION of other programs without having to pass it between programs with a CALL statement. Choice 3 Fields defined as elementary items may be passed between programs without using a CALL statement. Choice 4 Any field defined in WORKING-STORAGE with the EXTERNAL attribute may be passed between programs without using a CALL statement. Choice 5 It allows multiple programs to use the same field, defined at the 01 level, without passing it between programs via a CALL statement.

9)

PROCEDURE DIVISION USING L-PLAYER-NAME, L-PLAYER-AVG. Which lines in the above Called Program Sample are in error, given the calling program information below? Working Storage: W-PLAYER-NAME PIC X(30). W-PLAYER-AVG PIC V999. Call Statement: Call 'ABCD2000' USING W-PLAYER-NAME, W-PLAYER-AVG. Choice 1 Lines 1 and 6 Choice 2 Lines 2 and 7 Choice 3 Lines 2 and 8 Choice 4 Lines 5 and 7 Choice 5 Lines 5 and 8 Which one of the following is NOT an explicit or implicit scope terminator in COBOL II? Choice 1 END-IF Choice 2 ELSE Choice 3 NOT AT END Choice 4 END-ADD Choice 5 OTHERWISE DATA DIVISION.

05 S-ERRORCHECK PIC X(01).

88 S-ERROROCCURRED VALUE 'Y'. 88 S-NOERROROCCURRED VALUE 'N'. 05 S-LINECOUNT PIC S9(3) COMP-3.

05 S-A02CHECK PIC X(01). 88 S-A02FOUND VALUE 'Y'. 88 S-A02NOT-FOUND VALUE 'N'. 05 A-A02RECORD-COUNT PIC 9(03).

1) S0500ERRORVERIFICATION.

Code needs to be added to a program to determine if any A02 record types are processed and a switch set to that effect.

2) IF S-NOERROROCCURRED 3) PERFORM S0900-WRITEERROR-REC 4) SET S-NO-ERROROCCURRED TO TRUE 5) MOVE ZERO TO SLINE-COUNT 6) ELSE 7) PERFORM S1000-WRITEREPORT-LINE 8) ADD +1 TO S-LINECOUNT 9) END-IF.

Using the fields in the sample code above, which one of the following is the correct modification? Choice 1

IF I-RECORD-TYPE = 'A02' SET S-A02-NOT-FOUND TO TRUE END-IF.

Choice 2

IF I-RECORD-TYPE = 'A02' MOVE 'Y' TO S-A02FOUND END-IF.

Choice 3

IF I-RECORD-TYPE = 'A02' MOVE 'N' TO S-A02-NOTFOUND END-IF.

Choice 4

IF I-RECORD-TYPE = 'A02' SET S-A02-CHECK TO TRUE END-IF.

Choice 5 Code in the Error Verification section must write a record to the error report and must reset the error switch if any errors have occurred in the program. Which one of the following lines in the sample code above do you correct to meet this requirement?

Choice 1

Line 2

Choice 2

Line 3

Choice 3

Line 4

Choice 4

Line 5

Choice 5

Line 8

0200 PROCESSFILE. 0210 PERFORM UNTIL MASTERKEY >= TRANSACTIONKEY 0220 WRITE MASTER-RECORD 0230 READ MASTERRECORD AT END MOVE 'Y' TO MASTER-EOF-SW 0240 ENDPERFORM. 0250 IF NOT MASTEREOF 0260 EVALUATE

IF I-RECORD-TYPE = 'A02' SET S-A02-FOUND TO TRUE END-IF.

TRUE 0270 WHEN TRANSACTIONIS-UPDATE 0280 PERFORM UPDATE-MASTER 0290 WHEN TRANSACTIONIS-ADD 0300 PERFORM ADDMASTER 0310 WHEN TRANSACTIONIS-DELETE 0320 PERFORM DELETE-MASTER 0330 ENDEVALUATE. 0340 DELETEMASTER. 0350 ... 0360 ADDMASTER. 0370 ... 0380 UPDATEMASTER. 0390 ... This is a tape-based master-transaction program segment. A number of complications arise processing a transaction file against a master file. Directing your attention to statements #0260 through #0330, why is this code ordered as shown? Choice 1

Choice 2

Choice 3

UPDATES are expected to be more prevalent than other transactions, thus better performance.

IDENTIFICATION DIVISION. PROGRAM-ID. AM82P001 IS COMMON. .... PROCEDURE DIVISION. ... CALL 'AM82P002'. GOBACK. END PROGRAM AM82P001. IDENTIFICATION DIVISION. PROGRAM-ID. AM82P002. ... PROCEDURE DIVISION. ... CALL 'AM82P003'. EXIT PROGRAM. END PROGRAM AM82P002. IDENTIFICATION DIVISION. PROGRAM-ID. AM82P003 IS COMMON. ... PROCEDURE DIVISION. ... MOVE 'X' TO SERVICE-ANDEQUIPMENT. ... STOP RUN. END PROGRAM AM82P003. Which one of the following states why the COMMON clause in the sample code above is coded incorrectly? Choice 1

The COMMON clause can only be coded on the PROGRAM-ID of a program to increase the scope of programs that it can call.

Choice 2

EXIT PROGRAM nor STOP RUN may be used in a nested program unless the COMMON clause is coded.

Choice 3

COMMON may only be coded in a contained program.

This code order is of no consequence.

This code is designed to handle the possibility that all three transaction types occur in the input stream for a given master record. Delete first; then add; then update.

Choice 4

It must be coded this way in order to avoid a deadly embrace.

Choice 4

Choice 5

The code is designed to reduce memory utilization.

COMMON may not be coded within the same program in which the COMMON program is contained.

Choice 5

When COMMON is coded on a PROGRAM-ID clause of a contained program, the contained program may only be called by a program in which it is directly contained.

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF