z/OS Using REXX and z/OS UNIX System Services
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Conventional MVS parameter list

z/OS Using REXX and z/OS UNIX System Services
SA23-2283-00

REXX variables that are requested to be set are set in both reentrant and non-reentrant REXX environments. Variables are not set when called from non-REXX environments. In order to obtain returned information from a non-REXX environment, BPXWDYN must be called with multiple parameters in the following format.

Figure 1. Example of a conventional MVS parameter list
An example of a conventional MVS parameter list.

The parm string has the format of either halfword length followed by the parameter string or a null-terminated parameter string.

The returned variable parameters are a halfword length of the return area followed by the keyword for the value to be returned. The keyword must end with a blank or null character. Examples of keywords with return values are RTDDN, RTDSN, INRTPATH, and MSG.

Upon return, the return areas will contain a null-terminated string for the field requested if it was available and if it fits into the area. A null string is returned if the data does not fit into the parameter area. The length is set to the length of the data returned excluding the terminating null.

If a keyword value is not returned, a null string is returned.

Guideline: Because a null-terminated string is returned, in order to ensure that the data is returned, the parameter area must be large enough for the expected returned data plus the null character.

MSG is the only keyword that takes a stem. Special processing takes place for stem data. The argument that contains MSG upon return contains the number of message lines issued by SVC99 or a null string if no messages are issued. The message lines are returned in arguments passed as MSG.n where n is the line number.

Example: The following C example allocates a temporary data set and then retrieves and prints the ddname, data set name and up to four lines of messages if issued.
typedef int EXTF();
#pragma linkage(EXTF,OS)
#include <stdlib.h>
#include <stdio.h>
void main() {
EXTF *bpxwdyn=(EXTF *)fetch("BPXWDYN ");
int i,j,rc;
char *alloc="alloc new delete";
typedef struct s_rtarg {
short len;
char  str[260];
} RTARG;
RTARG ddname = {9,"rtddn"};
RTARG dsname = {45,"rtdsn"};
RTARG msg    = {3,"msg"};
RTARG m[4]   = {258,"msg.1",258,"msg.2",258,"msg.3",258,"msg.4"};
rc=bpxwdyn(alloc,&dsname,&ddname,&msg,&m[0],&m[1],&m[2],&m[3],
if (rc!=0) printf("bpxwdyn rc=%X\n",rc);
if (*ddname.str) printf("ddname=%s\n",ddname.str);
if (*dsname.str) printf("dsname=%s\n",dsname.str);
for (i=0,j=atoi(msg.str);i<j && i<4;i++)
printf("%s\n",m[i].
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014