You are on page 1of 3

Q A

What is difference between Source Physical File and Physical File ? A Source Physical File contains the source for the various objects created. This file has a specific structure. A Physical File contains data, and the record for at can be different for different physical files. What is the difference between Physical File, !o"ical File and #oin !o"ical File? $% )% +% -% /% 0% Physical File has only &'( record for at while !o"ical file can have ultiple for at. Physical file havin" data e ber while !o"ical file won*t have data e ber. !o"ical File is an access path or it is just a ,iew to Physical File. !o"ical file can have a.i u of +) record for ats in one !F. With the help of !F and PF we can update the files. #oin lo"ical file joins two or ore than two PFs. 1a.i u we can join +) files in one sin"le join lo"ical file. 2t can have ultiple record for at upto +) record for at. We can not update the file with help of JLF.

Q A

Q What is an access path ? A The order in which the database fields are or"ani3ed for processin" in pro"ra . CL Q A Q A Q A Q A< 4ow any files can be declared in 5! ? &ne. 5an libraries be added to the library list throu"h 5! ? 6es, usin" A77!28!. 4ow can errors be trapped in a 5! pro"ra ? 8y usin" 1onitor 1essa"e 5o and 9 1&'1S: % What are the li itations of 5! 9co pare to ;P:% ? 6ou cannot use 5! pro"ra to = . A77 or >P7AT( records in database files . >se Printer or 25F files . >se Pro"ra described files . >se the concept of subfile 9to display ore than one record%, but a sin"le output essa"e subfile is a special type of subfile that is supported well in 5! . >se subroutines. 6ou cannot declare ore than one object 9file% in a 5! pro"ra e.

the

RPG Q A (.plain ;P: Pro"ra !o"ic 5ycle ?

START

Perform detail calculation

Perform header, detail output Read a record Set ON LR if EOF If change in control field, set ON control level indicators

"ove data from selected record into processing area

Perform total calculations Perform total output If LR is ON then EN! program


Q A Q A When is it efficient to a?e use of ;P: 5ycle ? When the file is arran"ed in se@uence and output is based on control Specify different indicators used in ;P: ? &verflow indicators. ;ecord 2dentifyin" 2ndicators. Field 2ndicators. ;esultin" 2ndicators. 5ontrol !evel 2ndicators. 5an an inde.ed file be accessed in arrival se@uence in ;P: pro"ra 6es.

brea?.

Q A

Q= What is the ost efficient way of chec?in" for the e.istence of a record without actually readin" the record into e ory? A= Setll Q (.plain the difference between ;(A7, 54A2' and S(T!! ? A ;(A7 operation reads the record currently pointed to, fro a full procedural file. 54A2' operation retrieves a record fro a full Procedural file, sets a record identifyin" indicator &' and places the data in the input fields. S(T!! operation position a file at the ne.t record that has a ?ey or relative record nu ber that is "reater than or e@ual to the search ar"u ent specified. The file ust be fully procedural for all three opcodes. Q A Q A What is the difference between 7&> and 7&W ? 7&> chec?s after enterin" into the loop, it is perfor ed atleast once. 7&W chec? before enterin" into the loop. What is 5!(A; and ;(S(T ? 5!(A; operation sets the ele ents in a structure 9record for at, arrayAtable, data structure% or a variable 9field, subfield or indicator% to 3ero , blan? or BCB dependin" on the field type 9nu eric, character, indicator% ;(S(T operation sets the ele ents in a structure 9record for at, arrayA table, data structure% or a variable 9field, subfield or indicator% to its initial value.

Q A

What are the different types of arrays available in ;P: ? PreDe.ecution ti e array. 5o pile ti e array. (.ecution ti e array.

Q What is a File 2nfor ation 7ata Structure ? A File 2nfor ation 7ata structure 92'F7S% can be defined for each file to a?e file e.ceptionAerror infor ation available to the pro"ra . A file infor ation data structure contains predefined subfields that identify= . The na e of the file for which the e.ceptionAerror occurred . The record bein" processed when the e.ceptionAerror occurred or the record that caused the e.ceptionAerror . The last operation bein" processed when the e.ceptionAerror occurred . The status code . The ;P: routine in which the e.ceptionAerror occurred. Q A What is Pro"ra Status 7ata Structure ? A pro"ra status 7S can defined to a?e pro"ra e.ceptionAerror infor ation available to an ;P: pro"ra . 7S is defined as a pro"ra status 7S by an S in position $E of the 7S state ent. FSTAT>S contains status code F;&>T2'( contains na e of routine in which the e.ceptionAerror occurred. FPA;1S contains the nu ber para eters passed to this pro"ra fro the callin" pro"ra . Specify headin" infor ationAT2T!(. Specify to be"in on a fresh pa"eA(#(5T. To control line spacin"ASPA5(. ;ecords to be inserted fro other files at the point where it is specifiedA5&P6.

Q A Q A Q A Q A

;e@uired ?ey words for subfile. SF!, SF!5T!, SF!7SP, SF!S2G, SF!PA: are the andatory ?ey words. SF!7SP5T!, SF!5!;, SF!2'G, SF!('7 are the optional ?ey words used in subfile. 4ow do you specify the nu ber of records to roll in a subfile ? >se SF!;&!,A! ?eyword in 77S alon" with the nu ber, which specifies the nu ber of records to scroll at a ti e. 4ow will you display a particular pa"e in subfile ? 1ove a valid relative record nu ber9;;'% in the field specified usin" SF!;57'8; ?eyword in 77S What is SF!5S;;;' and SF!;57'8; ? SF!5S;;;' will "ive the ;;' of the record where the cursor is positioned. SF!;57'8; will "ive the ;;' of the First record displayed on the screen at a "iven ti e.

You might also like