Skip to content

Fix deleting member when PDS is open in ISPF#918

Draft
t1m0thyj wants to merge 7 commits intomainfrom
fix/del-pds-mem
Draft

Fix deleting member when PDS is open in ISPF#918
t1m0thyj wants to merge 7 commits intomainfrom
fix/del-pds-mem

Conversation

@t1m0thyj
Copy link
Copy Markdown
Member

@t1m0thyj t1m0thyj commented Apr 8, 2026

What It Does

Fixes #916

How to Test

  1. List data sets in ZE using SSH profile
  2. Expand a PDS to show its members
  3. Launch a 3270 session and browse the same PDS
  4. Back in ZE, verify you can delete one of its members

Review Checklist
I certify that I have:

Additional Comments

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Apr 8, 2026
@zowe-robot zowe-robot moved this from New Issues to In Progress in Zowe CLI Squad Apr 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

@t1m0thyj t1m0thyj requested a review from dkelosky April 8, 2026 03:36
Comment thread native/c/zds.cpp Outdated
}

#define NUM_DELETE_TEXT_UNITS 2
int zds_delete_member(ZDS *zds, std::string dsn, std::string member)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

one thing I wonder about if this new portion should be at the ds.cpp layer in the same way the iebcopy is at that layer. I dont see a specific hard in the current implementation, but was thinking that the zds.cpp layer would be for more programmatic APIs.

Otherwise, it feels like this makes sense. I was also surprised to see (TIL) that deleting a member via ISPF is supported while that same member is open for browse in another ISPF screen.

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.

I can move it to commands/ds.cpp if we prefer. As you said it would be consistent with invoking IEBCOPY at that layer for the zowex ds compress command.

However if I remove it from zds.cpp, then we won't be providing a function for users of our C++ libraries to delete members without exclusively allocating their parent PDS. Are we ok with this?

t1m0thyj added 2 commits April 9, 2026 21:49
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj marked this pull request as ready for review April 10, 2026 01:51
@t1m0thyj t1m0thyj requested a review from awharn April 10, 2026 01:51
@zowe-robot zowe-robot moved this from In Progress to Review/QA in Zowe CLI Squad Apr 10, 2026
[&]() -> void
{
std::string ds = _ds.back();
_create_ds(ds, "--dsorg PO --dirblk 2");
Copy link
Copy Markdown
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Going to test now but left a suggestion about building the DDs 👍

Comment thread native/c/zds.cpp Outdated
Co-authored-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj marked this pull request as draft April 10, 2026 20:34
@zowe-robot zowe-robot moved this from Review/QA to In Progress in Zowe CLI Squad Apr 10, 2026
@t1m0thyj
Copy link
Copy Markdown
Member Author

t1m0thyj commented Apr 10, 2026

This seems too permissive - it allows a member to be deleted even when its open in ISPF mode, while z/OSMF does not because the data set has an ENQ.

@dkelosky
Copy link
Copy Markdown
Collaborator

This seems too permissive - it allows a member to be deleted even when its open in ISPF mode, while z/OSMF does not because the data set has an ENQ.

Perhaps the existing behavior is more desirable anyway? That is maybe it’s good thing the delete fails, and we can give a clearer error message

@zFernand0
Copy link
Copy Markdown
Member

zFernand0 commented Apr 13, 2026

This seems too permissive - it allows a member to be deleted even when its open in ISPF mode, while z/OSMF does not because the data set has an ENQ.

Perhaps the existing behavior is more desirable anyway? That is maybe it’s good thing the delete fails, and we can give a clearer error message

I'm confused, 😕

We want to keep the behavior as-is, i.e. fail when the PDS (not the member) is open in either mode (browse, view, edit) in ISPF.
And the goal of this PR should be to provide a better error message?

@dkelosky
Copy link
Copy Markdown
Collaborator

My vote would be to provide a better error message to surface the conflict.

@t1m0thyj
Copy link
Copy Markdown
Member Author

t1m0thyj commented Apr 14, 2026

Updated the error message to be more clear, but the error handling in ZRS extension seems to hide the additionalDetails part of the message - plan to investigate this further:

[2026/04/14 15:33:26.370] [ERROR] [node:events:519] Error for response ID: 5
{"code":-1,"message":"Error: could not delete data set: 'TIMOTHY.TEST.PDS7(ABCD)' rc: '-1'","data":"  Details: Failed to allocate data set '//'TIMOTHY.TEST.PDS7(ABCD)'' for deletion (errno=91). It may be in use by another process.\n"}
image

Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Unable to delete members of PDS being browsed in ISPF

8 participants