0% found this document useful (0 votes)
39 views9 pages

Indicator Positions - : Sensitivity: Internal & Restricted

Uploaded by

tanmay.jack05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views9 pages

Indicator Positions - : Sensitivity: Internal & Restricted

Uploaded by

tanmay.jack05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

RPG

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.

2. Chain & SETLL


a. With Chain indicator applies on LO, with SETLL – EQ, READE-LO, SETGT/READP- HI
b. Chain take a lock on records but SETLL+READE doesn’t
c. Chain will find a unique record, but SETLL+READE will find all matching record otherwise set
the pointer to EOF but chain will not set the pointer anywhere.

 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

3. Reading modes of records in RPG


READ, READE, READ(E), READ(N), READP

4. Batch Debug
SBMJOB (*hold)>> STRSRVJOB> STRDBG > RELEASE JOB > F10 > DSPMODSRC > ADD BRKPOINTS
> F3 > F12 > ENTER CONTINUE > ENDDBG> ENDSRVJOB.

Sensitivity: Internal & Restricted


5. What will happen with submitted job in case of session gets lost??

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

9. Service program - *SRVPGM can be viewed as a collection of subroutines packaged together


and accessible to the outside world. You use the CRTSRVPGM command to create a
service program
CRTSRVPGM, DSPSRVPGM

10. Binding Directory

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.

14. SETLL and READE and Chain

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.

15. Commitment control

Sensitivity: Internal & Restricted


Commit operation. A commit operation makes permanent all changes made under commitment
control since the previous commit or rollback operation. The system also releases all locks
related to the transaction.
Rollback operation. A rollback operation removes all changes made since the
previous commit or rollback operation.

16. Seton LR, Return


Pointer will go to next statement after SETON LR but after RETURN pointer will not go to next
sentence and will come back to calling program(if any else exit from program).

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

20. QCMDEXC – Calling CL commands in RPG


nIt provides the user with a command line and passes the user's input to
QCMDEXC for execution

21. *entry plist


parm abc

Sensitivity: Internal & Restricted


*entry is used to pass parameter in PGM first time then onwards Plist names and parm are used.

Sensitivity: Internal & Restricted


20. Error handling in RPGLE
a. Monitor

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.

Sensitivity: Internal & Restricted


b. *PSSR – Here error was divide by zero because And B both were 0 and anything divide by 0
gives error, so a dump is written in pgm to come out from error.

c. INFSR – For file level error handling

Sensitivity: Internal & Restricted


d. INFDS (Contain info of file seen from OS perspective)
e. %Error

http://www.go4as400.com/rpgle-exception-handling/rpg-error.aspx?cid=451

21 How to increase job performance in JOBQ – by using Time slice

22 Flat file concept.- No structure


CPYTOIMPF and CPYFRMIMPF

A. To copy record from a streamed file to DDS file we can use CPYFROMIMPF and copying a
record from

CPYFRMIMPF FROM STMF('/HOME/DIR1/XXX.TXT') TOFILE(AMINEM/MASTC *FIRST)


RCDDLM(*CR) STRDLM(' ') FLDDLM('|') DECPNT(*COMMA) DATFMT(*ISO)
RPLNULLVAL(*FLDDFT)

B. DDS file to DDS file use CPYF

C. similarly copying a DDS to streamed file we can use CPYTOIMPF


CPYTOIMPF FROMFILE(AMINEM/MAST) TOSTMF('/HOME/DIR1/XXX.TXT')
RCDDLM(*CR)STRDLM(' ') FLDDLM('|')

we can select .csv as well while converting

To check streamed files use - WRKLNK '/HOME/DIR1/XXX.TXT'

Sensitivity: Internal & Restricted


23 %scan and %check

%scan will find the position of G in string and return it to variable position.

**Free

Dcl-S String Varchar(30);

Dcl-s Position Zoned(4);

String = 'RPGLE';

* %SCAN Builtin Function

* Finding the position on Character 'G' in string using %SCAN BIF

Position = %scan('G' : String);

* Displaying Position on outoput screen

Dsply Position;

* %Check Builtin Function

* Finding the position of first non occerance character using %check BIF

Sensitivity: Internal & Restricted


Position = %Check('RPG' : String);

* Displaying Position on outoput screen

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.

25. WRKSPLF opt 1


CRTOUTQ
GO to SPLF > opt > 2 change the OUTQ name to newly created OUTQ
CRTSAVF
SAVOBJ
can be downloaded to desktop via FTP or send to another box via ftp

Sensitivity: Internal & Restricted

You might also like