Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
cae9bae
basing changes off main
ATorrise Jan 16, 2026
91a0690
added files from branch move
ATorrise Jan 16, 2026
6cf3da1
changing read method of DDs
ATorrise Jan 16, 2026
2c9729e
adding replace option
ATorrise Jan 16, 2026
7f37609
working copy without iebgener and switching to file io
ATorrise Jan 16, 2026
2e0996d
proper copy with replacement
ATorrise Jan 16, 2026
e8b48b8
replacement behavior tweaks
ATorrise Jan 16, 2026
23e0d04
fix tests and data handling fixes
ATorrise Jan 20, 2026
da22f25
comment to dismiss codeql false positive
ATorrise Jan 20, 2026
ee66b21
security scans
ATorrise Jan 20, 2026
9767ece
changelog
ATorrise Jan 20, 2026
a085eb1
refactor of test code for duplication error
ATorrise Jan 20, 2026
f6543a1
data sets, source target, rtncd_sucess
ATorrise Jan 20, 2026
c0b3c70
RTNCD_SUCCESS revrsion
ATorrise Jan 20, 2026
bc7917a
duplication reduction w test helpers
ATorrise Jan 20, 2026
23f4939
wording
ATorrise Jan 20, 2026
3ae6654
Update native/c/commands/ds.cpp
ATorrise Jan 21, 2026
c00b154
removing unrelated ds.cpp edits, bettering dsexists loop
ATorrise Jan 21, 2026
4b6a067
Merge branch 'main' into copy
ATorrise Jan 22, 2026
49d999b
addressing comments. reversion of some code in ds.cpp
ATorrise Jan 22, 2026
5f426b7
Merge branch 'main' into copy
ATorrise Jan 22, 2026
b262145
addressing fernandos comments. fixing tests to include overwrite
ATorrise Jan 22, 2026
39b7c6c
switching random generation to stop hotspot issue
ATorrise Jan 22, 2026
5cf1f6d
trying to get rid of duplication!
ATorrise Jan 22, 2026
b15dda9
fixing an accidental copy paste error in conditional statement
ATorrise Jan 22, 2026
5cc7fb3
duplication
ATorrise Jan 22, 2026
ae16002
reduction of dup
ATorrise Jan 22, 2026
addc47e
moving test helpers for datasets to zutils so that ie zjd.test for ex…
ATorrise Jan 22, 2026
b9d9dc9
oneliner
ATorrise Jan 22, 2026
ee34941
quit it sonar cloud
ATorrise Jan 22, 2026
ce199d7
Merge branch 'main' into copy
ATorrise Jan 22, 2026
92228ee
rename ctx to tc avoid collision
ATorrise Jan 22, 2026
683da9b
Merge branch 'copy' of https://github.com/zowe/zowe-native-proto into…
ATorrise Jan 22, 2026
420b8be
single word modification
ATorrise Jan 22, 2026
c3f7735
fopen
ATorrise Jan 23, 2026
fb000ce
tests passing, changed record i/o and fopen
ATorrise Jan 23, 2026
788d64c
Merge branch 'main' into copy
zFernand0 Jan 26, 2026
6092fcb
file locking prevention
ATorrise Jan 27, 2026
63fd420
Merge branch 'copy' of https://github.com/zowe/zowe-native-proto into…
ATorrise Jan 27, 2026
3bfef46
removing cross type copy mentions, operations, and tests
ATorrise Jan 28, 2026
8758b70
Merge branch 'main' into copy
ATorrise Jan 28, 2026
1ddfba0
missed file upload with last commit
ATorrise Jan 28, 2026
59b51e3
test helper:
ATorrise Jan 28, 2026
9440831
moving up a helper and adding brackets in test
ATorrise Jan 28, 2026
f7d9860
.
ATorrise Jan 28, 2026
cb18b0a
.
ATorrise Jan 28, 2026
3a45540
reversion
ATorrise Jan 28, 2026
f2cfe69
bugs
ATorrise Jan 28, 2026
e115d73
snprintf
ATorrise Jan 28, 2026
fc98f2d
,
ATorrise Jan 28, 2026
60bb144
copy and compression pdse tests
ATorrise Jan 29, 2026
21f9f08
Merge branch 'main' into copy
ATorrise Jan 29, 2026
c2cf0d6
broke build w a merge change that im undoing
ATorrise Jan 29, 2026
9b5f482
Merge branch 'copy' of https://github.com/zowe/zowe-native-proto into…
ATorrise Jan 29, 2026
1a6d477
broken merge just fixed
ATorrise Jan 29, 2026
7daf2c6
possible fix
ATorrise Jan 29, 2026
35636a4
Merge branch 'main' into copy
ATorrise Jan 30, 2026
c5b91ff
modification of error for pdse and compress
ATorrise Jan 30, 2026
15da116
Merge branch 'copy' of https://github.com/zowe/zowe-native-proto into…
ATorrise Jan 30, 2026
3cddcc6
fixing test cleanup lol super sorry
ATorrise Jan 30, 2026
a56f278
using fernandos helper function ty!
ATorrise Jan 30, 2026
c80a73d
refactoring renane tests to use shared helpers if thats ok
ATorrise Jan 30, 2026
aacd86f
updating re and overwrite success messages
ATorrise Jan 30, 2026
c7f7d2e
making sure overwrite flag works for PS
ATorrise Feb 2, 2026
38f2fd3
Merge branch 'main' into copy
ATorrise Feb 2, 2026
391ae82
zutrun reversion
ATorrise Feb 4, 2026
85a151f
ty tim - track vs cylinder spacu check added + updated test to make s…
ATorrise Feb 4, 2026
294e848
addressing jace and pujal
ATorrise Feb 4, 2026
d2661e5
edits based on traes comments
ATorrise Feb 4, 2026
ef8087c
Merge branch 'main' into copy
ATorrise Feb 4, 2026
f482512
Merge branch 'main' into copy
ATorrise Feb 9, 2026
273f825
fixing test structure and cleanup
ATorrise Feb 9, 2026
fbdc1be
Merge branch 'copy' of https://github.com/zowe/zowe-native-proto into…
ATorrise Feb 9, 2026
dbc476e
comment about helper functions for copy tests
ATorrise Feb 9, 2026
7b6389d
making test expectations more flexible
ATorrise Feb 9, 2026
fc67c21
skipping cmpress tests
ATorrise Feb 9, 2026
cddbf10
compress tests
ATorrise Feb 10, 2026
5223597
fix creating target with exact attributes as source
ATorrise Feb 10, 2026
4f7dee1
order of adding attributes matters apparently
ATorrise Feb 10, 2026
80d8ab2
fail if target is RECFM=U
ATorrise Feb 10, 2026
e9dbb23
checks related to unsupported recfm u
ATorrise Feb 10, 2026
a8ef219
possibly solves build errors
ATorrise Feb 10, 2026
dca5148
build?
ATorrise Feb 10, 2026
df33a16
Merge branch 'main' into copy
ATorrise Feb 10, 2026
eba1b94
build??:
ATorrise Feb 10, 2026
5ea83b5
build???
ATorrise Feb 10, 2026
93a2e94
Merge branch 'main' into copy
ATorrise Feb 10, 2026
8e86705
realigning compress DD allocatw main
ATorrise Feb 10, 2026
77aa256
revert compress
ATorrise Feb 11, 2026
165b2cd
overwrtie->delete-target-members
ATorrise Feb 11, 2026
0a17b81
main reversion plus dsnlib
ATorrise Feb 11, 2026
8fb98eb
internal classifaction
ATorrise Feb 11, 2026
72a89a4
restoring check
ATorrise Feb 11, 2026
105bb49
Merge branch 'main' into copy
ATorrise Feb 13, 2026
b97a3c0
snprintf in 2 cases, ZDSCopyOptions
ATorrise Feb 13, 2026
f09b06e
includes for snprintf
ATorrise Feb 13, 2026
597c69e
buffer overflow
ATorrise Feb 13, 2026
c57e481
resolving merge conflict whoops
ATorrise Feb 13, 2026
23b173f
merge problems resolved
ATorrise Feb 13, 2026
2658e14
adding check to fail pds->ps operation
ATorrise Feb 18, 2026
cf37b86
Merge branch 'main' into copy
ATorrise Feb 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions native/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

## `0.2.3`

- `c`: Added `zowex ds copy` command to copy data sets and members with optional `--replace` flag (overwrites matching members) and `--delete-target-members` flag (deletes all target members before copying, making target match source exactly). Supports PDS-to-PDS, member-to-member, and sequential-to-sequential copies. Note: RECFM=U data sets are not supported. [#750](https://github.com/zowe/zowe-native-proto/pull/750)
- `c`: Added rename data set members functionality to the backend. [#765] (https://github.com/zowe/zowe-native-proto/pull/765)
- `c`: Implement `zowex job watch` command to watch spool output for a string or regex until terminating.
- `c`: Implement `zut_bpxwdyn_rtdsn` to obtain and return a system allocated data set name.
Expand Down
58 changes: 58 additions & 0 deletions native/c/commands/ds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,51 @@ int handle_data_set_compress(InvocationContext &context)
return RTNCD_SUCCESS;
}

int handle_data_set_copy(InvocationContext &context)
{
const string source = context.get<string>("source", "");
const string target = context.get<string>("target", "");

ZDS zds = {};
ZDSCopyOptions options;
options.replace = context.get<bool>("replace", false);
options.delete_target_members = context.get<bool>("delete-target-members", false);

int rc = zds_copy_dsn(&zds, source, target, &options);

if (rc != RTNCD_SUCCESS)
{
context.error_stream() << "Error: copy failed" << endl;
if (zds.diag.e_msg_len > 0)
{
context.error_stream() << " Details: " << zds.diag.e_msg << endl;
}
return RTNCD_FAILURE;
}

if (options.target_created)
{
context.output_stream() << "New data set '" << target << "' created and copied from '" << source << "'" << endl;
}
else if (options.member_created)
{
context.output_stream() << "New member '" << target << "' created and copied from '" << source << "'" << endl;
}
else if (options.delete_target_members)
{
context.output_stream() << "Target members deleted and data set '" << target << "' replaced with contents of '" << source << "'" << endl;
}
else if (options.replace)
{
context.output_stream() << "Data set '" << target << "' has been updated with contents of '" << source << "'" << endl;
}
else
{
context.output_stream() << "Data set '" << source << "' copied to '" << target << "'" << endl;
}
return RTNCD_SUCCESS;
}

void register_commands(parser::Command &root_command)
{
// Data set command group
Expand Down Expand Up @@ -997,6 +1042,19 @@ void register_commands(parser::Command &root_command)
ds_compress_cmd->set_handler(handle_data_set_compress);
data_set_cmd->add_command(ds_compress_cmd);

// Copy subcommand
auto ds_copy_cmd = command_ptr(new Command("copy", "copy data set (RECFM=U not supported)"));
ds_copy_cmd->add_positional_arg("source", "source data set to copy from", ArgType_Single, true);
ds_copy_cmd->add_positional_arg("target", "target data set to copy to", ArgType_Single, true);
ds_copy_cmd->add_keyword_arg("replace", make_aliases("--replace", "-r"),
"replace matching members in target PDS with source members (keeps non-matching target members)",
ArgType_Flag, false, ArgValue(false));
ds_copy_cmd->add_keyword_arg("delete-target-members", make_aliases("--delete-target-members", "-d"),
"delete all members from target PDS before copying (PDS-to-PDS copy only, makes target match source exactly)",
ArgType_Flag, false, ArgValue(false));
ds_copy_cmd->set_handler(handle_data_set_copy);
data_set_cmd->add_command(ds_copy_cmd);

root_command.add_command(data_set_cmd);
}
} // namespace ds
Loading
Loading