话说前两天被面了一点JCL和PLI的问题,其中关于如何比较两个DATA SET的不同没有回答上来。下来之后查了一下,写了点代码,现在顺带把以前东拼西凑的一些UTILITY的使用贴上来。
1. 比较两个DATA SET的不同,使用IEBCOMPR:
000001 //GDC272D JOB (ACC#),'WYL',CLASS=A,MSGCLASS=A,
000002 // MSGLEVEL=(1,1),NOTIFY=&SYSUID
000003 //COMPARE EXEC PGM=IEBCOMPR
000004 //SYSPRINT DD SYSOUT=A
000007 //SYSUT1 DD DSN=GDC272.COBOL.DATA,DISP=SHR
000008 //SYSUT2 DD DSN=GDC272.COBOL.DATA2,DISP=SHR
000009 //SYSIN DD *
000010 COMPARE TYPORG=PO
000011 /*
000012 //
运行的结果是:
*************************** TOP OF DATA *****************************
COMPARE UTILITY
COMPARE TYPORG=PO
TRUE NAME MISSING FROM SYSUT1
DDNAME = SYSUT1 MEMBER NAME = COMPARE
IEB205I USER DATA FIELDS UNEQUAL
DDNAME = SYSUT1 MEMBER NAME = STDINF
010200050108311F0108318F1137000400010004C7C4C3F2F7F240404040
DDNAME = SYSUT2 MEMBER NAME = STDINF
010200310108311F0108318F1111000400010004C7C4C3F2F7F240404040
IEB221I RECORDS ARE NOT EQUAL
DDNAME = SYSUT1 MEMBER NAME = STDINF
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000004
C3C34040404040404040C3C34040404040404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F4F0F0F0F2
DDNAME = SYSUT2 MEMBER NAME = STDINF
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000004
C4C9C6C6C5D940404040C2C24040404040404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F4F0F0F0F2
IEB223I EXTRA RECORD ON SYSUT2
DDNAME = SYSUT2 MEMBER NAME = STDINF
C4C9C6C6C5D9F2404040C4C9C6C6C5D9F2404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F5F0F0F0F3
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000091
************************ BOTTOM OF DATA **************************
说明了SYSUT1指定的DATA SET中有一个MEMBER在另外一个比较的DATA SET中没有
说明了比较的结果是两个DATA SET不同,下面给出了DATA SET中内容不同的MEMBER
说明了该两个MEMBER中有一条记录的内容不同
说明了在SYSUT2指定的DATA SET中的MEMBER:STDINF包含有一条多的纪录。
是不同的纪录的EBCDIC编码的16进显示
是什么还没有看懂,应该是DATA SET的一些属性信息吧,反正最后的“C7C4C3F2F7F2”是GDC272
需要注意的是,虽然比较是成功完成了,但是当两个DATA SET不同的时候,RETURN CODE还是8
尝试过的出错的时候,RETURN CODE 都是12
查了Utilities的reference,关于IEBCOMPR的RETURN CODE是这样解释的:
IEBCOMPR returns a code in register 15 to indicate the results of program execution.
The return codes and their meanings are:
Codes Meaning
00 (X'00') Successful completion.
08 (X'08') An unequal comparison. Processing continues.
12 (X'0C') An unrecoverable error exists. The utility ends.
16 (X'10') A user routine passed a return code of 16 to IEBCOMPR. The utility ends.
如果需要直接比较两个PDS中的某个MEMBER的话,可以用:
000007 //SYSUT1 DD DSN=GDC272.COBOL.DATA(STDINF),DISP=SHR
000008 //SYSUT2 DD DSN=GDC272.COBOL.DATA2(STDINF),DISP=SHR
000009 //SYSIN DD DUMMY
000010 //
或者
000009 //SYSIN DD *
000010 COMPARE TYPORG=PS
000011 LABELS DATA=ONLY
000012 /*
000013 //
需要注意的是DUMMY和LABELS DATA不能用于PDS
如果是DUMMY会发生如下错误:
********************************* TOP OF DATA **********************************
COMPARE UTILITY
IEB267I I/O ERROR, ,GDC272D ,COMPARE ,874B,D,SYSUT1 ,READ ,WRNG.LEN.RECORD,00000086000000,BSAM
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000000
******************************** BOTTOM OF DATA ********************************
如果是LABLES DATA则会:
**************************** TOP OF DATA ***********************
COMPARE UTILITY
COMPARE TYPORG=PO
LABELS DATA=ONLY
IEB250I USER LABEL IS NOT SUPPORTED BY PARTITIONED DATA SET
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000000
*************************** BOTTOM OF DATA *********************
用ISPF提供的3.12/3.13等比较两个DATA SET比较简单,唯一需要注意的是在PANNEL显示出MEMBER列表的时候,需要用S或者 / 选择你需要比较的MEMBER,并且确认是按F3
1. 比较两个DATA SET的不同,使用IEBCOMPR:
000001 //GDC272D JOB (ACC#),'WYL',CLASS=A,MSGCLASS=A,
000002 // MSGLEVEL=(1,1),NOTIFY=&SYSUID
000003 //COMPARE EXEC PGM=IEBCOMPR
000004 //SYSPRINT DD SYSOUT=A
000007 //SYSUT1 DD DSN=GDC272.COBOL.DATA,DISP=SHR
000008 //SYSUT2 DD DSN=GDC272.COBOL.DATA2,DISP=SHR
000009 //SYSIN DD *
000010 COMPARE TYPORG=PO
000011 /*
000012 //
运行的结果是:
*************************** TOP OF DATA *****************************
COMPARE UTILITY
COMPARE TYPORG=PO
TRUE NAME MISSING FROM SYSUT1
DDNAME = SYSUT1 MEMBER NAME = COMPARE
IEB205I USER DATA FIELDS UNEQUAL
DDNAME = SYSUT1 MEMBER NAME = STDINF
010200050108311F0108318F1137000400010004C7C4C3F2F7F240404040
DDNAME = SYSUT2 MEMBER NAME = STDINF
010200310108311F0108318F1111000400010004C7C4C3F2F7F240404040
IEB221I RECORDS ARE NOT EQUAL
DDNAME = SYSUT1 MEMBER NAME = STDINF
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000004
C3C34040404040404040C3C34040404040404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F4F0F0F0F2
DDNAME = SYSUT2 MEMBER NAME = STDINF
PHYSICAL RECORD NUMBER = 00000001 LOGICAL RECORD NUMBER WITHIN PHYSICAL RECORD = 00000004
C4C9C6C6C5D940404040C2C24040404040404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F4F0F0F0F2
IEB223I EXTRA RECORD ON SYSUT2
DDNAME = SYSUT2 MEMBER NAME = STDINF
C4C9C6C6C5D9F2404040C4C9C6C6C5D9F2404040F5F4F64040C6404040404040F04BF14040404BF9 (...)
404040404040404040404040F0F0F0F5F0F0F0F3
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000091
************************ BOTTOM OF DATA **************************
说明了SYSUT1指定的DATA SET中有一个MEMBER在另外一个比较的DATA SET中没有
说明了比较的结果是两个DATA SET不同,下面给出了DATA SET中内容不同的MEMBER
说明了该两个MEMBER中有一条记录的内容不同
说明了在SYSUT2指定的DATA SET中的MEMBER:STDINF包含有一条多的纪录。
是不同的纪录的EBCDIC编码的16进显示
是什么还没有看懂,应该是DATA SET的一些属性信息吧,反正最后的“C7C4C3F2F7F2”是GDC272
需要注意的是,虽然比较是成功完成了,但是当两个DATA SET不同的时候,RETURN CODE还是8
尝试过的出错的时候,RETURN CODE 都是12
查了Utilities的reference,关于IEBCOMPR的RETURN CODE是这样解释的:
IEBCOMPR returns a code in register 15 to indicate the results of program execution.
The return codes and their meanings are:
Codes Meaning
00 (X'00') Successful completion.
08 (X'08') An unequal comparison. Processing continues.
12 (X'0C') An unrecoverable error exists. The utility ends.
16 (X'10') A user routine passed a return code of 16 to IEBCOMPR. The utility ends.
如果需要直接比较两个PDS中的某个MEMBER的话,可以用:
000007 //SYSUT1 DD DSN=GDC272.COBOL.DATA(STDINF),DISP=SHR
000008 //SYSUT2 DD DSN=GDC272.COBOL.DATA2(STDINF),DISP=SHR
000009 //SYSIN DD DUMMY
000010 //
或者
000009 //SYSIN DD *
000010 COMPARE TYPORG=PS
000011 LABELS DATA=ONLY
000012 /*
000013 //
需要注意的是DUMMY和LABELS DATA不能用于PDS
如果是DUMMY会发生如下错误:
********************************* TOP OF DATA **********************************
COMPARE UTILITY
IEB267I I/O ERROR, ,GDC272D ,COMPARE ,874B,D,SYSUT1 ,READ ,WRNG.LEN.RECORD,00000086000000,BSAM
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000000
******************************** BOTTOM OF DATA ********************************
如果是LABLES DATA则会:
**************************** TOP OF DATA ***********************
COMPARE UTILITY
COMPARE TYPORG=PO
LABELS DATA=ONLY
IEB250I USER LABEL IS NOT SUPPORTED BY PARTITIONED DATA SET
END OF JOB-TOTAL NUMBER OF RECORDS COMPARED = 00000000
*************************** BOTTOM OF DATA *********************
用ISPF提供的3.12/3.13等比较两个DATA SET比较简单,唯一需要注意的是在PANNEL显示出MEMBER列表的时候,需要用S或者 / 选择你需要比较的MEMBER,并且确认是按F3
文章来源:http://e.iciba.com/space-2330696-do-blog-id-177097.html