Tip

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.