OpenTP1 Version 7 Programming Reference C Language
dc_dam_status - Reference the status of a logical file
Format
ANSI C, C++
#include <dcdam.h> int dc_dam_status (char *lfname, struct DC_DAMSTAT *stbuf, int reserve, DCLONG flags) |
K&R C
#include <dcdam.h> int dc_dam_status (lfname, stbuf, reserve, flags) char *fname; struct DC_DAMSTAT *stbuf; int reserve; DCLONG flags; |
Description
The function dc_dam_status() returns the current logical file status to structure DC_DAMSTAT. The following values are returned:
The function dc_dam_status() can be called before and after a logical file is opened with the function dc_dam_open().
When referencing the status of a logical file, specify the logical file name.
Arguments whose values are set in the UAP
lfname
Specify a logical file name within eight bytes.
stbuf
Specify the address of a structure DC_DAMSTAT that receives the logical file status. The logical file status set in the function dc_dam_status() is returned in the structure.
phyfilno
Area used by the DAM service. Specify null character (0).
flags
Specify DCNOFLAGS.
Argument whose value is returned from OpenTP1
stbuf
The logical file status data is returned in the format of structure DC_DAMSTAT as follows:
struct DC_DAMSTAT { int st_block_len; int st_block_num; char st_file_ph_name[64]; char st_file_stat; char st_file_def; char st_file_sec; char st_filler_1; char st_file_inf; }; |
Return values
Return value | Return value (numeric) | Explanation |
---|---|---|
DC_OK | 0 | The logical file status is set normally in the structure DC_DAMSTAT. |
DCDAMER_PROTO | -1600 | The function dc_rpc_open() is not called. |
N is specified for atomic_update in the user service definition. (This value is returned only when a recoverable DAM file is accessed.) | ||
The function dc_dam_start() is not called. (This value is returned only when an unrecoverable DAM file is accessed.) | ||
DCDAMER_UNDEF | -1601 | The logical file name specified for lfname is undefined. |
DCDAMER_NOMEM | -1607 | The memory became insufficient. |
DCDAMER_PARAM_LFNAME | -1610 | The logical file name specified for lfname is invalid. |
DCDAMER_PARAM_FLAGS | -1611 | The value specified for flags is invalid. |
DCDAMER_PARAM_ERROR | -1612 | The value specified for the argument is invalid. |
The value specified for stbuf is invalid. | ||
No null character is set for reserve. | ||
DCDAMER_VERSION | -1618 | The UAP is linked with a DAM library which is inoperable with the current DAM service. |
DCDAMER_ACCESS | -1628 | A DAM file whose status is to be referenced is protected with the security facility. The UAP that called the function dc_dam_status() has no access permission. |
DCDAMER_NO_ACL | -1646 | A DAM file whose status is to be referenced is protected with the security facility. There is no ACL for the corresponding file. |
Note
When the function dc_dam_status() is called, the DAM service does lock control to get data. So if the function dc_dam_status() is used too often, the throughput may be degraded because of the lock release wait time. Therefore, reference the DAM file status as little as possible while online.
All Rights Reserved. Copyright (C) 2006, 2010, Hitachi, Ltd.