selec–Select a thread application interface

This function is used to obtain an RCPL or session partner name.

Format

#include   <tpf/tpfapi.h>
union selec_return *selec(int req_type, union selec_arg *s_req);
req_type
Code the defined terms SELEC_NAME if a network qualified name (NQN) is to be used as a search argument, or SELEC_RCPL if an RCPL is to be used as a search argument.
s_req
Pointer to union of type selec_arg, which may contain either a structure of type name_type or rcpl_type containing the NQN or RCPL. This union is defined in tpfapi.h.

Normal return

Pointer to union of type selec_return, which may contain either a structure of type selec_ret_name or selec_ret_RCPL containing the requested information. This union is defined in tpfapi.h.

Error return

The selrtncd field in selec_return is used to return errors discovered in the selec_arg parameters. The following codes are defined:
4
Invalid name; bad return from the INQRC macro
8
Invalid request
  • SLU not in session with PLU
  • Not a PLU/SLU combination.
12
Database error; bad return from RIDCC macro
16
SLU not bound, or not in session
20
Invalid request
  • Origin/destination. Not cross-domain environment.
  • Origin/destination. Not an LU.
32
SLU not active
36
Discrepancy between input qualifier and input SLU
40
Qualifier invalid; does not point to SLU.

Programming considerations

If req_type is not SELEC_NAME or SELEC_RCPL, a system error with exit results.

Examples

The following example calls selec to obtain the RCPL for the network qualified name at EBW032. A check is performed for certain errors.
#include <tpf/tpfapi.h>
union  selec_arg    *reqptr;
union  selec_return *retptr;
⋮
reqptr = (union selec_arg *) &(ecbptr()->ebw032); /* storage for selec_arg */

strncpy(&(reqptr->name_type.selorg), "TPFDATA  ", 8); /* fill in blanks for */
strncpy(&(reqptr->name_type.selnetid), "MVS1    ", 8); /* length of 8      */
strncpy(&(reqptr->name_type.selnode), "DB2     ", 8);
retptr = selec(SELEC_NAME, reqptr);

switch (retptr->selec_ret_name.selrtncd)
      {
        case 04: serrc_op(SERRC_EXIT, 0x999004, "Invalid Name", NULL);
        case 32: serrc_op(SERRC_EXIT, 0x999020, "SLU not active", NULL);
      }

Related information

inqrc–Convert resource application interface.

See z/TPF C functions overview for more information about z/TPF C/C++ language support.