No of visitors who read this post: 228
Type: Question
No votes yet

We use html file in different purposes. How can we able to access html file in rpgle?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

#

Hi Karen,

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.

# (Solution Accepted)

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 :
<html>
<head>
<title>Application</title>
</head>

<script language="RPGLE">
    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
</script>

<body bgColor="#c6e2ff">
<p align="center">Item Maintenance</p>

<form method="post" action="<% %Trim(PgmName) %>.pgm">
<table>
    --------

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.