0% found this document useful (0 votes)
8 views9 pages

000 268 Demo

The document contains a series of exam questions and answers related to RPG IV programming with ILE, covering topics such as subfile handling, data types, and code syntax. Each question includes multiple-choice options with the correct answer indicated. The questions test knowledge on various aspects of RPG IV, including file operations, data manipulation, and programming constructs.

Uploaded by

Yamil Caceres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views9 pages

000 268 Demo

The document contains a series of exam questions and answers related to RPG IV programming with ILE, covering topics such as subfile handling, data types, and code syntax. Each question includes multiple-choice options with the correct answer indicated. The questions test knowledge on various aspects of RPG IV, including file operations, data manipulation, and programming constructs.

Uploaded by

Yamil Caceres
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Exam Code: 000-268

Exam Name: Rpg iv with ile


Vendor: IBM
Version: DEMO
Part: A
1: Review the following sample subfile:
+----------------------+
| Option Data |
| ------ --------- |
| || Record 1 |
| || Record 2 |
| |X| Record 3 |
| || Record 4 |
+----------------------+
The SFLNXTCHG keyword was inactive when Record 1 was written and active when each
subsequent subfile record was written. The operator has entered the "X" in the option field for
Record 3. Which subfile record will be read when the next READC operation is performed on
the subfile?
A.1
B.2
C.3
D.4
Correct Answers: B

2: Given the following code segment:


AAN01N02 N03T.Name++++++RLen++TDpBLinPosFunctions++++++++++++++++
A R D1SF SFL
A OPTNBR 1A B 10 3
A SCNDTA 50A O 10 7
A R D1SC SFLCTL(D1SF)
A 79 SFLDSP
A 81 SFLDSPCTL
A SFLSIZ(1000)
A SFLPAG(0011)
A 9 2'Opt Data
What DDS keyword needs to be added to this code segment to remove all of the records from the
subfile?
A.SFLCLR
B.SFLDLT
C.SFLRMV
D.SFLINZ
Correct Answers: A

3: Given the following code segment:


0001.00 D DateField S D DATFMT(*ISO)
0002.00 D CharField S 6A INZ('040696')
0003.00 C *MDY MOVE CharField DateField
This code will not compile. Which of the following changes will allow a successful compile?
A.Change line 0001.00 to: D DateField S D DATFMT(*MDY)
B.Change line 0003.00 to: C *MDY0 MOVE CharField DateField
C.Change line 0003.00 to: C *MDY MOVE(D) CharField DateField
D.Change line 0003.00 to: C *ISO MOVE CharField DateField
Correct Answers: B

4: Given the following code segment:


CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq
C CODE CASEQ 1 SRONE
C CODE CASEQ 2 SRTWO
C CAS SRTHREE
C END
Which of the following code segments will perform the equivalent function?
A./FREE Select CODE; WHEN = 1; ExSr SRONE; WHEN = 2; ExSr SRTWO; Other; ExSr
SRTHREE; EndSl; /END-FREE
B./FREE Select; WHEN CODE = 1; ExSr SRONE; WHEN CODE = 2; ExSr SRTWO; Other;
ExSr SRTHREE; EndSl; /END-FREE
C./FREE Select CODE; 1; ExSr SRONE; 2; ExSr SRTWO; Other; ExSr SRTHREE; EndSl;
/END-FREE
D./FREE Select WHEN CODE; Other; ExSr SRTHREE; EndSl; /END-FREE
E./FREE Select WHEN CODE; 1; EndSl; /END-FREE
F./FREE Select WHEN CODE; 1; ExSr SRONE; /END-FREE
G./FREE Select WHEN CODE; 1; ExSr SRONE; 2;
H./FREE Select WHEN CODE; 1; ExSr SRONE; 2; ExSr SRTWO;
I./FREE Select WHEN CODE; 1; ExSr SRONE; 2; ExSr SRTWO; Other; Select WHEN CODE;
1; ExSr SRONE; 2; ExSr SRTWO; Other; ExSr SRTHREE; EndSl; 1; ExSr SRONE; 2; ExSr
SRTWO; Other; ExSr SRTHREE; EndSl; /END-FREE ExSr SRONE; 2; ExSr SRTWO; Other;
ExSr SRTHREE; EndSl; /END-FREE 2; ExSr SRTWO; Other; ExSr SRTHREE; EndSl;
/END-FREE
Correct Answers: B

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

6: Given the following expression:


SoldAmt + Dividends
TotalReturnPct = ( ---------------------- - 1 ) * 100
PaidAmt + Commissions
Which /free form expression below is correct?
A./free TotalReturnPct = ((SoldAmt + Dividends) / (PaidAmt + Commissions) - 1) * 100;
/end-free
B./free TotalReturnPct = (SoldAmt + Dividends) / (PaidAmt + Commissions) - 1 * 100;
/end-free
C./free TotalReturnPct = (SoldAmt + Dividends / PaidAmt + Commissions - 1) * 100;
/end-free
D./free TotalReturnPct = ((SoldAmt + Dividends) / PaidAmt + Commissions - 1) * 100;
/end-free
Correct Answers: A

7: Given the following code segment:


d CusInfo ds dim(10) qualified
d CusNum 5 0
d AmtDue 7 2
d OrdYTD 7 2
d OrdPrv 7 2
How would the AmtDue subfield for the 5th element of the CusInfo array be referenced?
A.AmtDue(5)
B.CusInfo(5).AmtDue
C.CusInfo.AmtDue(5)
D.CusInfo(5).AmtDue(5)
Correct Answers: B

8: Given the following code segment:

After this code runs, what is the value of Result?


A.' OBJA '
B.'*libl PGMA '
C.'QGPL OBJA '
D.'QGPL PGMA '
Correct Answers: B

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

13: Given the following code segment:


DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords++++++++++++
D GetBalDue PR
D Balance 11P 2
D CustNo 5S 0
D Qty 7P 0
D Amount 5P 2
D Balance S 11P 2
D CustNo S 5S 0
D OrdQty S 7P 0
D Amt S 5P 2
Which of the following contains correct syntax?
A.C Eval Balance = GetBalDue(CustNo : OrdQty : C
Amt)
B.C CallP GetBalDue (Balance: CustNo : OrdQty : C
Amt)
C.C CallB 'GetBalDue' C Parm
Balance C Parm CustNo C
Parm OrdQty C Parm Amt
D.C CallP 'GetBalDue' C Parm
Balance C Parm CustNo C
Parm OrdQty C Parm Amt
Correct Answers: B

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

20: Given the following code segment:


DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++
D Arra s 3s 0 DIM(10)
D Index s 2s 0 Inz(0)
/FREE
For Index = 1 to %Elem(Arra);
Arra(Index) = 2 * Index;
EndFor; /END-FREE
What is the value of field Index after the code is run?
A.0
B.22
C.10
D.11
Correct Answers: D

You might also like