Access html file in rpgle

Asked By 0 points N/A Posted on -
qa-featured

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

SHARE
Best Answer by Larson Glenda
Answered By 0 points N/A #134731

Access html file in rpgle

qa-featured

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.

Best Answer
Best Answer
Answered By 0 points N/A #134732

Access html file in rpgle

qa-featured

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. with in the RPGsp environment, you have full power of FILE 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.

Login/Register to Answer

Related Questions