000 268 Demo
000 268 Demo
5: In the following code sample, file CUSSALES contains a record format CUSSALESR, with
unique key fields CSCONO, CSCSNO and CSYEAR.
Assuming the READE operation is successful, which record is retrieved?
A.The first record with a company greater than 3
B.The first record for company 3, with a customer greater than 100
C.The first record for company 3, customer 100
D.The first record for company 3, customer 100 with a year greater than 2003
Correct Answers: D
9: Procedure PROC1 in a Service Program must be called passing to it a 5 position field. Which
of the following code segments will accomplish this task?
A.D AField S 5A C CallPrc 'PROC1' C
Parm AField
B.D AField S 5A C Call 'PROC1' C
Parm AField
C.D Proc1 PR D MyField 5A D AField S
5A C CallP Proc1(AField)
D.D Proc1 PR ExtPgm('PROC1') D MyField
5A D AField S 5A C CallP
Proc1(MyField)
Correct Answers: C
10: Given the following field definitions, if field mmddyy contains a date in MDY format, what is
the correct syntax to populate DateFld with the content of mmddyy?
D mmddyy S 6A
D DateFld S D Inz(D'2003-06-27')
DatFmt(*ISO)
A.DateFld = %Date(mmddyy: *MDY);
B.DateFld = %Date(mmddyy: *MDY0);
C.DateFld = %Date(mmddyy: *ISO);
D.DateFld = %Date(mmddyy: *ISO0);
Correct Answers: B
11: Given the following DDS for Physical file CATFILE:
A R CATREC
A CATCOD 5S 0
A CATDES 20A
And the following code for Pgm1:
FCatFile UF A E K DISK
D CategoryRec E DS ExtName(CatFile)
C Read(E) Emp
And the following code for Pgm2:
FCatFile UF A E K DISK
C Read(E) Emp
What are the attributes of the CatCod field in both programs?
A.Packed Decimal 5,0 in both programs
B.Signed Numeric 5,0 in both programs
C.Packed Decimal 5,0 in Pgm1; Signed Numeric 5,0 in Pgm2
D.Signed Numeric 5,0 in Pgm1; Packed Decimal 5,0 in Pgm2
Correct Answers: D
12: A program needs to concatenate the 3 numeric fields shown below such that Phone# contains a
string in the format aaabbbcccc, where aaa is the AreaCode field, bbb is the PhPrefix field and
cccc is the PhNbr field. All positions of Phone# must be filled with digits.
D AreaCode S 3 0
D PhPrefix S 3 0
D PhNbr S 4 0
D Phone# S 10A
Which of the following code segments would correctly accomplish this task in all circumstances?
A.EVAL Phone# = %Char(AreaCode) + %Char(PhPrefix) + %Char(PhNbr)
B.EVAL Phone# = %EditW(AreaCode: '0') + %EditW(PhPrefix: '0') + %EditW(PhNbr: '0')
C.EVAL Phone# = %EditC(AreaCode: 'X') + %EditC(PhPrefix: 'X') + %EditC(PhNbr: 'X')
D.EVAL Phone# = %Char(AreaCode: '0') + %Char(PhPrefix: '0') + %Char(PhNbr: '0')
Correct Answers: C
14: An RPG source member containing subprocedures, will be compiled using the CRTBNDRPG
command. What value must be specified for the Default Activation Group parameter?
A.DFTACTGRP(*NO)
B.DFTACTGRP(*YES)
C.DFTACTGRP(QILE)
D.DFTACTGRP(*NONE)
Correct Answers: A
15: CL program PGMA, issues an OPNQRYF statement and then calls RPG program PGMB to
process the results of the OPNQRYF. This combination was working until PGMB was recreated to
run in a different Activation Group from PGMA. Now PGMB does not see the results of the
OPNQRYF statement. Which of the following parameters added to the OPNQRYF statement
would allow PGMB to see the correct OPNQRYF results again?
A.OVRSCOPE(*CALLLVL)
B.OPNSCOPE(*ACTGRPDFN)
C.OVRSCOPE(*ACTGRP)
D.OPNSCOPE(*JOB)
Correct Answers: D
16: Which of the following code segments show a valid comment within free format calculations?
A./Free * this is a free form comment /End-Free
B./Free /* this is a free form comment */ /End-Free
C./Free // this is a free form comment /End-Free
D./Free / this is a free form comment /End-Free
Correct Answers: C
17: Given the following file definitions for a physical file and a logical file:
AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions
A REF(FLDREF)
A R EMPREC
A EMPNO R
A ENAME R
A DEPT R
A SALARY R
AAN01N02N03T.Name++++++RLen++TDpBLinPosFunctions
A R EMPRECL PFILE(EMPMST)
A EMPNO
A DEPT
A SALARY
A K DEPT
A K EMPNO
Which fields are accessible through the logical file and in what sequence will records be presented
to the application program?
A.Fields accessible: EMPNO, ENAME, DEPT, SALARY Sequence: EMPNO within DEPT
B.Fields accessible: EMPNO, ENAME, DEPT, SALARY Sequence: DEPT within EMPNO
C.Fields accessible: EMPNO, DEPT, SALARY Sequence: EMPNO within DEPT
D.Fields accessible: EMPNO, DEPT, SALARY Sequence: DEPT within EMPNO
Correct Answers: C
18: A field is added to the end of the record format of an existing file and the file compiled with
LVLCHK(*NO). What is the impact of this action on an existing RPG program which uses this
file as an externally defined file?
A.Until the RPG program is recompiled, it will halt with a format level check error.
B.The program will run using only the fields that existed when the program was compiled.
C.The program will run using all of the fields in the file including the new fields.
D.Until the RPG program is recompiled, it will run but will issue a warning message whenever a
record is written or updated.
Correct Answers: B
19: Which of the following code segments shows the correct use of the externally described
printer file PRT1 containing record format FMT1?
A.FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords FPRT1 O E
PRINTER CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result C
WRITE FMT1
B.FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords FPRT1 O E
PRINTER CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result C
EXCEPT FMT1
C.FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords FPRT1 O E
PRINTER OFLIND(*IN88) CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result C
EXCEPT FMT1 OName++++++DF..N01N02N03Excnam++++B++A++Sb+Sa+ OPRT1
E FMT1 2 6
D.FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords FPRT1 O E
PRINTER OFLIND(*IN88) CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result C
WRITE FMT1 OName++++++DF..N01N02N03Excnam++++B++A++Sb+Sa+ OPRT1
T FMT1 2 6
Correct Answers: A