Because any I/O function calls, such as printf(), can change the value of __amrc or __amrc2, make sure you save the contents into temporary structures of __amrc_type and __amrc2_type respectively, before dumping them.
Figure 1 shows the structure as it appears in stdio.h.
typedef struct __amrctype {
[1] union {
[2] int __error;
struct {
unsigned short __syscode,
__rc;
[3] } __abend;
struct {
unsigned char __fdbk_fill,
__rc,
__ftncd,
__fdbk;
[4] } __feedback;
struct {
unsigned short __svc99_info,
__svc99_error;
[5] } __alloc;
[1] } __code;
[6] unsigned int __RBA;
[7] unsigned int __last_op;
struct {
unsigned int __len_fill; /* __len + 4 */
unsigned int __len;
char __str[120];
unsigned int __parmr0;
unsigned int __parmr1;
unsigned int __fill2[2];
char __str2[64];
[8] } __msg;
#if __EDC_TARGET >= 0x22080000
[9] unsigned char __rplfdbwd[4]; /* rpl feedback word */
#endif /* __EDC_TARGET >= 0x22080000 */
#if __EDC_TARGET >= 0x41080000
[10] #ifdef __LP64
unsigned long __XRBA; /* 8 byte RBA */
#elif defined(__LL)
unsigned long long __XRBA; /* 8 byte RBA */
#else
unsigned int __XRBA1;/* high half of 8 byte RBA */
unsigned int __XRBA2;/* low half of 8 byte RBA */
#endif
/* QSAM to BSAM switch reason */
[11] unsigned char __amrc_noseek_to_seek;
/* padding to make amrc 256 bytes */
char __amrc_pad[23];
} __amrc_type;
Figure 2 shows the __amrc2 structure as it appears in stdio.h.
struct {
[12] int __error2;
char __pad__error2[4];
[13] FILE *__fileptr;
[14] int __reserved{6};
}
Macro | Definition |
---|---|
__AM_BSAM_NOSWITCH | No switch was made. |
__AM_BSAM_UPDATE | The data set is open for update |
__AM_BSAM_BSAMWRITE | The data set is already open for write (or update) in the same C process. |
__AM_BSAM_FBS_APPEND | The data set is recfm=FBS and open for append |
__AM_BSAM_LRECLX | The data set is recfm=LRECLX (used for VBS data sets where records span the largest blocksize allowed on the device) |
__AM_BSAM_PARTITIONED_DIRECTORY | The data set is the directory for a regular or extended partitioned data set |
__AM_BSAM_PARTITIONED_INDIRECT | The data set is a member of a partitioned data set, and the member name was not specified at allocation |