1) How to declare a file?
2) How to define a display file?
3) How to monitor error messages in RPG?
4) How to find the attributes for subfiles? and what is the
DDS for subfiles?

Answers were Sorted based on User's Feedback



1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG..

Answer / mehul

Answer to 3)
Method 1:

To moniter Error in RPG make use of
MONITIOR
.....
ON-ERROR <some error number>

ENDMON

u can place a subroutine , procedure etc under this to
handle the error for the following

Method 2:

Activate the Error Indicator, for the field you want to
place the error handling
if any error occurs for that field %error is SETON, and u
can use this indicator to take action accordingly

Is This Answer Correct ?    3 Yes 0 No

1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG..

Answer / madhu

1Ans).DCL VAR(&A) TYPE(*DEC) VALUE(54)
2ans). DCLF FILE(LIBNAME/FILENAME) RCDFMT(SCREEN NAME)
3Ans.) In FREE FORMAT WE ARE USING MONITOR AND END-MON,THE
CODE LIKE MONITOR;
--------
ON-ERROR(FILE NAME/PGM NAME);
---------
END-MON;
AND ALSO IN RPG/400 WE ARE USING *PSSR SUBROTEN WE CAN TRAP
THE ERRORS
AND ALSO WE R USING FILE INFORMATION DATASTRCTERS, PROGRAM
STATUS DATA STRUCTERS WE CAN TRAP THE ERRORS
4Ans)in subfile we can find out varibles and varibles
lengths in subfile record format key word.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More RPG400 Interview Questions

IN RLU what are the record level keyword is used?

5 Answers   iGate, TCS,


in which journalling which attributes are necessary??/

1 Answers   CTS,


Why Rpg/400 is Famous?

2 Answers   IBM,


Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.

0 Answers  


How do I read records from Subfile? what is the purpose of READC explain with example?

4 Answers   IBM,






How to code Page up and Page down in RPG for Single page subfile without using ROLLUP/ROLLDOWN in DSPF ?

3 Answers   HCL,


there is any limit to display the members in rpg400?

3 Answers  


How can we search particular records from the database file in RPG. For example, there are 100 records in the file.i need to retrieve all the records matching/equal to the particular 'NAME' field. How can we do the above using SEARCH criteria other than using the IF cond?

4 Answers   CTS,


Assume 2 users are using the same file and first user updates some record in the file. Will the 2nd user will be able to see the updated record or not?

0 Answers  


why subproc not run in dftactgrp?????/plz explain

2 Answers   CSC,


What are the commands that can be executed in CLP but not in RPG? Why?

1 Answers   CSC,


I am reading a file in CL program. and MONMSG CPF0864 has arrived means EOF has arrived. Now i want to read this file again. How i can do this?

5 Answers   CitiGroup, Symphony,


Categories