Problem solve Get help with specific problems with your technologies, process and projects.

The fastpath to using Net.Data's Direct Call

The fastpath to using Net.Data's Direct Call
By Roger Pence

Net.Data offers the ability, through its Direct Call function, to call OS/400 program objects from a Net.Data script. This call can send and receive parameters. Here is the fastpath for making Net.Data's Direct Call work for you. See for more on Net.Data and the Net.Data Direct Call.

This tip assumes you're using a library named CGIBIN for your HTTP CGI-BIN library and that Net.Data macros are stored in a folder named NETDATA immediately off the root of the IFS. It also assumes you've already copied the DB2WWW program object (per Net.Data instructions) into the CGIBIN library.

  1. Net.Data's Direct Call function is quite PTF sensitive. Check the Web at for the latest Net.Data PTFs.

  2. Ensure a MAP directive exists in your HTTP configuration to allow an unqualified reference to Net.Data program DB2WWW (as shown below):


  3. Ensure a MACRO_PATH environment variable exists in your Net.Data INI configuration file (as shown below):


  4. Create a test ILE program to call with the source code shown below.
    * Output parameter    OutVal        S             15A                                                                             *Entry     PLIST                                             PARM                    OutVal                    Eval      OutVal = 'Hello, world'                 Eval      *INLR = *ON                             Return 


  5. Create the following Net.Data as a text file with NotePad (or some other pure ASCII text editor) and name it SIMPLECALL.ND. Using the Operations Navigator, copy this text file into the NETDATA IFS folder.

       %function(DTW_DIRECTCALL)       CallRPG( OUT CHAR( 15 )  OutVal ) {       %exec{/qsys.lib/cgibin.lib/simplecall.PGM       %}    %}    %HTML(DoCall) {     @CallRPG( a )     $(a)   %} 

  6. Call the macro with the following URL (where is your AS/400's IP address):
    "Hello, World" should display on your browser.

    If you get a message saying "the DTW_DIRECTCALL language environment not available" your AS/400 needs to be updated with the latest Net.Data PTFs. For more on Net.Data, see the September 6th, 1999 issue of Roger Pence's AS/400 Letter. (

Dig Deeper on iSeries skills

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.