Skip to Content

How to get information about the end user in a WebClient connection.

Estimated Reading Time: 1 Minutes

When you run your application in a WebClient environment, the Application Server has very little information about the user at the other end of the browser. As far as it knows, the WebClient server is the client.

However, you can have the WebClient send information about the end user and the end user's computer by passing some pre-defined arguments to your program after the program name in the "Program name and arguments" field.

The three variables that return information about the client are;

  1. ${clientId}, which returns information including a unique browser identifier, so you can tell if the user has started a second instance of the program a different browser,
  2. ${clientIp}, the IP address of the browser that started the application,
  3. ${clientLocale}, returning the country location.
If you wanted to use each of these variables with a program called "WC_CLIENT_VAR", you would enter the following in the 'Program name and arguments' field:

Your program will chain these values and catch them in the linkage section like this:

   PROCEDURE DIVISION chaining clientId 
                               clientIp
                               clientLocale
                               . 
The client information passed in "clientID" is a string of four values, delimited by "_"; The webapp name, the user name, a browser ID, and the time in milliseconds.
You'll need to unstring it into 4 fields.
   unstring clientId delimited by "_"
                     into app
                          user
                          browserId
                          currentTimeMillis.
You can use the attached program as a reference to get the information you need from the WebClient's user. Here's a sample output for the program:

There are many other variables you can pass to your program, including every operating system variable (ex: ${path}), two WebClient-specific variables, and your own custom variables.
These arguments are listed in the WebClient documentation.

How to get information about the end user in a WebClient connection.
  • Attached Files
  • wc_client_var.cbl (4.66 KB) 36