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 www.as400.ibm.com/netdata 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 http://www.as400.ibm.com/tstudio/netdata/services/service.htm 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):

      map /DB2WWW/* /QSYS.LIB/CGIBIN.LIB/DB2WWW.PGM/*

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

      MACRO_PATH=/netdata

  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 

    Create the program object with CRTBNDRPG PGM(CLCFILES/SIMPLECALL) + SRCFILE(CLCFILES/SOURCE)

  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 xxx.xxx.xxx.xxx is your AS/400's IP address):

      http://xxx.xxx.xxx.xxx/DB2WWW/simplecall.nd/docall
    "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. (http://www.the400group.com/as400letter).


This was first published in September 1999

Dig deeper on iSeries skills

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchEnterpriseLinux

SearchDataCenter

Close