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

what is use of sflnxtchg and use of MDT(modify data tag).both r same r not and can we use these on dspf and subfile.

2 Answers  


How to print output from openquery in as400 ?

1 Answers   Four soft,


wat is scan and check ? give me real time scenarios where we used these keywords in ur projects?

2 Answers   Four soft,


We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

0 Answers  


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

7 Answers   IBM,


As400 Command to find the Name of the Program to which a Particular Module is Bound..? Ex: IC210AMR (*MODULE) is bound with Other Modules which Forms Program Object as IC210ABP(*PGM) . As400 Command to find the IC210ABP Using IC210AMR..? Thanks

5 Answers   CTS,


What is ment by record level identifier?

0 Answers  


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

1 Answers  


what was the robotech rpg?

0 Answers   IBM,


Suppose we have 10 records with same name and we are reading using READE,after 4 record i have to use CHAIN what is the output

3 Answers  


Can someone tell me tell me what is meant by message wait...?

1 Answers  


IN RLU what are the record level keyword is used?

5 Answers   iGate, TCS,


Categories