Skip to content

Processing Overview

SYSIN is read to establish the parameters to be used in this request. All sysin keywords must start on a new line and must not extend beyond column 72. Some of the parameters have the potential to be longer than this allows for, these are SERVER, URN, and any PARMs. This potential is catered for by using an asterisk as a continuation character. All text including and after the asterisk is ignored and the next sysin card image is read. All text from the beginning of the card image (including spaces) is appended to the text already read in for this keyword. For example:

SERVER=d001.micro* 
focus.com 

is the same as

SERVER=d001.microfocus.com

Any query parameters are appended to the URN prior to issuing the HTTP request. For a METHOD=POST request, if the JSONIN DD statement is present then we build a JSON body to passed along with the POST headers.

An attempt is made to connect to the target server:port and, if successful, the relevant request is sent and we await confirmation from the server. Any response is checked for a 'good' status code (2xx) which will result in a RC=0 for the job step, else we have an RC=12. If there is a bad response then the response body (if any) is echoed out in SYSPRINT. If TRACE=YES is on then the response body is written to SYSPRINT regardless of the result. Note that a future enhancement could be to allow the user to define what is an acceptable response.

Example of JCL for GET request:

This example issues a GET request to a server with query parms. Here's some JCL for the 'activate component' event, this would be inserted as a batch job step in the build job:

//GOGOGO   EXEC PGM=CMNURIBA,REGION=0M 
//* 
//SYSPRINT  DD  SYSOUT=* 
//SYSUDUMP  DD  SYSOUT=* 
//HTPTRACE  DD  DISP=SHR,DSN=WSER58.HTTP.TRACE.OUTPUT 
//SYSIN     DD  * 
 Server=d001.microfocus.com 
 Port=8085 
 Trace=YES 
 Method=GET 
 Parm=EVENT=12 
 Parm=PACKAGE=ZSRV000123 
 Parm=APPL=ZSRV 
 Parm=LIBTYPE=JAV 
 Parm=COMPONENT=TESTSRC

The HTPTRACE dataset is a sequential file with RECFM=V,LRECL=1028,BLKSIZE=1032

The above request is converted into a connection, to http://d001.microfocus.com:8080 and the HTTP GET method is issued using this connection, targeted at the following URN:

/zmfevent/event/skel?EVENT=12&PACKAGE=ZSRV000123&APPL=ZSRV&LIBTYPE=JAV&COMPONENT=TESTSRC

Example of JCL for POST request with JSON body:

//GOGOGO   EXEC PGM=CMNURIBA,REGION=0M 
//* //SYSPRINT  DD  SYSOUT=* 
//SYSUDUMP  DD  SYSOUT=* 
//HTPTRACE  DD  DISP=SHR,DSN=WSER58.HTTP.TRACE.OUTPUT 
//JSONIN    DD  DATA,DLM=@@ 
 { 
    "EVENT": "12",
    "PACKAGE"  : "ZSRV000123",
    "APPL"     : "ZSRV",
    "LIBTYPE"  : "JAV",
    "COMPONENT": "TESTSRC" 
 } 
 @@ //SYSIN     DD  * 
  Server=d001.microfocus.com
  Port=8085
  Trace=YES
  Method=POST

...