Indicator Positions - : Sensitivity: Internal & Restricted
Indicator Positions - : Sensitivity: Internal & Restricted
1. MSGW
a. Level check error (commands to find error DSPFD, DSPPGMREF)
b. Decimal Data Error (Non numeric data in numeric field, wrkjob opt 14 – file details )
c. Attempt to write duplicate records (Check file to see duplicate, delete and G, what will happen
if all records process again, will they create duplicate)
d. Session or device error (No records to show in SFL but SFLDSP indicator is on or there is more
than 9999 records to display in load all or expandable sub file)
e. Signature Violation Error (Some change in Service program, and main program not compiled)
f. Records lock (unable to allocate records), we can use SNDBRKMSG
g. Pointer or parameter error – called PGM without parameters
h. Array out of index – The Array Index Out Of Bounds exception is thrown if a program tries to
access an array index that is negative, greater than, or equal to the length of the array. The
Array Index out Of Bounds exception is a run-time exception. While the best way to avoid this
exception is to always remain within the bounds of an array.
For sequential file we can use RRN value only. In this case EQ indicator will be *on.
To handle SETLL exceptions (file status codes greater than 1000), either the operation code
extender 'E' or an error indicator at LO level can be used.
The Equal Indicator gets turned-on if and exact match is found. We can use this in place of
%equal ().
If Greater value match is found then HI level indicator will get turned on. We can use this in
place of %found ().
Indicator positions -
Chain – LO , Read/READE -EQ, SETGT/READP -HI
4. Batch Debug
SBMJOB (*hold)>> STRSRVJOB> STRDBG > RELEASE JOB > F10 > DSPMODSRC > ADD BRKPOINTS
> F3 > F12 > ENTER CONTINUE > ENDDBG> ENDSRVJOB.
6. Find no. of records of PF /member name and other details inside RPG PGM.(INFDS)
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c092508378.ht
m
7. Embedded SQL - It’s a way of embedding the SQL statements in our RPG source code.
8. Cursor - A cursor is a temporary result set area created in the system memory when an
embedded SQL statement is executed.
serial and Scroll cursor
11. Procedures (also known as sub procedures) are the smallest component of static binding.
Activation group - Activation group is a resource container within a job where the container holds
a bunch of activations.
Activation is a reference to the storage allocation and runtime program binding activities that the
operating systems perform when a program executes.
12. Stored procedure – A PGM or SQL PGM created to perform a specific operation.
13. Very imp – If a file is keyed and after reading in RPG it gives error – “file is not keyed” then
reason is file is edited later and the format level identifier got changed. So solution is recompile
RPG again.
Chain will read the same record every time in a loop but SETLLL and readE read and move the
pointer to next level.
Chain is good to read a unique record only.
IF reading a file in loop we can use simple READ.
17. Indicators – how to use indicators in rpg when it is on and when off
18. INZSR – Whenever pgm exits with SETON LR, the next time INZSR will be called and Data area,
KLISTS will be initialized.
It executes only at the first call of your program.
19. CPYF – Record format mapping (*Map/*Drop or *Nochk) to copy records from one DB file to
another
here array of 5 length was declared but in pgm i=10 is given, so on error pgm will go in “ON ERROR
section where we can display any kind of error message to screen.
http://www.go4as400.com/rpgle-exception-handling/rpg-error.aspx?cid=451
A. To copy record from a streamed file to DDS file we can use CPYFROMIMPF and copying a
record from
%scan will find the position of G in string and return it to variable position.
**Free
String = 'RPGLE';
Dsply Position;
* Finding the position of first non occerance character using %check BIF
Dsply Position;
*INLR = *ON;
**endfree
24. If chain reads below data then where the pointer does goes – it will stick to 1st rec only
EMP ID Name
101 Abhishek
101 Sukhmeet
102 Anju
it will read 1st record again and again and will not got to next record.