gtpc2m1jC/C++ Language Support User's Guide

detac_ext-Detach a Working Storage Block from the ECB

This function detaches a working storage block from an entry control block (ECB) data level or data event control block (DECB). The ECB must be holding a storage block on the specified ECB data level or DECB.

Format

#include   <tpfapi.h>
void       detac_ext(enum t_lvl level, int ext);

or

#include   <tpfapi.h>
void       detac_ext(TPF_DECB *decb, int ext); 

level
One of 16 possible values representing a valid ECB data level from enumeration type t_lvl, expressed as Dx, where x represents the hexadecimal number of the ECB data level (0-F). The working storage block on this ECB data level is the block to be detached.

decb
A pointer to a DECB.

ext
Use one or more of the following choices to indicate which block is to be detached. If you code more than one term for ext, you must separate the terms with a plus sign (+).

DETAC_USER_DEFAULT
Indicates that the user is unspecified, which implies that the blocks detached from this ECB data level or DECB will be attached in a last-in-first-out (LIFO) order.

DETAC_USER_ACPDB
Indicates that the user is ACPDB, which implies that you need to save the FARW contents of the ECB data level or DECB being detached. The saved FARW contents will be used as a key to attach the block through the attac_ext function.

DETAC_CHECK
Indicates that the ECB data level or DECB being detached should be checked to ensure there is a block to be detached. If there is no block, a CTL-0D2 system error will occur. If there is a block, it will be detached.

DETAC_NOCHECK
Indicates that no check will be made to determine if there is a block to be detached. The block is detached with no check. If DETAC_NOCHECK is specified, the service routine will make the ECB data level or DECB reusable without validating that a block is held.

DETAC_DEFAULT
Indicates that the defaults are DETAC_USER_DEFAULT and DETAC_CHECK.

Normal Return

Void. The CBRW has been modified to indicate that no block is held.

Error Return

Not applicable.

Programming Considerations

Examples

The following example makes ECB data level D6 reusable by detaching the storage block from level D6. There is no check made to see if a block is held.

#include <tpfapi.h>

  ·
  ·
  ·
detac_ext(D6,DETAC_NOCHECK);

The following example saves the working storage block on the DECB referenced by the decb variable.

#include <tpfapi.h>
TPF_DECB *decb;

  ·
  ·
  ·
detac_ext(decb,DETAC_NOCHECK);

Related Information

See TPF Application Programming for more information about DECBs.