|
AS400 Interview Practice Questions for IBM i developer |
Q1: 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?
- file FILE01 is renamed to XXLE01
- field FIELD1 is renamed to XXELD1
- field FIELD1 is renamed to XXFIELD1
- field FIELD1 is renamed to FXXIELD1e
Answer 1:
2. field FIELD1 is renamed to XXELD1
Q2:Given the following H-spec. h datedit(*mdy)
Which of the following test whether a job started prior to midnight and still running after midnight
- if udate=<%date();
- if *%date;
- if %date(udate*mdy)<%date();
- if %date(*date*mdy)<%date();
Answer 2:
3. if %date(udate*mdy)<%date();
Q3:Which of the following contains only valid File Specification keywords?
- IGNORE, MAXDEV, SFLLIN
- SFILE, CALLP, INCLUDE
- NDSP, INFDS, PREFIX
- PGMNAME, PLIST, RECNO
- None of the above
Answer 3:
5. None of the above
Q4:Which of the following is the correct calculation for adding 23 days to date field CURDATE?
- ADDUR 23:*DAYS CURDATE
- ADDDUR 23:*DAY CURDATE
- ADDDUR 23:*D CURDATE
- ADDDAY 23 CURDATE
Answer 4:
3. ADDDUR 23:*D CURDATE
Q5: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?
-
D AField S 5A
C CallPrc 'PROC1'
C Parm AField
-
D AField S 5A
C Call 'PROC1'
C Parm AField
-
D Proc1 PR
D MyField 5A
D AField S 5A
C CallP Proc1(AField)
D Proc1 PR ExtPgm('PROC1')
D MyField 5A
D AField S 5A
C CallP Proc1(MyField)
Answer 5:
3.D Proc1 PR
D MyField 5A
D AField S 5A
C CallP Proc1(AField)
Q6:Which of the following is the OPTIONS keyword on a Definition specification used to specify?
- Parameter Passing Options
- Compilation Options
- Program Initialization Options
- Date Format Options
Answer 6:
1. Parameter Passing Options
Q7:What type of values can be used with the %CHAR built-in function?
- character
- numeric
- date
- all of the above
Answer 7:
2. numeric
Q8:Which of the following operation codes is supported in both fixed-form and free form?
- CALL
- EVALR
- ALLOC
- EXTRCT
Answer 8:
2. EVALR
Q9:Which of the following statements will extract the state code 'MA' out of the text field CITYST which contains 'BOSTON MA'?
- Movel cityst state
- Eval state = %TRIML(cityst:7)
- Eval state = %SUBST(cityst:8:2)
- Eval state = %TRIMR(cityst:8:10)
Answer 9:
3. Eval state = %SUBST(cityst:8:2)
Q10: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?
- FETCH
- SELECT INTO
- DECLARE CURSOR
- PREPARE STATEMENT
Answer 10:
1. FETCH
Q11:In a D specification what do 'Standalone' and 'Constant' describe?
- the declaration type
- the internal data type
- the data structure type
- the subroutine type
Answer 11:
1. the declaration type
Q12:Which of the following is the operation code extender for not locking a record on a READ or CHAIN?
- L
- N
- E
- P
Answer 12:
2. N
Q13:Which of the following is the File Specification keyword that causes a file not to be opened at program initialization?
- USER
- USEROPEN
- USROPN
- OPEN
Answer 13:
3. USROPN
Q14:What is the purpose of the %ELEM built-in function?
- to return the number of used elements in an array
- to return the value of the current array index
- to return the number of elements in an array
- to return the number of uninitialized elements in an array
Answer 14:
3. to return the number of elements in an array
Q15:Which of the following parameters can be used with the %EOF built-in function?
- record format name only
- file name only
- record format in filename and filename
- indicator
Answer 15:
3. record format in filename and filename