IBM Window 服务 (DWS) DSNAME 长度的 CSRIDAC 无效
IBM Window Services (DWS) CSRIDAC with DSNAME length not valid
我正在研究 z/OS 并尝试使用 IBM 提供的 Window 服务。
除了通过其 DSNAME 创建对象外,一切都完美无缺。
当我使用 DSNAME 调用 CSRIDAC 时出现错误:
“系统无法分配或取消分配
指定为 object_name 的数据集。值 rrrr 是 return 代码
从动态分配。值 nnnn 是两个字节的原因
来自动态分配的代码。请参阅 z/OS MVS 编程:
动态分配的授权汇编程序服务指南 return
和原因代码。"
所以我搜索了原因代码 037c 的含义,发现:"Invalid LEN specified in text unit. The accompanying message IKJ56231I indicates the number of the text unit in error."
因此,Window 服务似乎正在调用动态分配服务以通过其 DSNAME 创建对象,但在计算我提供的 DSNAME 中的字符数时出错。
我的 DSNAME 是一个有效的 VSAM 文件名,我使用相同的 DSNAME 通过另一种方式成功读取了这个数据集。
嗯,这是我的函数调用 CSRIDAC 函数的代码:
ozwinsrvObject *ozwinsrvObjectCreate(uint32_t uiFlags, int32_t iObjectSize, uint8_t *pcObjectName, int32_t *piHighOffset, int32_t *piRc)
{
ozwinsrvObject *pobject = __malloc31(sizeof(ozwinsrvObject));
*piRc = OZWINSRV_NO_ERROR;
pobject->pheap = __malloc31(18*4);
pobject->pparmList = __malloc31(11 * sizeof(int32_t));
memcpy(&pobject->parmObject.acOpType[0] , "BEGIN", 5);
pobject->parmObject.iObjectSize = iObjectSize;
pobject->parmObject.iHighOffset = *piHighOffset;
if(uiFlags & OZWINSRV_OBJECT_F_TYPE_DDNAME)
{
memcpy(&pobject->parmObject.acObjectType[0], "DDNAME ", 9);
}
else {
if(uiFlags & OZWINSRV_OBJECT_F_TYPE_DSNAME)
{
memcpy(&pobject->parmObject.acObjectType[0], "DSNAME ", 9);
}
else
{
memcpy(&pobject->parmObject.acObjectType[0], "TEMPSPACE", 9);
}
}
if(uiFlags & OZWINSRV_OBJECT_F_SCROLL_AREA_YES)
{
memcpy(&pobject->parmObject.acScrollArea[0], "YES", 3);
}
else
{
memcpy(&pobject->parmObject.acScrollArea[0], "NO ", 3);
}
if(uiFlags & OZWINSRV_OBJECT_F_STATE_NEW)
{
memcpy(&pobject->parmObject.acObjectState[0], "NEW", 3);
}
else
{
memcpy(&pobject->parmObject.acObjectState[0], "OLD", 3);
}
if(uiFlags & OZWINSRV_OBJECT_F_ACCESS_MODE_UPDATE)
{
memcpy(&pobject->parmObject.acAccessMode[0], "UPDATE", 6);
}
else
{
memcpy(&pobject->parmObject.acAccessMode[0], "READ ", 6);
}
memcpy(&pobject->acObjectName[0], pcObjectName, strlen(pcObjectName));
if(strlen(pcObjectName) < 45)
{
pobject->acObjectName[strlen(pcObjectName)] = ' ';
}
memset(pobject->pparmList, 0, 11 * sizeof(int32_t));
pobject->pparmList[0] = (int32_t) &pobject->parmObject.acOpType[0];
pobject->pparmList[1] = (int32_t) &pobject->parmObject.acObjectType[0];
pobject->pparmList[2] = (int32_t) &pobject->parmObject.acObjectName[0];
pobject->pparmList[3] = (int32_t) &pobject->parmObject.acScrollArea[0];
pobject->pparmList[4] = (int32_t) &pobject->parmObject.acObjectState[0];
pobject->pparmList[5] = (int32_t) &pobject->parmObject.acAccessMode[0];
pobject->pparmList[6] = (int32_t) &pobject->parmObject.iObjectSize;
pobject->pparmList[7] = (int32_t) &pobject->acObjectId[0];
pobject->pparmList[8] = (int32_t) &pobject->parmObject.iHighOffset;
pobject->pparmList[9] = (int32_t) &pobject->parmObject.iRc;
pobject->pparmList[10] = (int32_t) &pobject->parmObject.iReasonC;
x6csridac(pobject->pparmList, pobject->pheap);
if(pobject->parmObject.iRc != 0)
{
printf("Error creating object (csridac) Rc=0x%x, ReasonC=0x%x\n", pobject->parmObject.iRc, pobject->parmObject.iReasonC);
*piRc = OZWINSRV_ERROR_WINDOW_OBJECT_CREATE;
}
*piHighOffset = pobject->parmObject.iHighOffset;
pobject->iObjectSize = iObjectSize;
pobject->uiFlags = uiFlags;
pobject->uiNbViews = 0;
return pobject;
}
那么,这里是调用这个函数的代码:
int32_t iRc = 0;
int32_t iPageSize = 32*1024;
int32_t iPageOffset = iPageSize/4/1024;
int32_t iSize = 1;
int32_t iRealSize = 1;
ozwinsrvObject *pObject;
ozwinsrvWindow *pWindow;
uint8_t acFileName[] = "DSNB10.DSNDBC.DBTLS00.TS1449.I0001.A001";
pObject = ozwinsrvObjectCreate(OZWINSRV_OBJECT_F_ACCESS_MODE_READ | OZWINSRV_OBJECT_F_SCROLL_AREA_NO | OZWINSRV_OBJECT_F_STATE_OLD | OZWINSRV_OBJECT_F_TYPE_DSNAME,
iSize, &acFileName[0], &iRealSize, &iRc);
我希望我对问题的解释是清楚的。如果不是,请随时提出一些问题。
谢谢!
我发现了我的错误并发布了答案。
我使用以下行将名称复制到数组中:
memcpy(&pobject->acObjectName[0], pcObjectName, strlen(pcObjectName));
但是!当我把这个数组放在我的参数列表中时,我使用了这行代码:
pobject->pparmList[2] = (int32_t) &pobject->parmObject.acObjectName[0];
这意味着名称在pobject->acObjectName中,我在参数中放了pobject->parmObject.acObjectName列表。这两个数组不是同一个变量...
对于我的错误,我深表歉意,并确认 DWS 工作正常。
我正在研究 z/OS 并尝试使用 IBM 提供的 Window 服务。 除了通过其 DSNAME 创建对象外,一切都完美无缺。
当我使用 DSNAME 调用 CSRIDAC 时出现错误: “系统无法分配或取消分配 指定为 object_name 的数据集。值 rrrr 是 return 代码 从动态分配。值 nnnn 是两个字节的原因 来自动态分配的代码。请参阅 z/OS MVS 编程: 动态分配的授权汇编程序服务指南 return 和原因代码。"
所以我搜索了原因代码 037c 的含义,发现:"Invalid LEN specified in text unit. The accompanying message IKJ56231I indicates the number of the text unit in error."
因此,Window 服务似乎正在调用动态分配服务以通过其 DSNAME 创建对象,但在计算我提供的 DSNAME 中的字符数时出错。
我的 DSNAME 是一个有效的 VSAM 文件名,我使用相同的 DSNAME 通过另一种方式成功读取了这个数据集。
嗯,这是我的函数调用 CSRIDAC 函数的代码:
ozwinsrvObject *ozwinsrvObjectCreate(uint32_t uiFlags, int32_t iObjectSize, uint8_t *pcObjectName, int32_t *piHighOffset, int32_t *piRc)
{
ozwinsrvObject *pobject = __malloc31(sizeof(ozwinsrvObject));
*piRc = OZWINSRV_NO_ERROR;
pobject->pheap = __malloc31(18*4);
pobject->pparmList = __malloc31(11 * sizeof(int32_t));
memcpy(&pobject->parmObject.acOpType[0] , "BEGIN", 5);
pobject->parmObject.iObjectSize = iObjectSize;
pobject->parmObject.iHighOffset = *piHighOffset;
if(uiFlags & OZWINSRV_OBJECT_F_TYPE_DDNAME)
{
memcpy(&pobject->parmObject.acObjectType[0], "DDNAME ", 9);
}
else {
if(uiFlags & OZWINSRV_OBJECT_F_TYPE_DSNAME)
{
memcpy(&pobject->parmObject.acObjectType[0], "DSNAME ", 9);
}
else
{
memcpy(&pobject->parmObject.acObjectType[0], "TEMPSPACE", 9);
}
}
if(uiFlags & OZWINSRV_OBJECT_F_SCROLL_AREA_YES)
{
memcpy(&pobject->parmObject.acScrollArea[0], "YES", 3);
}
else
{
memcpy(&pobject->parmObject.acScrollArea[0], "NO ", 3);
}
if(uiFlags & OZWINSRV_OBJECT_F_STATE_NEW)
{
memcpy(&pobject->parmObject.acObjectState[0], "NEW", 3);
}
else
{
memcpy(&pobject->parmObject.acObjectState[0], "OLD", 3);
}
if(uiFlags & OZWINSRV_OBJECT_F_ACCESS_MODE_UPDATE)
{
memcpy(&pobject->parmObject.acAccessMode[0], "UPDATE", 6);
}
else
{
memcpy(&pobject->parmObject.acAccessMode[0], "READ ", 6);
}
memcpy(&pobject->acObjectName[0], pcObjectName, strlen(pcObjectName));
if(strlen(pcObjectName) < 45)
{
pobject->acObjectName[strlen(pcObjectName)] = ' ';
}
memset(pobject->pparmList, 0, 11 * sizeof(int32_t));
pobject->pparmList[0] = (int32_t) &pobject->parmObject.acOpType[0];
pobject->pparmList[1] = (int32_t) &pobject->parmObject.acObjectType[0];
pobject->pparmList[2] = (int32_t) &pobject->parmObject.acObjectName[0];
pobject->pparmList[3] = (int32_t) &pobject->parmObject.acScrollArea[0];
pobject->pparmList[4] = (int32_t) &pobject->parmObject.acObjectState[0];
pobject->pparmList[5] = (int32_t) &pobject->parmObject.acAccessMode[0];
pobject->pparmList[6] = (int32_t) &pobject->parmObject.iObjectSize;
pobject->pparmList[7] = (int32_t) &pobject->acObjectId[0];
pobject->pparmList[8] = (int32_t) &pobject->parmObject.iHighOffset;
pobject->pparmList[9] = (int32_t) &pobject->parmObject.iRc;
pobject->pparmList[10] = (int32_t) &pobject->parmObject.iReasonC;
x6csridac(pobject->pparmList, pobject->pheap);
if(pobject->parmObject.iRc != 0)
{
printf("Error creating object (csridac) Rc=0x%x, ReasonC=0x%x\n", pobject->parmObject.iRc, pobject->parmObject.iReasonC);
*piRc = OZWINSRV_ERROR_WINDOW_OBJECT_CREATE;
}
*piHighOffset = pobject->parmObject.iHighOffset;
pobject->iObjectSize = iObjectSize;
pobject->uiFlags = uiFlags;
pobject->uiNbViews = 0;
return pobject;
}
那么,这里是调用这个函数的代码:
int32_t iRc = 0;
int32_t iPageSize = 32*1024;
int32_t iPageOffset = iPageSize/4/1024;
int32_t iSize = 1;
int32_t iRealSize = 1;
ozwinsrvObject *pObject;
ozwinsrvWindow *pWindow;
uint8_t acFileName[] = "DSNB10.DSNDBC.DBTLS00.TS1449.I0001.A001";
pObject = ozwinsrvObjectCreate(OZWINSRV_OBJECT_F_ACCESS_MODE_READ | OZWINSRV_OBJECT_F_SCROLL_AREA_NO | OZWINSRV_OBJECT_F_STATE_OLD | OZWINSRV_OBJECT_F_TYPE_DSNAME,
iSize, &acFileName[0], &iRealSize, &iRc);
我希望我对问题的解释是清楚的。如果不是,请随时提出一些问题。 谢谢!
我发现了我的错误并发布了答案。 我使用以下行将名称复制到数组中:
memcpy(&pobject->acObjectName[0], pcObjectName, strlen(pcObjectName));
但是!当我把这个数组放在我的参数列表中时,我使用了这行代码:
pobject->pparmList[2] = (int32_t) &pobject->parmObject.acObjectName[0];
这意味着名称在pobject->acObjectName中,我在参数中放了pobject->parmObject.acObjectName列表。这两个数组不是同一个变量...
对于我的错误,我深表歉意,并确认 DWS 工作正常。