You are on page 1of 7

AS400 Stuffs ------------

1.

How do u know a record exists without doing read and chain?

SETLL and %FOUND

2. What will be ur approach in going either for OPNQRYF or Logical files. Which one to go for?

Depends. How many logicals are already over the file? How often with the job be run? Is this a one time or permanent job. And many others. It depends on your system and your rules.

3. How do u manage that the records doesnt get locked by a CHAIN or READ operation?(This he asked indirectly by taking a subfile selection screen and another update screen)

Depends. You can define the F spec for input only. You can code the CHAIN or READ with the (N) extender. I didnt understand your part in the ().

4.

How do u call procedures in ILE?

CallP or simply reference the procedure name. So you could do some like: DayOfWeek = GetWeekDay( *DATE ); Or If GetWeekDay(*DATE) = 2;

5.

What is the syntax of passing parameters to a procedure by value?

The syntax of the actual call or the prototype syntax? Or did you mean neither one?

6.

Have u used binder language like coding export to procedures ?

Yes, see below:

STRPGMEXP PGMLVL( *CURRENT )

EXPORT SYMBOL( 'MSGBOX' ) EXPORT SYMBOL( 'ACTMETHOD' )

ENDPGMEXP

STRPGMEXP PGMLVL( *PRV )

EXPORT SYMBOL( 'MSGBOX' )

ENDPGMEXP

7.

How do u code file field renames in ILE RPG?

Depends. You can use the I spec (old way). You can use the PREFIX keyword on the F spec.

8. In ProgramB there is a submitjob ,which is a call to program C.There is also a CALL to program D from B. How would u check the program C has been executed in D?

Depends. You could set up a data area or a data queue. You could pass messages. Just a couple of ways.

9.

How do you find whether a record is locked or not.

Depends. In older RPG the *PSSR was used. In a newer program I would use a MONITOR block.

Difference between RPG/400 and RPG4

Is this a question or related to previous question?

10.

Is there any thing advantage for date variables in RPG4?

Yes. There are all sorts of new BIFs that work with the date, time and timestamp type fields.

11.

How do you find whether a job is a batch job or interactive?

RTVJOBA TYPE

0=Batch, 1=Interactive

12.

What you have to do in the display file when you are using message subfile

Define the subfile and subfile control records? Not sure what youre looking for here.

13.

How to set on/off a group of indicators in a single statement.

Trick question, right? In the past this little trick was done with a MOVEA 00000 *IN30. This is considered bad programming practice today.

14.

How can you determine the number of characters in a variable?

%CHECKR( : variable)

15. Let's consider a variable X of length 20. Move value 'ABC' to it. How to determine how many characters does X have?

With both 14 and 15 I cant tell if you are looking for the length of the DATA in the variable or the length of the variable itself. %CHECKR = Length of data &LEN = Length of variable

16.

Suppose you have 3 members in a database file.

17. How to read records from all the members without using CL (OVRDBF) ie it should be handled exclusively in an RPG program?

As far as I know, cant be done. Unless of course you call a CLP from the RPG, but as far as this question goes, wouldnt that be cheating?

18.

How do you do indexing in a physical file?

I dont understand the question. Do you mean adding key fields? Do you mean creating logicals?

19.

PF contains 50 fiedls how can u update only 2 fields?

Depends [tried of hearing that yet? ] The old way would be to code the fields on O specs then do an EXCEPT. The new way is UPDATE RecordName %FIELDS( Field1 : Field2 )

20.

Can indexed file be accessed in arrival sequence in RPG

By indexed I assume you mean a logical file? Sure, just dont specify the K on the F spec.

21.

when will DUMP & DEBUG be ignored

DEBUG(*NO)

22.

what is the necc. command needed before OPNQRYF & why

OVRDBF SHARE(*YES) Because the OPNQRYF and the program to process the file must share an access path.

23.

can u copy the records created by the OPNQRYF to other files & how

Sure. CPYFRMQRYF

24.

diff, ways to pass data between pgms. which is the efficient way

Just three are 1) pass parms, 2) *LDA, 3). DATAARA. Most efficient? PARMs

35.What are the necessary keywords required to code a message subfile?

36. What is the purpose of FRCDTA keyword? 37. What is the purpose of PUTOVR keyword? 45. What is Group job?

51. How do you detect unused spool storage? 52. What are the functions of remote job entry? 53. What is journalling and commitment control? 54. What is the purpose of Panel Groups? 55. How can a screen field that has changed since the last output operation be detected?

56. What would be the effect on the field where reverse image, underline, and high intensity?

57. Can more than one subfile record be displayed on one line? 58.What is Binder Language? 59.How to check whether the program is a interactive or Batch in a CL? Get the value from TYPE in RTVJOBA command the value of TYPE is 1 if the job is interactive the value of TYPE is 0 if the job is Batch 60.How to check the given input is a date? 61.Differnce between INFSR & INFDS? 62.How to handle the record Lock while the same screen is used by two users at a same time? 63.What is Subfile? 64.How to check whether a particular object is availble in CL program? 67.How to Lock the Dataarea in CL program? 68.what is Signature Violation? 69.Differnce between PSSR & PSDS? 70.How to run the pgm which contains *Entry without passing parameteres? 71.What is Decimal data error? 72.How to make run time decimal data error? 73.What is ILE? It is a set of tools, designed to enhance the program development on the iseries system.

74. How to debug Batch Jobs?

DEBUGGING BATCH JOBS


Steps to debug a batch job 1. SBMJOB ... HOLD(*YES) 2. STRSRVJOB JOB(jobnbr/user/jobnam) 3. STRDBG When source is displayed, press F12 4. RLSJOB JOB(jobnbr/user/jobnam) When Start Serviced Job display appears, press F10 5. When command entry display is shown, DSPMODSRC When source is displayed, set a breakpoint, then press F12 When command entry display is shown, press F12 6. When Start Serviced Job display reappears, press Enter Program will stop at breakpoint, and can be debugged interactively 7. After serviced job ends ENDDBG ENDSRVJOB

You might also like