Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Calling RPG programs from HTML?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calling RPG programs from HTML?

    I have a web site that cuurently resides on the as/400 that uses Net.Data macros with SQL functions to access DB2 data on the 400. Is it possible to pass parameters and run RPG programs in this scenario? I was told that SQL works well for small file access, but RPG access is still the best way to get at DB2 data. I know that REXX is a supported Net.Data language environment, but I know little more about it. Can anyone enlighten me? I can think of a good example for doing this... Let's say you have a complex method of pricing products for clients. You already have an RPG program written to do this task. Instead of re-writing the pricing program in, let's say Java, can you pass client and product info to the RPG program and return the price, as a Net.Data variable, and then send this back through a browser?

  • #2
    Calling RPG programs from HTML?

    Give an example of a "Complex method"; it cannot be difficult in REXX. bobh

    Comment


    • #3
      Calling RPG programs from HTML?

      Bob, it may not be too difficult to re-write apps in REXX, I may experiment with it in the near future. what i am curious about now is whether i can run RPG pgms from my net.data/sql driven web site. i attended a seminar about one of those as/400 application development software companies that we are all hearing about (seagull, jacada, lansa, etc...) and they said that using sql to access db2 will yield bad performance when applied to large files. i dunno, i thought that if a 'native' (rpg) approach were taken, this caution would go away. can you access db2 using rexx? maybe this is an area i need to explore. .........thanks

      Comment


      • #4
        Calling RPG programs from HTML?

        Michael, The January 98 issue of MC magazine has an article by Richard Shaler - Writing Your First RPG CGI Data Entry Program. It outlines a technique in which an HTML defined form is processed by an RPG CGI program residing on the server 400. (The HTML names the RPG program as part of the tag, and the RPG program processes the form as standard input and output using the QTMHRDSTIN & QTMHWRSTOUT api's). Don't know if this is of any great use to you, but I'd like to use RPG to return data to HTML, and this is one approach I'll be looking into soon. (One idea is to set aside a frame that an RPG CGI would write, then using JavaScript to access the form values within the frame.)

        Comment


        • #5
          Calling RPG programs from HTML?

          Net.Data provides a function to call an RPG program from within the macro; the function is DTW_DIRECTCALL For more info on the function, see http://www.as400.ibm.com/products/ne...ws/newfun6.htm

          Comment


          • #6
            Calling RPG programs from HTML?

            You should be able to call the PGM using SQL like in other environments. (theory on my part) I do it in VB. You could store the result and retrieve it with a subsequent SQL stmt. Just a thought.

            Comment

            Working...
            X