Solved

Write Web Page data from AS400 program

Posted on 2006-10-22
6
276 Views
Last Modified: 2012-08-14
I have an application that is set to write AS400 data to a web page.  From the browser address line, I connect via IP address to the AS400 and run my AS400 program (written in RPG ILE) directly from the address line.  The program runs and writes the data directly to a web page via CGI script using the "gethtmlifs" command, then displays the web page.  I write sections at a time to the web page using the "WrtSection" command.  The entire process runs almost instantly.  

Here's the problem:  I need to loop this program to refresh the data.  I have the loop set to 10 seconds in the CL that calls the program.  The CL is the program I run from the address line.  When I do, the browser window just appends to the bottom.  The screen gets longer and longer and the user has to scroll down to see the data.  That will not do.  I want the loop in my program to refresh the screen with the new values of my data and the user oes not have to touch anything.  Essentially, it is displaying production on an assembly line.   As units are produced, the counter on the web page will show that by incrementing.   As the program loops, the screen should refresh with curent data.

Does anyone know how to refresh the page or tell it to rebuild the page from the top?  This is needed urgently so points are available.

0
Comment
Question by:tperegoy
  • 2
6 Comments
 
LVL 14

Expert Comment

by:daveslater
ID: 17787300
Hi
have you issued the
 callp     wrtsection('*fini')
to clear the buffer?

Dave
0
 

Author Comment

by:tperegoy
ID: 17787578
Yes, but that is in my last write command to output the screen.  The last section is named $endform so I "WrtSection $endform *fini"  
0
 
LVL 14

Accepted Solution

by:
daveslater earned 250 total points
ID: 17787590
Hi
have a look at this?it might help

http://www-922.ibm.com/cgidev2o/faq15.htm?ts=ts20061023104654

control the refresh from the browser not the cl

Dave
0
 
LVL 33

Assisted Solution

by:shalomc
shalomc earned 250 total points
ID: 17812187
Simply add this to your html inside the <head> section:

<meta http-equiv="refresh" content="10">

Another way is by the xmlhttp javascript method - the AJAX way.

<script>
function GetFromRPG(txtFile) {
       var RPGURL = "http://yourserver/" + escape(txtFile) ;
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    xmlhttp.Open('GET', RPGURL , false);
    xmlhttp.Send();
    document.write(xmlhttp.responseText);
    return xmlhttp.responseXML;
}

</script>

ShalomC
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now