Skip to content

Commit

Permalink
Merge pull request #603 from zowe/bugfix/v2/symbol-for-volser
Browse files Browse the repository at this point in the history
Adding symbol resolution for volser during obtaindscb1
  • Loading branch information
1000TurquoisePogs authored Jul 10, 2023
2 parents ceaf109 + 35ff53d commit ba7a6ed
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ All notable changes to the ZSS package will be documented in this file.
## Recent Changes

## `2.10.0`
- Bugfix: Preventing error code 0C9-09 caused by a block size of zero
- Bugfix: Datasets with VOLSER set to an MVS Symbol would cause dataset read, write, and metadata API calls to fail for those datasets. (#603)
- Bugfix: Preventing error code 0C9-09 caused by a block size of zero (#606)

## `2.9.0`
- Bugfix: expose the version of the ZIS dynamic linkage base plugin so it can be updated during a build
Expand Down
21 changes: 18 additions & 3 deletions c/datasetjson.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ static int getLreclOrRespondError(HttpResponse *response, const DatasetName *dsn
int handledThroughDSCB = FALSE;

if (!volserSuccess){

char dscb[INDEXED_DSCB] = {0};
int rc = obtainDSCB1(dsn->value, sizeof(dsn->value),
volser.value, sizeof(volser.value),
Expand Down Expand Up @@ -714,6 +714,21 @@ static int obtainDSCB1(const char *dsname, unsigned int dsnameLength,
#define SVC27_OPTION_HIDE_NAME 0x10
#define SVC27_OPTION_EADSCB_OK 0x08

char resolvedVolser[VOLSER_SIZE+1] = {0};

if (volser[0] == '&'){
int rc = 0;
int rsn = 0;
char *result = resolveSymbol(volser, &rc, &rsn);
if (result != NULL && rc == 0){
snprintf(resolvedVolser, VOLSER_SIZE+1, "%s", result);
safeFree(result, strlen(result));
} else if (rc) {
zowelog(NULL, LOG_COMP_RESTDATASET, ZOWE_LOG_WARNING, "symbol lookup error rc=0x%x rsn=0x%x\n", rc, rsn);
return rc;
}
}

ALLOC_STRUCT31(
STRUCT31_NAME(mem31),
STRUCT31_FIELDS(
Expand All @@ -734,7 +749,7 @@ static int obtainDSCB1(const char *dsname, unsigned int dsnameLength,
memset(mem31->dsnameSpacePadded, ' ', sizeof(mem31->dsnameSpacePadded));
memcpy(mem31->dsnameSpacePadded, dsname, dsnameLength);
memset(mem31->volserSpacePadded, ' ', sizeof(mem31->volserSpacePadded));
memcpy(mem31->volserSpacePadded, volser, volserLength);
memcpy(mem31->volserSpacePadded, volser[0] == '&' ? resolvedVolser: volser, volserLength);

memset(mem31->workArea, 0, sizeof(mem31->workArea));

Expand Down Expand Up @@ -1060,7 +1075,7 @@ static void updateDatasetWithJSONInternal(HttpResponse* response,

int volserSuccess = getVolserForDataset(dsn, &volser);
if (!volserSuccess){

char dscb[INDEXED_DSCB] = {0};
int rc = obtainDSCB1(dsn->value, sizeof(dsn->value),
volser.value, sizeof(volser.value),
Expand Down

0 comments on commit ba7a6ed

Please sign in to comment.