AS400 Interview Practice Questions with four options-Set 1

Опубликовано: 07 Октябрь 2024
на канале: AS400 and SQL Tricks
761
7

#rpgle #as400 #sql
1-Which of the following is the result of using PREFIX(XX:2) on a File Definition specification line for a file FILE01 that has one field named FIELD1 ?

a)file FILE01 is renamed to XXLE01
b)field FIELD1 is renamed to XXELD1
c)field FIELD1 is renamed to XXFIELD1
d)field FIELD1 is renamed to FXXIELD1


3-Which of the following contains only valid File Specification keywords?

a)IGNORE, MAXDEV, SFLLIN
b)SFILE, CALLP, INCLUDE
c)INDSP, INFDS, PREFIX
d)PGMNAME, PLIST, RECNO
e)none of the above

4-Which of the following is the correct calculation for adding 23 days to date field CURDATE?

a)ADDUR 23:*DAYS CURDATE
b)ADDDUR 23:*DAY CURDATE
c)ADDDUR 23:*D CURDATE
d)ADDDAY 23 CURDATE

5-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)

6-Which of the following is the OPTIONS keyword on a Definition specification used to specify?

a)Parameter Passing Options
b)Compilation Options
c)Program Initialization Options
d)Date Format Options

7-.What type of values can be used with the %CHAR built in function?

a)Character
b)Numeric
c)Date
d)all of the above

8-Which of the following operation codes is supported in both fixed form and /Free form?

a)CALL
b)EVALR
c)ALLOC
d)EXTRCT

9-Which of the following statements will extract the state code 'MA' out of the text field CITYST which contains 'BOSTON MA'?

a)Movel cityst state
b)Eval state = %TRIML(cityst:7)
c)Eval state = %SUBST(cityst:8:2)
d)Eval state = %TRIMR(cityst:8:10)

10-Which of the following SQL statements, when used by itself in an RPG program, can take the place of a File Specification, a key and a CHAIN?

a)FETCH
b)SELECT INTO
c)DECLARE CURSOR
d)PREPARE STATEMENT

11-In a D specification what do 'Standalone' and 'Constant' describe?

a)the declaration type
b)the internal data type
c)the data structure type
d)the subroutine type

12-Which of the following is the operation code extender for not locking a record on a READ or CHAIN?

a)L
b)N
c)E
d)P

13-Which of the following is the File Specification keyword that causes a file not to be opened at program initialization?

a)USER
b)USEROPEN
c)USROPN
d)OPEN

14-What is the purpose of the %ELEM built in function?

a)to return the number of used elements in an array
b)to return the value of the current array index
c)to return the number of elements in an array
d)to return the number of uninitialized elements in an array

15-Which of the following parameters can be used with the %EOF built in function?

a)record format name only
b)file name only
c)record format or and file name
d)indicator