Skip to content

Integrating bpam I/O services and ISPF ENQ and Statistics support#9

Merged
sachintu47 merged 18 commits into
mainfrom
ispf_integration
May 11, 2026
Merged

Integrating bpam I/O services and ISPF ENQ and Statistics support#9
sachintu47 merged 18 commits into
mainfrom
ispf_integration

Conversation

@IgorTodorovskiIBM
Copy link
Copy Markdown
Member

No description provided.

@IgorTodorovskiIBM IgorTodorovskiIBM marked this pull request as draft January 6, 2025 18:47
Comment thread src/libdio.c
Comment thread src/dio.c Outdated
Comment thread src/dio.c Outdated
* 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;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it be a PDS?

Comment thread src/dio.c Outdated
return dfile;
}
// check for dfile->dsorg = D_PDS;
// TODO: check for read-only
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Check if an ENQ is set and set it to read-only

Comment thread src/dio.c Outdated
printf("allocated ddname:%s\n", difile->ddname);
#endif

int use_stream_services = 1;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chagne to use_bpam_services

Comment thread src/dio.c Outdated
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);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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);

Comment thread src/dio.c Outdated
if (bh->dcb->dcbexlst.dcbrecfm & dcbrecf)
dfile->recfm = D_F;
else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecla)
dfile->recfm = D_FA;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete FA and VA.

Comment thread src/dio.c Outdated
else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecla)
dfile->recfm = D_FA;
else if (bh->dcb->dcbexlst.dcbrecfm & dcbrecu)
dfile->recfm = D_U;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete D_U and print error message

Comment thread src/dio.c Outdated
} 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;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test with V format and F format to make sure it is accurate

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider reclen to be a different name, logical_reclen

Comment thread src/dio.c Outdated

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);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add code to create a member if it doesn't exist

Comment thread src/dio.c Outdated
}

// Test for ENQ
if (ispf_enq_dataset_member(difile->dataset_name, difile->member_name, 1 /*test only*/, dfile)) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defer to the write enq checks, delete this

Comment thread src/dio.c Outdated
}

if (difile->dstate == D_READ_BINARY) {
rc = close_pds(difile->bpamhandle, NULL);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove close_pds call

Comment thread src/dio.c Outdated
return 8;
}
int err=0;
if (length_prefix) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))

@sachintu47 sachintu47 marked this pull request as ready for review May 11, 2026 13:26
@sachintu47 sachintu47 merged commit 956bd73 into main May 11, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants