tpf_eownrc: Get or set ECB owner name
This function retrieves or sets the owner name for the entry control block (ECB) that is running.
Last updated
- Changed for PUT14 (information only; no code change).
- Changed for PUT07 (information only; no code change).
- Added for PUT00.
Format
#include <tpf/tpfapi.h>
int tpf_eownrc(enum t_eownrc func, char *owner); - func
- Specifies the requested operation:
- TPF_GET_EOWNR
- Retrieves the ECB owner name.
- TPF_SET_EOWNR
- Sets the ECB owner name.
Alternatively, you can use a program configuration file to automatically set ECB owner names.
- owner
- Specifies a pointer to a 32-character area that is used as either
an input (func==TPF_SET_EOWNR) area or an output (func==TPF_GET_OWNR)
area for an ECB owner
name. The owner name contains three parts:
- 8-byte high-level qualifier, which must be EBCDIC characters that can be printed and padded with blanks.
- 8-byte mid-level qualifier, which must be EBCDIC characters that can be printed and padded with blanks.
- 16-byte low-level qualifier, which must be padded with blanks.
Note: Characters that cannot be printed are replaced by a period (.) in any display of the ECB owner name.
Normal return
TPF_EOWNRC_OK is returned.
Error return
TPF_EOWNRC_ERROR is returned.
The reason for the error is set in errno:
- ETPF_EOWNRC_OWNER_ERR
- A pointer to an owner name was specified as a null pointer.
- ETPF_EOWNRC_FUNC_ERR
- An incorrect function was requested; TPF_GET_EOWNR and TPF_SET_EOWNR are the only valid functions.
Programming considerations
- If the OWNER parameter contains an address that is not an addressable storage area, the z/TPF system issues a system error and the ECB is exited.
- ECB owner names are case sensitive and IBM® reserves all owner names that begin with uppercase or lowercase I (I or i).
Examples
The following example sets an ECB owner name.
#include <tpf/tpfapi.h>
void main(void)
{
int rc;
char ownername[32];
char *ownerhi="USERUTIL";
char *ownermid="TAPEDRVR";
char *ownerlow="MAINROUTINE00002";
memcpy(ownername,ownerhi,8);
memcpy(ownername+8,ownermid,8);
memcpy(ownername+16,ownerlow,16);
rc = tpf_eownrc(TPF_SET_EOWNR, ownername);
if ( rc!=TPF_EOWNRC_OK) {
printf("Error setting ECB owner name,rc = %d\n ",rc);
}
}