We use html file in different purposes. How can we able to access html file in rpgle?
Yes, CGIDEV2 or eRPG SDK can do it using templates.
eRPG SDK is a software development kit that allows easy creation of dynamic web applications using only RPG! IT allows programmers to easily create fully functional scalable web application solutions without requiring learning Java or any other proprietary language.
For this to implement, we have to use RPG script embedded between <script> and </script> tags, it allows to execute the RPG code as HTML document being loaded into browser. You can declare files/fields, execute the operations, create and call subprocedures, etc. withing the RPGsp environment, you have full power of ILE RPG. Here with giving you an example code :
FITM001P IF E K DISK
D Task S 10
D RecsPerPage S 5 0 Inz(30)
D RecsToReadBk S 5 0
D RecordCount S 5 0
D RowColor S 7
D RowColor1 S 7 Inz('#FOFOFF')
D RowColor2 S 7 Inz('#FFFFFF')
C FileKey KList
C KFid ITMNR
C Eval RecsToReadBk=RecsPerPage+1
<p align="center">Item Maintenance</p>
<form method="post" action="<% %Trim(PgmName) %>.pgm">
This RPG code will be highlighted in different background color than the HTML code, this makes it easy to differentiate RPG from HTML.
So, this is the way how you can embed HTML with in RPG.