• No results found

CL variable types, max length, default length

In document As400 Interview Questions (Page 116-123)

root of the expression or

24) CL variable types, max length, default length

26) If I use a field reference file and a COLHDG is defined in that and while using them in a PF I again specify a COLHDG, which takes precedence?

27) Difference between ODP and Access path?

28) What is an ODP does it exist if so where?

29) RPGILE is faster than RPG why?

30) How many overflow indicators can u have in a pgm?

31) What are the different kinds of indicators in RPGLE?

32) What is primary file, secondary file, fully procedural file.

33) How many secondary files/printer files can be there in a pgm?

34) Can I specify a update for a primary/secondary file/fully procedural file?

35) What happens if I specify UC (user controlled) for a primary/secondary/fully

procedural file?

36) What is level check (LVLCHK)?

37) What is *Namvar DEFINE?

38) What are the error handling subroutines?

39) What are the different kind of MONMSG’s

40) Can u se a subfile in a CL pgm? Message Subfile ?

41) What is the difference between CALL and Transfer Control (TFRCTL) ?

42) Explain Multi Dimensional Array?

43) Explain Commitment Control?

44) How can u send data from a production environment to a development

environment?

45) READC why n when used?

46) How do you send a Packed decimal value from a CL program to a RPGILE

program as parameter?

47) How does CL pgm end if no ENDPGM, is PGM mandatory?

RPG/400 – Quiz (25 Marks)

1. The maximum no. of files that can be declared in an RPG/400 program is __50 ___.

2. Write the syntax to define a data area in an RPG/400 program.

*NAMVAR DEFN MYAREA 20 where MYAREA is a data area. 3. What are the two programming styles in RPG/400?

RPG Logic Cycle and User Logic

4. Justify why only 8 printer files can be used in an RPG/400 program.

Only 8 overflow indicators are available in RPG/400 – OA-OG, OV which can be used to handle only 8 printer files at the most.

5. What are the data types supported by RPG/400? Character and Numeric and exceptionally Binary

6. What are the uses of I-specs? 2 marks

I specs can be used to define Data Structures, Named Constants, and Program Described file definition

7. How many types of arrays are there in RPG/400? Define them. 2 marks

Pre-run time array – The array gets loaded into the memory before the execution of the program. Values to this array are loaded by the system from a predefined table.

Run time array – Gets populated during the run-time by the user.

Compile time array – Gets values during the compile time specified in IP** prompt after the code.

8. The maximum no. of arrays in one RPG/400 program are ___256____. 9. The maximum no. of sub-routines in RPG/400 program are __256__.

10. The sub-routine which is automatically called by the RPG/400 program is __*INZSR or initialization subroutine __.

11. What is INFDS?

INFDS – File information data structure

12. What are the set of keywords in their order to define a subfile? 2 marks

SFLDSP – subfile display, SFLDSPCTL - subfile control display, SFLCLR – subfile clear, SFLSIZ – subfile size, SFLPAG – subfile page

13. How many sub-files can be defined in a display file? 512

14. Differentiate ITER and LEAVE.

Iter - This Opcode will make the loop to continue. Leave – This Opcode will make the loop to terminate

15. How many times are the printing operations performed in a RPG Logic cycle? What

4 a) Heading time b) Detail Time c) Total Time d) Exception Time 16. Define XFOOT.

Opcode to add all the array elements and store in a result. 17. What is the maximum no. of records in a subfile?

9999

18. Name the various read operations in RPG/400 & explain. 2 marks

READ, READP, READE, REDPE, CHAIN, READC

19. The opcode which replaces SETLL and READ is _____CHAIN_____. 20. Differentiate DOU and DOWxx.

DOU – executed atleast once and then condition is checked for. DOW – executed only if condition is satisfied.

DB2/400 – Quiz (25 Marks)

1. What are the files that you can create in DB2/400? Physical Files and Logical Files (PFs and LFs)

2. What are the essential parts of a PF? Explain pictorially. 2 marks

There are three essential parts of a PF, viz., Record Format, Access Path, Data Members.

3. What is the maximum no. of key fields? 120

4. Name the possible methods to feed data into a PF. DFU, IDDU, Programmatically, Interactive SQL

5. What is the maximum no. of records a PF can have by default? 10000 + 3*1000

6. Keywords can be specified at ___4___ different levels in a PF.

7. _ DESCEND _ is the keyword used to sort the duplicate record in descending order. 8. The ___ REF ___ keyword is used at the file level to obtain a reference of a field

from some other PF.

9. By using what keywords and at what levels can we obtain reference of fields from

multiple files. Give the syntax. 2 marks

REF at file level

REFFLD at field level REF(LIB/FILE)

REFFLD(FIELD FILE)

10. What are the different constraints that can be applied on a PF? 2 marks

PRIKEY – Primary Key Constraint UNQCST – Unique Key Constraint REFCST – Referential Integrity CHKCST – Check Constraint

11. Write the syntax to make a field not null? Field Name CHECK(ME)

12. What are the data types supported by DB2/400? 2 marks

13. A – alphanumeric P – packed decimal S – zoned decimal L – Long date Z – Time stamp T – Time F – Floating point H – Hexadecimal

14. What are the essential keywords in their order to define a Join Logical File? JFILE, JOIN, JFLD

15. How many record formats can a non-join logical file contain? 32

16. How do you join two files in a join logical file? JOIN keyword

17. What are the types of join logical files?

Left outer Join, Inner Join, Intersection (Any two may be considered)

18. _____ DYNSLT at the file level _____ keyword is used to specify select and omit criteria.

19. How can you refer to the access path of a PF in an LF? ACCPTH keyword

20. How do you define a left outer join? JDFTVAL keyword

21. How do you handle duplicate record occurrence in a Join Logical File? JDUPSEQ keyword

22. Logical Files cannot have data members. (T/F) False

Questions:

Section 1 – CL Command use

1) Use of mon-message. A piece of code was given with the MONMSG at procedure level and it was asked where will the control go if an error happened in the processing of a command defined somewhere in the procedure.

3) A call to a program is to submitted in batch and a customized library list is to be sent along with it.

4) How to retrieve the job date/job name. Available options had RTVJOBA, RTVJOBD etc.

5) CHGDTAARA command was given with a complex VALUE parameter which contained %SST. Was asked to mark the option, which gives the right value in the Data area.

6) How can the current library list be changed. Was asked to mark 2 correct answers. 7) How to debug a program running in batch.

8) A file with key A is to be accessed randomly on the basis of a field B. Available options Create a new logical, Opnqry with STRSEQ parameter having B, Sorting the file etc.

9) How to see the logical files created over a file by using CL command. Section 2 – RPG Command use

1) Where is the *INZSR subroutine coded.

2) A field was defined with the like keyword. Was asked about its length and initial value.

3) A DATFMT was defines at control spec. There were date definations at D spec. Was asked to recognize incorrect format.

4) How is the format of a date defined at control specification level.

5) %ELEM was used to define an array in the DIM keyword. Was asked how many records the array will have.

6) Complex %subst using %scan with addition and subtraction done in the return value of SCAN.

7) If DIV used with factor 2 zero what will happen. Options available Result indicator will be set on, *PSSR code will be executed, Result factor will have zero etc.

8) A piece of code was given using DIV opcode where factor 2 was zero and *PSSR subroutine was coded. Was asked to detect what will happen.

9) A data area DS was given and IN OUT operations performed. Among five different samples of code was asked to find out in which case the Data area will be locked and unlocked.

10) How to find the Program name and some related information. Options had SDS etc.

11) An expression using op-codes was to be converted using built in functions - %Dec and %DECH.

12) What is the correct syntax for Op-code Test(D)

13) When does a indicator defined in 73-74 position seton while chaining a record.

14) Except keyword. A file defined in F spec as O type and a DS defined in D spec. How can the file be updated using the DS.

Section 3 – Advanced RPG Programming

1) Complex Logical expression using Indicators and a variable. Analyzing and determine the result of the variable.

2) Setting the indicator value by using logical expressions. *IN50 = (A = B)

what will be the indicator value.

3) With the same condition as above a complex piece of code was given and the result was to be determined.

4) A complex logic in words using and either, or, neither to be written in expression. 5) A complex piece of code with a variable using ITER and LEAVE was given and

analyzing that code the value of that variable was to be determined. 6) How to include a service program in your program.

7) While creating the program if *OWNER is given to the usrprf parameter what is its significance.

8) A program ‘A’ compiled with activation grp. *New calls a program ‘B’ compiled in activation grp. QILE. Program B has the following code: -

Count = count + 1 Seton RT

After the program has been invoked 3 times. What will be the value of count?

9) A Question on the same lines as above but not in different activation group. What will be the value of count?

10) Where is a prototype defined.

11) Select the right prototype definition. Extpgm definition was used?

12) A piece of code for sub procedures was given. What is the length of the value

returned?

Section 4 – Subfiles

1) There are some 200 records to be loaded. The roll up/down keys should be very fast. Which loading technique to be used.

2) What does the keyword SFLNXTCHG do. 3) What does the keyword SFLRCDNBR do.

4) A piece of code was given using SFLRCDNBR. At what position the cursor will be?

5) There was a piece of code having different keywords along with there indicators. What will be the indicator positions to initialize the sub file.

6) If a record has been deleted and you don’t want do display it on the subfile anymore. What is the best possible way to do it?

Section 5 – RPG Performance and Exception/Error Handling

1) There was some question where some data movement was done and then finally asked what will be the result. Available option Data truncation etc.

Section 6 – RPG Data Handling

1) A multiple occurrence data structure was defined. How to set the occurrence using the OCCUR opcode.

2) An EDS was defined using prefix but the fields were not renamed using EXTFLD. What will be the name of the fields used in the program.

Data Types: CL/400 has only 3 data types. 1. Character

2. Numeric 3. Logical

1) CL PROGRAMMING TO ADD TWO NUMBERS

In document As400 Interview Questions (Page 116-123)