gtpc2m5tC/C++ Language Support User's Guide

relpc-Release Program from Core Lock

This function is used to unlock a file resident program from core.

Format

#include   <tpfapi.h>
int        relpc(const char *name, int unlock, int error,
                 const char *loadset);

name
A pointer to the character representation of the program name. The name is 4 alphanumeric characters that should have been allocated at system generation time. The program must be nonprivate.

unlock
This argument is an integer describing whether the program was locked with a SPECIAL request. Use the defined terms RELPC_UNLOCK to unlock a program that was not locked with a SPECIAL request or RELPC_SPECIAL to unlock a program that was locked with a SPECIAL request.

error
This argument is an integer describing whether control is returned to the caller when an error occurs or if an OPR-066 should be issued. Use the defined terms RELPC_NODUMP to denote that control should be returned to the caller, or RELPC_DUMP to denote that the service routine should issue an OPR-066. The possible errors are: invalid program name, valid program name but invalid loadset name, the program is allocated as private, or RELPC_SPECIAL was requested and the special indicator is not set.

loadset
A pointer to a valid loadset name, or BASE if referring to the base allocated program. If this parameter is used, the active program that is associated with the specified loadset is affected. If this parameter is specified as NULL, the version of the program associated with the requesting ECB is affected.

Normal Return

0

Error Return

A nonzero error return indicates that the function did not complete successfully.

Table 11. relpc Error Return

Numbers Return Code Description
#define RELPC_SNAPC_ERR 4  
#define RELPC_LS_NF 8 LOADSET VERSION NOT FOUND
#define RELPC_SP_NOTSET 16 SPECIAL LOCK NOT/ALREADY SET
#define RELPC_PRIVATE 64 PROGRAM IS A PRIVATE PROGRAM
#define RELPC_PGM_NF 128 PROGRAM NOT FOUND

Programming Considerations

Examples

The following example unlocks program QZZ5 in loadset OCTOBER from core. When QZZ5 was locked in core via getpc, a SPECIAL request was indicated. If an error occurs, the service routine issues an OPR-066.

#include <tpfapi.h>

  ·
  ·
  ·
relpc("QZZ5",RELPC_SPECIAL,RELPC_DUMP,"OCTOBER");
  ·
  ·
  ·

Related Information

getpc-Get Program and Lock in Core.