• No se han encontrado resultados

CAPÍTULO DIECISIETE

In document EL DIARIO DEL EBRO 1 (página 39-42)

Choice 2

MOVE ITEM-CODE(3) TO SAVED-LOC.

Choice 3

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

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

dynamic call.

SELECT SYSTEM-DATE ASSIGN TO SYSDATE. SELECT MASTER-DATE ASSIGN TO MASTDATE. ... FD SYSTEM-DATE. 01 SYSDATE-RECORD PIC X(10). FD MASTER-DATE. 01 MASTDATE-RECORD PIC X(10). ... 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 9(7)V99.

000156 * FOLLOWING CODES ARE USED: NA = NORTH ALASKA 000157 * SA = SOUTH ALASKA 000158 * AI = ALEUTIAN ISLANDS 000159 05 ST-NA-YTD PIC 9(7)V99. 000160 05 ST-SA-YTD PIC 9(7)V99. 000161 05 ST-AI-YTD PIC 9(7)V99. 000178 *

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 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) IDENTIFICATION DIVISION. 2) PROGRAM-ID. ABCD3000. 3) DATA DIVISION. 4) WORKING-STORAGE SECTION. 5) 01 W-PLAYER-RECORD-AREA PIC X(120). 6) LINKAGE SECTION. 7) 01 L-PLAYER-NAME PIC X(30). 8) 01 L-PLAYER-AVG PIC 9(03). 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. 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.

05 S-ERROR- CHECK PIC X(01).

88 S-ERROR- OCCURRED VALUE 'Y'. 88 S-NO- ERROR- OCCURRED VALUE 'N'. 05 S-LINE- COUNT PIC S9(3) COMP-3. 1) S0500- ERROR- VERIFICATION. 2) IF S-NO- ERROR- OCCURRED 3) PERFORM S0900-WRITE- ERROR-REC 4) SET S-NO-ERROR- OCCURRED TO TRUE 5) MOVE ZERO TO S- LINE-COUNT 6) ELSE 7) PERFORM S1000-WRITE- REPORT-LINE 8) ADD +1 TO S-LINE- COUNT 9) END-IF.

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 05 S-A02- CHECK PIC X(01). 88 S-A02- FOUND VALUE 'Y'. 88 S-A02- NOT-FOUND 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?

In document EL DIARIO DEL EBRO 1 (página 39-42)

Documento similar