Você está na página 1de 10

Questions Answers &

descriptions

1 Given the following code excerpt: Option – 4

FREPORT O E PRINTER USROPN OFLIND(*INOA) As indicators *INOA to


*INOG and *INOV can
What is the error in the above File specification description? be used only in case
of Program described
1. USROPN cannot be specified for an output file
2. The OFLIND keyword is not a file level keyword. files.
3. The parameter *INOA for the overflow indicator OFLIND
is not valid for externally described files.
4. There is no error.

Option – 4
2 Given the following code excerpt:
As EXCEPT is not
FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords having factor2 it will
FQPRINTS O F 132 PRINTER OFLIND(*IN80) write all record
OQPRINTS E 10 formats with name as
O TITLE 10
O AUTH 20 blanks.
O E 1
O CONT 30
O E HDG 2
O UDATE 10
O PAGE 20
O E DETAIL 1
O AUTH 20
O VERSNO 30
O CONT 40
O E HDG 2
O UDATE 10
O PAGE 20

In the above example,which exception records are written when an


EXCEPT operation with no entry in factor 2 is processed?

C EXCEPT

1. Since no factor 2 entry has been specified for EXCEPT,


all exception records are printed.
2. Only CONT will be printed
3. If indicator 10 is off,TITLE and AUTH would be printed.
CONT will also be printed.
4. If indicator 10 is on,TITLE and AUTH would be printed.
CONT will also be printed
5. Since factor 2 entry has not been specified it will not be
complied

3 What will be the result for the following Code? Option – 2


As the type of record
FQSYSPRT O F 80 PRINTER format is H
C Eval *INLR = *ON (‘HEADER’) it will print
OQSYSPRT H NLR
the o/p.
O 'Output'

1. The string 'Output' will be printed twice


2. The string 'Output' will be printed Once
3. The program ends without printing anything
4. The program cannot be compiled as LR is not a valid
indicator for Header Lines

4 If spacing and skipping are specified for the same line in a printer Option – C
file, in what sequence the spacing and skipping operations are
processed? SKIP has higher
priority than SPACE.
a. 1. Space before 2. Skip before 3. Print a line 4.
Skip after 5. Space after If SKIP is specified, it
b. 1. Space before 2. Skip before 3. Print a line 4. will skip the page first
Space after 5. Skip after then it will skip lines
c. 1. Skip before 2. Space before 3. Print a line 4.
before or after
Skip after 5. Space after
d. 1. Skip before 2. Space before 3. Print a line 4. printing it.
Space after 5. Skip after

5 If the last record of a file has been read, and the next operation on Option - 4
that file is a READ operation, what will be the values of the input
fields for that file?

1. They will be blank and/or zero.


2. They will be null.
3. They will equal the values of the first record in the file.
4. They will equal the values of the last record read.

6 Consider the following scenario: Option – 1

Program A calls program B and program C. Program B has files As the COMMIT and
under commitment control, and program C does not. ROLBK are JOB levels
or Activation group
Will a ROLBK operation in program C affect the files changed by level.
program B?
Please refer page 707
1. Yes
of ILE RPG Ref.PDF in
2. No
share.
7 The CHAIN operation is equivalent to which of the following? Option - 4

1. SETGT and READ


2. SETGT and READE
3. SETLL and READ
4. SETLL and READE

8 When is the NR indicator (position 71-72) for the SETLL operation Option - 1
set on?

1. When the search argument is greater than the highest


key or relative record number in the file.
2. when a record is present whose key or relative record
number is equal to the search argument
3. When the SETLL operation results in an error.
4. When a BOF condition occurs.

9 Given the following RPG IV code excerpt: Option – 1

FFILEA IF A E DISK Result field can be


DSTRUCT DS specified in case of
DFLD1 1 5 Program described
DFLD2 6 9 files only with file
The file FILEA is read and subsequently a WRITE is performed as name in factor2.
shown below, where RECA is the record format of FILEA.

C WRITE RECA STRUCT

What is the error in the above code?

1. The result column should be blank for a WRITE


operation, since the file to be written into is an
externally described file.
2. The factor 2 operand should be the file name and not
record name since the file to be written into is an
externally described file.
3. The result column should always be blank for a WRITE
operation.
4. No error in the code

10 Which of the following statements regarding the READPE opcode is Option – 1


true?
As READPE is issued
(i) A READPE, with the search-arg operand specified, that with argument in
immediately follows an OPEN operation or a Beginning of File factor 1 after opening
condition, returns Beginning of File. the file without
(ii) A READPE, with no search-arg specified, that immediately pointing to any
follows an OPEN operation or a Begining of File condition,results in position, it will return
an error condition. beginning of file.
(iii) A READPE, with the search-arg operand specified, that
immediately follows an OPEN operation or a Beginning of File
condition, results in an error condition. For READPE with
blank argument
(iv) A READPE, with no search-arg specified, that immediately program will through
follows an OPEN operation or a Beginning of File condition, returns runtime error. (I/O
Beginning of File.
Error )

1. (i) and (ii) are true.


2. (iii) and (iv) are true.
3. Only (i) is true
4. Only (iii) is true.

11 Given the following RPG IV code excerpt: Option – 2

C FieldA READPE RecA 8899 Here

When will the indicators 88 and 99 be set on? 88 – Error indicator

(i) Indicator 88 is set on if the operation is not completed 99 – Not found


successfully. indicator Or BOF
(ii) Indicator 88 is set on if the record key does not match FieldA. indicator
(iii) Indicator 99 is set on if the operation is not completed
successfully. In program 88 is the
(iv) Indicator 99 is set on if the record key does not match FieldA. LOW and 99 is the
Equal indicators at
1. (i) and (iii) are true
2. (i) and (iv) are true positions 73-74 and
3. (ii) and (iv) are true 75-76 respectively. Hi
4. (ii) and (iii) are true indicator (71-72) is
not allowed for this
operation.

12 Consider the following scenario: Option - 2

A valid input operation with lock (READ, READC, READE, READP,


READPE or CHAIN) is successfully issued to a particular record
format. then an intervening unsuccessful input operation is issued
to the same record format before issuing an UPDATE.

Will the UPDATE be successful?

1. The UPDATE will be unsuccessful for both disk files and


subfiles.
2. The UPDATE will be successful for subfiles but will
update the locked record retrieved from the first input
operation. The UPDATE will fail for disk files.
3. The UPDATE will be successful for disk files but will
update the locked record retrieved from the first input
operation. The UPDATE will fail for subfiles.
4. The UPDATE will be successful for both disk files and
subfiles and will update the locked record retrieved
from the first input operation

13 Which of the following I/O operations make up the EXFMT Option - 4


operation?

1. READ followed by a WRITE


2. READ followed by an UPDATE
3. READC followed by an UPDATE
4. WRITE followed by a READ

14 Given the following RPG IV code excerpt: Option - 2

FSCREEN CF E WORKSTN
C EVAL OUTFLD=12
C EVAL INPFLD=1
C EXFMT SCRREC

What will be the values of the following fields on the screen?

(i) input field INPFLD


(ii) output field OUTFLD

1. 1 and blanks
2. blanks and 12.
3. 1 and 12
4. both fields will be blanks.

15 In the DDS for a display-device file, if a function key is described as Option – 3


a command function key (CF), then which of the following is
returned to the program? For Command
Attention key answer
1. Only the response indicator will be 1.
2. Only the data record.
3. The response indicator and the data record (with any
modifications entered on the screen)
4. The response indicator and the data record (without any
modifications entered on the screen)
16 Which of the following are valid record types for a display file? Option - 4

(i) PDNSFL
(II) PULDWN
(III) USRDFN
(IV) MNUBAR

1. (I) and (iv)


2. (i) and (ii)
3. (i),(iii) and (iv)
4. (i), (ii) ,(iii) and (iv)

17 Given a full procedural, externally-described input file named Option – 1


ORDER with a record length of 41 bytes, which of the following is a
valid format for the File specification for the ORDER file? Record length must
not be specified for
1. FFilename++IPEASF.....L.....A.Device+.Keywords externally described
FORDER IF E DISK files.
2. FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords
FORDER IPE F 41 DISK
3. FFilename++IPEASF.....L.....A.Device+.Keywords
FORDER IF E 41 DISK
4. FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords
FORDER IF F DISK

18 Given the following RPG IV code excerpt: Option - 2

FFilename++IPEASF.....L.....A.Device+.Keywords
FORDERS IF E K DISK USROPN

Which of the following options describes the result of using the


USROPN keyword

1. This file will be opened immediately when this program


is called.
2. This file must be opened with an explicit OPEN
operation prior to accessing this file.
3. This file must be opened with the CL command
OPNDBF prior to the call to this program.
4. This file will be opened when the program reaches a C
specification that issues a READ or CHAIN to this file.

19 In an RPG program, where is the information available to determine Option – 4


which member of a multiple-member physical file is currently being
processed? At position 129 to 138

1. in the initialization subroutine


2. in the program status subroutine
3. in the program status data structure
4. in the file information data structure

20 Which of the following is the result of using PREFIX(XX:2) on a File Option - 2


Definition specification line for a file FILE01 that has one field
named FIELD1 ?

1. file FILE01 is renamed to XXLE01


2. field FIELD1 is renamed to XXELD1
3. field FIELD1 is renamed to XXFIELD1
4. field FIELD1 is renamed to FXXIELD1

21 What is the maximum number of record formats in a printer file and Option - 4
maximum number of fields in any one record format in a printer file?

1. 2048 and 31,628 respectively


2. 512 record formats and any number of fields.
3. Only one record format and any number of fields.
4. 1024 and 32,767 respectively

22 SKIPA can be performed at which of the following levels? Option - 4

1. Record level only.


2. File level and record level.
3. Field level and record level
4. Record level, file level and field level.

23 An RPG program uses an externally described printer file and an Option - 1


input file that it will read. If the printer file uses the same field names
that are used in the input file, then which of the following statements
is true?

(i) The field names should have the same length and type in both
definitions.
(ii) The most recently assigned value will be used for all
occurrences of the field.
(iii) Error occurs since RPG cannot handle two or more fields having
the same name.
(iv) The values in the fields defined in the printer file will override the
values of all other fields having the same name.

1. (i) and (ii).


2. (iii) only
3. (ii) only
4. (i) and (iv)

24 Which of the following is true regarding the EDTCDE (Edit code) Option - D
keyword in printer files used to edit output-capable numeric fields?

1. You cannot specify EDTCDE and EDTWRD for the same


field.
2. Edit codes 1 through 4 represent user defined edit
codes.
3. The DFT keyword cannot be specified with the EDTCDE
keyword.
4. Option indicators are not valid for this keyword.
a. 1&2
b. 1, 2, 3 & 4
c. 1, 2 & 3
d. 1, 3 & 4

25 Given the following RPG IV code excerpt: Option - 4

FFILEA UF A E DISK EXTMBR(mbrname)

Which of the following regarding the variable mbrname is NOT true?

1. The variable mbrname can be set by using the INZ on


the D specification.
2. The variable mbrname can be set by passing the value
in as an entry parameter
3. The variable mbrname can be set by using a program-
global variable that is set by another module
4. The variable mbrname can be set by using the EXTFLD
keyword.

26 Given the following code excerpt: Option - 3

FDBEMP IF F 10 DISK extfile(flname)

Also given that, the following commands are in effect.

OVRDBF FILE(FILE1) TOFILE(OTHERLIB/FILE2)

OVRDBF FILE(DBEMP) TOFILE(OTHERLIB/FILE1)

If the variable flname has the value MYLIB/FILE1 at runtime and


the current library is MYLIB, then which file will RPG open at
runtime?

1. DBEMP
2. MYLIB/FILE1
3. OTHERLIB/FILE2
4. OTHERLIB/FILE1

27 Given the following RPG IV code excerpt: Option – 3

FFilename++IPEASF.....L.....A.Device+.Keywords USROPN is not


FFILEX IF E DISK needed for OPEN &
C OPEN FILEX CLOSE opcodes.
Since an OPEN operation is specified for a file that is already open,
an error occurs.

How can this error be avoided?


A. By specifying the USROPN keyword on the file description
specification.

B. By explicitly closing the file using CLOSE opcode before opening


it.

1. A only
2. B only
3. Using Either A or B
4. Using Both A and B.

28 If you specify a file name without a library name as a parameter for Option -2
the EXTFILE keyword, then which library name will be used?

1. QTEMP
2. *LIBL
3. System Value QUSRLIBL
4. Error occurs, since library name is mandatory.

29 What will be the result for the following Code if the printer file Option – 3
TESTPRTF does not exists?
Program described
FTESTPRTF O F 80 PRINTER files are never created
C Eval *INLR = *ON by the program. This
OTESTPRTF H NLR is basically used for
O 'Header'
O D NLR formatting the file.
O 'Detial'
The object for the file
should exist in the libl
1. The string 'Header' and 'Detail' will be printed. to run the program.
2. The string 'Header' will be printed Once Compilation will not
3. The program ends with ERROR. throw any error.
4. The program cannot be compiled as LR is not a valid
indicator for Header Lines

30 SPACEA can be performed at which of the following levels? Option - 2

1. Record level only.


2. File level and record level.
3. Field level and record level
4. Record level, file level and field level.

31 What is the maximum number of record formats allowed for Option - 1


Physical File?

1. 1
2. 512
3. 1024
4. *NOMAX

32 Which of the following we can get from File information Data Option - 1
Structure?
a. Read count
b. Write count
c. Record format name
d. Last Opcode processed on the file
e. End Of file indication

1. All
2. Only C & D
3. A, B, C & E
4. A, B & D

33 When is the indicator (position 75-76) for the SETLL operation set Option - 2
on?

1. When the search argument is greater than the highest


key or relative record number in the file.
2. when a record is present whose key or relative record
number is equal to the search argument
3. When the SETLL operation results in an error.
4. When a BOF condition occurs.

Você também pode gostar