Integrating bpam I/O services and ISPF ENQ and Statistics support#9
Conversation
| * open the dataset twice (once to get the dataset characteristics and once to read or write) | ||
| * but this is 'good enough' for now since the C I/O services don't let us do better | ||
| */ | ||
| dfile->dsorg = D_PDSE; |
There was a problem hiding this comment.
Could it be a PDS?
| return dfile; | ||
| } | ||
| // check for dfile->dsorg = D_PDS; | ||
| // TODO: check for read-only |
There was a problem hiding this comment.
TODO: Check if an ENQ is set and set it to read-only
| printf("allocated ddname:%s\n", difile->ddname); | ||
| #endif | ||
|
|
||
| int use_stream_services = 1; |
There was a problem hiding this comment.
chagne to use_bpam_services
| if (info.__dsorgPS) { | ||
| dfile->dsorg = D_SEQ; | ||
| } else { | ||
| errmsg(dfile, "Dataset %s is not PDS, PDSE, or SEQ organization. open_dataset not supported at this time.", dataset_name_copy); |
There was a problem hiding this comment.
| errmsg(dfile, "Dataset %s is not PDS, PDSE, or SEQ organization. open_dataset not supported at this time.", dataset_name_copy); | |
| errmsg(dfile, "Dataset %s is not SEQ organization. open_dataset not supported at this time.", dataset_name_copy); |
| if (bh->dcb->dcbexlst.dcbrecfm & dcbrecf) | ||
| dfile->recfm = D_F; | ||
| else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecla) | ||
| dfile->recfm = D_FA; |
There was a problem hiding this comment.
Delete FA and VA.
| else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecla) | ||
| dfile->recfm = D_FA; | ||
| else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecu) | ||
| dfile->recfm = D_U; |
There was a problem hiding this comment.
Delete D_U and print error message
| } else { | ||
| errmsg(dfile, "Unable to obtain dataset %s for READ.", dataset_name_copy); | ||
| dfile->err = DIOERR_FOPEN_FOR_READ_FAILED; | ||
| dfile->reclen = bh->dcb->dcblrecl; |
There was a problem hiding this comment.
Test with V format and F format to make sure it is accurate
There was a problem hiding this comment.
Consider reclen to be a different name, logical_reclen
|
|
||
| rc = find_member(difile->bpamhandle, difile->member_name); | ||
| if (rc) { | ||
| errmsg(dfile, "Unable to find %s(%s) for read. rc:%d\n", difile->dataset_name, difile->member_name, rc); |
There was a problem hiding this comment.
TODO: add code to create a member if it doesn't exist
| } | ||
|
|
||
| // Test for ENQ | ||
| if (ispf_enq_dataset_member(difile->dataset_name, difile->member_name, 1 /*test only*/, dfile)) { |
There was a problem hiding this comment.
Defer to the write enq checks, delete this
| } | ||
|
|
||
| if (difile->dstate == D_READ_BINARY) { | ||
| rc = close_pds(difile->bpamhandle, NULL); |
There was a problem hiding this comment.
Remove close_pds call
| return 8; | ||
| } | ||
| int err=0; | ||
| if (length_prefix) { |
There was a problem hiding this comment.
Use code from f2m.c (static int write_member(FM_BPAMHandle* bh, const char* dataset, const char* filename, const char* member, const FM_Opts* opts))
cfa6c72 to
679d937
Compare
fix trailing space stripping for different encodings
No description provided.