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

i want to retrieve record b/w 2 dates in as400

2 Answers   L&T,


we are sending data of physical file to screen design and it is showing no record why?

1 Answers   NTT Data,


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

7 Answers   IBM,


what is the difference between do while and do until?

0 Answers   IBM,


what is plat file?

6 Answers   Indian Infotech,


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

2 Answers  


How to change the name of physical members Dynamically?

1 Answers  


How do I link an existing logical file to it's Physical File without recompiling?

2 Answers  


How to create a key field for a logical file inside RPG?

4 Answers   HSBC,


check existence of one record without using chain or read?

1 Answers   IBM,


1.I Have a physical file , i want to read the data from the each and every member of the File in the CL Program.How do you achieve this. 2.How do you do the same in RPG?. do think is it possible to read data from all the members in the RPG?

2 Answers   Cap Gemini,


Need a sql query: retrieve all duplicate records in table?

1 Answers  


Categories