我应该如何在 IBM z/OS 汇编程序中获取输入和打印输出?
How should I get inputs and print outputs in IBM z/OS assembler?
我正在尝试使用“IBM Z 系统服务器的汇编语言编程”一书中介绍的一些简单 I/O 宏(附录 B 部分介绍的宏)。但是当我尝试 运行 示例程序时,程序一到达第一个宏系统转储就会发生。输出中也有 IEF686I。我是一名学习 IBM 汇编语言的学生,我对 JCL 不熟悉,我不知道我是否在其中做错了什么。获取输入和分配输出区域的格式是否正确,或者我应该以不同的方式进行?这是 JCL:
//XXXXXX JOB CLASS=A,MSGCLASS=T,MSGLEVEL=(1,1)
// EXEC PROC=ASMACLG
//SYSPRINT DD SYSOUT=*
//C.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
// DD DSN=HATAM.MACLIB.SRC,DISP=SHR
//C.SYSIN DD DSN=HATAM.ASM.SRC(MACSAMP),DISP=SHR
//G.SYSPRINT DD SYSOUT=*
//G.SYSIN DD *
+123456 * FIRST RECORD
-000034567890 * SECOND AND LAST RECORD
/*
请注意,HATAM.MACLIB.SRC 是包含 i/o 个宏的数据集($$GENIO、CONVERTI、...)。这是输出:
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
19.05.18 JOB00756 ---- THURSDAY, 11 NOV 2021 ----
19.05.18 JOB00756 IRR010I USERID IBMUSER IS ASSIGNED TO THIS JOB.
19.05.18 JOB00756 IEF677I WARNING MESSAGE(S) FOR JOB XXXXXX ISSUED
19.05.18 JOB00756 ICH70001I IBMUSER LAST ACCESS AT 18:48:30 ON THURSDAY, NOVEMBER 11, 2021
19.05.18 JOB00756 $HASP373 XXXXXX STARTED - INIT 1 - CLASS A - SYS SYS1
19.05.18 JOB00756 IEF403I XXXXXX - STARTED - TIME=19.05.18
19.05.18 JOB00756 IEA995I SYMPTOM DUMP OUTPUT 159
159 SYSTEM COMPLETION CODE=0C2 REASON CODE=00000002
159 TIME=19.05.18 SEQ=00021 CPU=0000 ASID=001A
159 PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
159 ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
159 NAME=GO
159 DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
159 GR 0: FD000008 1: 00000000
159 2: 00000040 3: 008D79D4
159 4: 008D79B0 5: 008FF350
159 6: 008C6FE0 7: FD000000
159 8: 008FCC80 9: 008CFCC8
159 A: 00000000 B: 008FF350
159 C: 834C4BAA D: 00006008
159 E: 80FE507C F: 00007274
159 END OF SYMPTOM DUMP
19.05.18 JOB00756 IEF450I XXXXXX G - ABEND=S0C2 U0000 REASON=00000002 160
160 TIME=19.05.18
19.05.18 JOB00756 IEF404I XXXXXX - ENDED - TIME=19.05.18
19.05.18 JOB00756 $HASP395 XXXXXX ENDED
0------ JES2 JOB STATISTICS ------
- 11 NOV 2021 JOB EXECUTION DATE
- 12 CARDS READ
- 695 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 42 SYSOUT SPOOL KBYTES
- 0.01 MINUTES EXECUTION TIME
1 //XXXXXX JOB CLASS=A,MSGCLASS=T,MSGLEVEL=(1,1) JOB00756
2 // EXEC PROC=ASMACLG
3 XXASMACLG PROC
XX*
XX*********************************************************************
XX* *
XX* Licensed Materials - Property of IBM *
XX* *
XX* 5696-234 5694-A01 *
XX* *
XX* Copyright IBM Corporation 1992, 2008 All Rights Reserved. *
XX* *
XX* US Government Users Restricted Rights - Use, duplication *
XX* or disclosure restricted by GSA ADP Schedule Contract *
XX* with IBM Corp. *
XX* *
XX*********************************************************************
XX* *
XX* ASMACLG *
XX* *
XX* This procedure runs the High Level Assembler, link-edits the *
XX* newly assembled program and runs the program after the *
XX* link-edit is accomplished. *
XX* *
XX*********************************************************************
XX*
4 XXC EXEC PGM=ASMA90
XX*
5 //C.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
X/SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
6 // DD DSN=SYS1.MODGEN,DISP=SHR
7 // DD DSN=HATAM.MACLIB.SRC,DISP=SHR
8 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND),
XX UNIT=SYSALLDA,BUFNO=1
9 //SYSPRINT DD SYSOUT=*
X/SYSPRINT DD SYSOUT=*
10 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND),
XX UNIT=SYSALLDA,DISP=(MOD,PASS),
XX BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1
XX*
11 //C.SYSIN DD DSN=HATAM.ASM.SRC(MACSAMP),DISP=SHR
12 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C)
XX*
13 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE)
14 XX DD DDNAME=SYSIN
15 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)),
XX DSN=&&GOSET(GO)
16 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND),
XX UNIT=SYSALLDA,BUFNO=1
17 XXSYSPRINT DD SYSOUT=*
XX*
18 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L))
XX*
19 //G.SYSPRINT DD SYSOUT=*
20 //G.SYSIN DD *
STMT NO. MESSAGE
2 IEFC001I PROCEDURE ASMACLG WAS EXPANDED USING SYSTEM LIBRARY HLA.SASMSAM1
18 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
ICH70001I IBMUSER LAST ACCESS AT 18:48:30 ON THURSDAY, NOVEMBER 11, 2021
IEF236I ALLOC. FOR XXXXXX C
IEF237I 0A81 ALLOCATED TO SYSLIB
IEF237I 0A81 ALLOCATED TO
IEF237I 0A81 ALLOCATED TO
IGD100I 0A95 ALLOCATED TO DDNAME SYSUT1 DATACLAS ( )
IEF237I JES2 ALLOCATED TO SYSPRINT
IGD100I 0A95 ALLOCATED TO DDNAME SYSLIN DATACLAS ( )
IEF237I 0A81 ALLOCATED TO SYSIN
IEF142I XXXXXX C - STEP WAS EXECUTED - COND CODE 0000
IEF285I SYS1.MACLIB KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I SYS1.MODGEN KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I HATAM.MACLIB.SRC KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I SYS21315.T190518.RA000.XXXXXX.SYSUT1.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000102.? SYSOUT
IEF285I SYS21315.T190518.RA000.XXXXXX.OBJ.H01 PASSED
IEF285I VOL SER NOS= ZASYS1.
IEF285I HATAM.ASM.SRC KEPT
IEF285I VOL SER NOS= ZARES1.
IEF373I STEP/C /START 2021315.1905
IEF374I STEP/C /STOP 2021315.1905 CPU 0MIN 00.19SEC SRB 0MIN 00.02SEC VIRT 220K SYS 276K EXT 32768K SYS 10732K
IEF236I ALLOC. FOR XXXXXX L
IEF237I 0A95 ALLOCATED TO SYSLIN
IEF237I DMY ALLOCATED TO
IGD100I 0A95 ALLOCATED TO DDNAME SYSLMOD DATACLAS ( )
IGD100I 0A95 ALLOCATED TO DDNAME SYSUT1 DATACLAS ( )
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF142I XXXXXX L - STEP WAS EXECUTED - COND CODE 0000
IEF285I SYS21315.T190518.RA000.XXXXXX.OBJ.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 PASSED
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.SYSUT1.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000103.? SYSOUT
IEF373I STEP/L /START 2021315.1905
IEF374I STEP/L /STOP 2021315.1905 CPU 0MIN 00.05SEC SRB 0MIN 00.00SEC VIRT 104K SYS 276K EXT 1640K SYS 10724K
IEF236I ALLOC. FOR XXXXXX G
IEF237I 0A95 ALLOCATED TO PGM=*.DD
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO SYSIN
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0C2 REASON CODE=00000002
TIME=19.05.18 SEQ=00021 CPU=0000 ASID=001A
PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
NAME=GO
DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
GR 0: FD000008 1: 00000000
2: 00000040 3: 008D79D4
4: 008D79B0 5: 008FF350
6: 008C6FE0 7: FD000000
8: 008FCC80 9: 008CFCC8
A: 00000000 B: 008FF350
C: 834C4BAA D: 00006008
E: 80FE507C F: 00007274
END OF SYMPTOM DUMP
IEF472I XXXXXX G - COMPLETION CODE - SYSTEM=0C2 USER=0000 REASON=00000002
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 KEPT
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000104.? SYSOUT
IEF285I IBMUSER.XXXXXX.JOB00756.D0000101.? SYSIN
IEF373I STEP/G /START 2021315.1905
IEF374I STEP/G /STOP 2021315.1905 CPU 0MIN 00.04SEC SRB 0MIN 00.00SEC VIRT 8K SYS 256K EXT 0K SYS 10780K
IEF237I 0A95 ALLOCATED TO SYS00001
IEF285I SYS21315.T190518.RA000.XXXXXX.R0100017 KEPT
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF375I JOB/XXXXXX /START 2021315.1905
IEF376I JOB/XXXXXX /STOP 2021315.1905 CPU 0MIN 00.28SEC SRB 0MIN 00.02SEC
1 High Level Assembler Option Summary (PTF UK37157) Page 1
- HLASM R6.0 2021/11/11 19.05
0 No Overriding ASMAOPT Parameters
No Overriding Parameters
No Process Statements
Options for this Assembly
0 NOADATA
ALIGN
NOASA
BATCH
CODEPAGE(047C)
NOCOMPAT
NODBCS
NODECK
DXREF
ESD
NOEXIT
FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOPAGE0,PUSH,RECORD,NOSUBSTR,USING0)
NOFOLD
NOGOFF
NOINFO
LANGUAGE(EN)
NOLIBMAC
LINECOUNT(60)
LIST(121)
MACHINE(,NOLIST)
MXREF(SOURCE)
OBJECT
OPTABLE(UNI,NOLIST)
NOPCONTROL
NOPESTOP
NOPROFILE
NORA2
NORENT
RLD
RXREF
SECTALGN(8)
SIZE(MAX)
NOSUPRWARN
SYSPARM()
NOTERM
NOTEST
THREAD
NOTRANSLATE
TYPECHECK(MAGNITUDE,REGISTER)
USING(NOLIMIT,MAP,WARN(15))
NOWORKFILE
XREF(SHORT,UNREFS)
No Overriding DD Names
1 External Symbol Dictionary Page 2
-Symbol Type Id Address Length Owner Id Flags Alias-of HLASM R6.0 2021/11/11 19.05
0IOSAMP SD 00000001 00000000 00000251 00
$$PRTOUT ER 00000002
$$IOSECT SD 00000003 00000258 00000D6C 01
$$READCD LD 0000029C 00000003
$$PRTLIN LD 00000268 00000003
$$PRTOUT LD 00000274 00000003
$$DMPOUT LD 00000258 00000003
$$CNVRTO LD 00000284 00000003
$$CNVRTI LD 00000290 00000003
$$READCD ER 00000004
$$PRTLIN ER 00000005
$$CNVRTI ER 00000006
$$CNVRTO ER 00000007
$$DMPOUT ER 00000008
1 Page 3
Active Usings: None
0 Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2021/11/11 19.05
0 1 PRINT NOGEN
000000 00000 00251 2 IOSAMP CSECT ,
R:F 00000 3 USING *,15
000000 1B11 4 SR 1,1
5 *
000002 90EF F00C 0000C 6 PRINTOUT
000024 0700 719 READ READCARD CARDOUT,EOF
00004A 4110 1001 00001 728 LA 1,1(0,1)
00004E 90EF F058 00058 729 PRINTOUT 1
00007C 0700 740 PRINTLIN OUT,LINELEN
00009C 0700 748 CONVERTI 2,CARDOUT
0000BC 0700 756 CONVERTO 2,OUTDATA
0000DC 0700 764 PRINTLIN OUTDATA,L'OUTDATA
0000FC 47F0 F026 00026 772 B READ
000100 0700 773 EOF DUMPOUT IOSAMP,LAST
000128 B982 0033 782 XGR 3,3
00012C B946 0030 783 BCTGR 3,0
000130 0700 784 PRINTOUT 1,19,32,*
000176 D6C9D5D7E4E340D9 799 OUT DC C'OINPUT RECORD = "'
000187 4040404040404040 800 CARDOUT DC CL80' ',C'"'
00062 801 LINELEN EQU *-OUT
0001D8 802 OUTDATA DS CL121
00251 803 LAST EQU *
804 END
1 Relocation Dictionary
1 Macro and Copy Code Source Summary Page 8
- Con Source Volume Members HLASM R6.0 2021/11/11 19.05
0 L1 SYS1.MACLIB ZARES1 CLOSE DCB GET IHBINNRA IHB01 OPEN PUT
L3 HATAM.MACLIB.SRC ZARES1 $$GENIO CONVERTI CONVERTO DUMPOUT PRINTLIN PRINTOUT
READCARD
1 Diagnostic Cross Reference and Assembler Summary Page 11
- HLASM R6.0 2021/11/11 19.05
0 No Statements Flagged in this Assembly
HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 6.0, PTF UK37157
0SYSTEM: z/OS 01.10.00 JOBNAME: XXXXXX STEPNAME: C PROCSTEP: (NOPROC)
0Data Sets Allocated for this Assembly
Con DDname Data Set Name Volume Member
P1 SYSIN HATAM.ASM.SRC ZARES1 MACSAMP
L1 SYSLIB SYS1.MACLIB ZARES1
L2 SYS1.MODGEN ZARES1
L3 HATAM.MACLIB.SRC ZARES1
SYSLIN SYS21315.T190518.RA000.XXXXXX.OBJ.H01 ZASYS1
SYSPRINT IBMUSER.XXXXXX.JOB00756.D0000102.?
31992K allocated to Buffer Pool Storage required 512K
24 Primary Input Records Read 3805 Library Records Read 0 Work File Reads
0 ASMAOPT Records Read 383 Primary Print Records Written 0 Work File Writes
80 Object Records Written 0 ADATA Records Written
0Assembly Start Time: 19.05.18 Stop Time: 19.05.18 Processor Time: 00.00.00.1433
Return Code 000
1z/OS V1 R10 BINDER 19:05:17 THURSDAY NOVEMBER 11, 2021
BATCH EMULATOR JOB(XXXXXX ) STEP(L ) PGM= HEWL
IEW2278I B352 INVOCATION PARAMETERS - MAP,LET,LIST
IEW2650I 5102 MODULE ENTRY NOT PROVIDED. ENTRY DEFAULTS TO SECTION IOSAMP.
1 *** M O D U L E M A P ***
---------------
CLASS B_TEXT LENGTH = FC4 ATTRIBUTES = CAT, LOAD, RMODE= 24
OFFSET = 0 IN SEGMENT 001 ALIGN = DBLWORD
---------------
SECTION CLASS ------- SOURCE --------
OFFSET OFFSET NAME TYPE LENGTH DDNAME SEQ MEMBER
0 IOSAMP CSECT 251 SYSLIN 01 **NULL**
258 $$IOSECT CSECT D6C SYSLIN 01 **NULL**
0 258 $$DMPOUT LABEL
10 268 $$PRTLIN LABEL
1C 274 $$PRTOUT LABEL
2C 284 $$CNVRTO LABEL
38 290 $$CNVRTI LABEL
44 29C $$READCD LABEL
1 *** DATA SET SUMMARY ***
DDNAME CONCAT FILE IDENTIFICATION
SYSLIN 01 SYS21315.T190518.RA000.XXXXXX.OBJ.H01
*** E N D O F M O D U L E M A P ***
1PROCESSING OPTIONS:
ALIASES NO
ALIGN2 NO
AMODE UNSPECIFIED
CALL YES
CASE UPPER
COMPAT UNSPECIFIED
COMPRESS AUTO
DCBS NO
DYNAM NO
EXTATTR UNSPECIFIED
EXITS: NONE
FILL NONE
GID UNSPECIFIED
HOBSET NO
INFO NO
LET 08
LINECT 060
LIST SUMMARY
LISTPRIV NO
MAP YES
MAXBLK 032760
MODMAP NO
MSGLEVEL 00
OVLY NO
PRINT YES
RES NO
REUSABILITY UNSPECIFIED
RMODE UNSPECIFIED
STORENX NOREPLACE
STRIPCL NO
STRIPSEC NO
TERM NO
TRAP ON
UID UNSPECIFIED
UPCASE NO
WKSPACE 000000K,000000K
XCAL NO
XREF NO
***END OF OPTIONS***
1SAVE OPERATION SUMMARY:
MEMBER NAME GO
LOAD LIBRARY SYS21315.T190518.RA000.XXXXXX.GOSET.H01
PROGRAM TYPE LOAD MODULE
VOLUME SERIAL ZASYS1
MAX BLOCK 32760
DISPOSITION ADDED NEW
TIME OF SAVE 19.05.18 NOV 11, 2021
1SAVE MODULE ATTRIBUTES:
AC 000
AMODE 24
COMPRESSION NONE
DC NO
EDITABLE YES
EXCEEDS 16MB NO
EXECUTABLE YES
MIGRATABLE YES
OL NO
OVLY NO
PACK,PRIME NO,NO
PAGE ALIGN NO
REFR NO
RENT NO
REUS NO
RMODE 24
SCTR NO
SSI
SYM GENERATED NO
TEST NO
XPLINK NO
MODULE SIZE (HEX) 00000FC8
1 ENTRY POINT AND ALIAS SUMMARY:
NAME: ENTRY TYPE AMODE C_OFFSET CLASS NAME STATUS
IOSAMP MAIN_EP 24 00000000 B_TEXT
***** E N D O F R E P O R T *****
1z/OS V1 R10 BINDER 19:05:17 THURSDAY NOVEMBER 11, 2021
BATCH EMULATOR JOB(XXXXXX ) STEP(L ) PGM= HEWL
IEW2008I 0F03 PROCESSING COMPLETED. RETURN CODE = 0.
1----------------------
MESSAGE SUMMARY REPORT
----------------------
TERMINAL MESSAGES (SEVERITY = 16)
NONE
SEVERE MESSAGES (SEVERITY = 12)
NONE
ERROR MESSAGES (SEVERITY = 08)
NONE
WARNING MESSAGES (SEVERITY = 04)
NONE
INFORMATIONAL MESSAGES (SEVERITY = 00)
2008 2278 2650
**** END OF MESSAGE SUMMARY REPORT ****
是JCL错了还是我应该去别的地方找问题?
您的私有宏 PRINTOUT 有问题,或者在您的汇编程序源代码的第 6 行中调用宏之前所做的设置有问题。我不知道它是什么,因为你没有提供有关该宏的详细信息(其他人建议使用 PRINT GEN 重新运行该作业)。
缺乏更多信息,这是我对发生的事情的分析:
这是作业日志中打印的 ABEND 信息
PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
NAME=GO
DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
GR 0: FD000008 1: 00000000
2: 00000040 3: 008D79D4
4: 008D79B0 5: 008FF350
6: 008C6FE0 7: FD000000
8: 008FCC80 9: 008CFCC8
A: 00000000 B: 008FF350
C: 834C4BAA D: 00006008
E: 80FE507C F: 00007274
END OF SYMPTOM DUMP
第一行的 INTC 02
告诉您程序失败 'privileged-operation exception'。非授权程序(例如您的程序)中的特权操作异常通常表明程序跳转到了错误的地址,而且 - 幸运的是 - 在该地址没有有效指令。 (为什么幸运?因为如果在该地址有 valid 指令,调试起来会更困难。)
除了一些与存储相关的指令异常,PSW下一条顺序指令地址(NSI)指向失败指令后的下一条指令. NSI 是以 'PSW AT TIME OF ERROR' 开头的行中的第二个数字部分,即 00007010
.
第一行的 ILC 4
告诉您失败的指令是一条 4 字节指令。鉴于 NSI 指向 next 指令,失败的指令位于地址 00007010 - 4 = 0000700C
(请注意,地址以十六进制表示法显示,即 10 - 4 = C。)
所以程序一直在执行指令,直到它从地址 0000700C
获取下一条指令
上面第二行
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
告诉您程序已在地址 00007000
处加载,并且失败发生在活动加载模块(程序)内的偏移量 00000010
处。
汇编程序列表列出了以偏移量0
开头的指令,所以我们可以取上面的offest,并从中减去ILC4
,得知失败指令的偏移量是00000C
.
Loc Object Code Addr1 Addr2 Stmt Source Statement
1 PRINT NOGEN
000000 00000 00251 2 IOSAMP CSECT ,
R:F 00000 3 USING *,15
000000 1B11 4 SR 1,1
5 *
000002 90EF F00C 0000C 6 PRINTOUT
000024 0700 719 READ READCARD CARDOUT,EOF
Offset 00000C
在列表中位于 000002
和 000024
之间,因此它在汇编程序源代码第 6 行的 PRINTOUT
宏生成的代码内.
由于PRINT NOGEN
,我们只能看到生成的第一条指令,其代码为90EF F00C
,也就是STM 14,15,12(15)
。这将寄存器 14 和 15 的内容存储在从寄存器 15 中的地址偏移量 12 开始的连续字节中。
此时寄存器15的地址是多少?根据所示的汇编程序指令,我们可以说它是程序入口处寄存器 15 的值。在 z/OS 中,这是程序入口点的地址(除了这里没有讨论的特殊情况)。所以寄存器 15 在入口处是 00007000
并且在修改之前将保持不变。它不会修改到 STM
指令。因此,寄存器 14 和 15 从地址 0000700C
.
开始存储
存储寄存器的地址 0000700C
是不是很眼熟?是的,它确实。它是失败指令的地址(见上文)。
因此程序将地址 0000700C
开始的字节解释为 指令 ,其中它实际上是寄存器 14 和 15 的内容。在 z/OS,在程序入口处,寄存器 14 包含 return 地址(同样,特殊情况除外)。
程序存储的前几个字节如下所示:
00-01 = 1B11 = SR 1,1
02-05 = 90EF F00C = STM 14,15,12(15)
06 = ??
07 = ??
08 = ??
09 = ??
0A = ??
0B = ??
0C-0F = ???? ???? = content of register 14 at entry (= return address)
10-13 = 0000 7000 = content of register 15 at entry (= program entry point)
我们不知道字节 06-0B 的内容,但应该认为它们是指令,并且可能是 PRINTOUT
宏生成的数据。
一个有趣的细节是寄存器 15 的内容(15 是 x'0F')在故障发生时。这显示在 END OF SYMPTOM DUMP
行之前的行中
E: 80FE507C F: 00007274
寄存器 15 包含 00007274
,因此它被字节 06-0B 中的指令修改。它指向哪里?它指向地址 00007274
,或 00007274
- 00007000
(程序的地址)= 偏移量 274
。汇编程序列表显示程序在偏移量 00251
处结束,因此偏移量 274
超出了此代码。
000187 4040404040404040 800 CARDOUT DC CL80' ',C'"'
00062 801 LINELEN EQU *-OUT
0001D8 802 OUTDATA DS CL121
00251 803 LAST EQU *
804 END
因此,在汇编程序语句显示的生成代码之外注册了 15 个点。查看活页夹列表,我们可以找出偏移量 274
是否仍在加载模块的存储范围内,如果是在哪一部分。
SECTION CLASS ------- SOURCE --------
OFFSET OFFSET NAME TYPE LENGTH DDNAME SEQ MEMBER
0 IOSAMP CSECT 251 SYSLIN 01 **NULL**
258 $$IOSECT CSECT D6C SYSLIN 01 **NULL**
0 258 $$DMPOUT LABEL
10 268 $$PRTLIN LABEL
1C 274 $$PRTOUT LABEL
加载模块中的 Offset 274
是名为 $$PRTOUT
的例程的开始,它似乎与汇编程序源代码中的 PRINTOUT
宏有关。因此,寄存器 15 指向例程 $$PRTOUT
的入口点。这表明寄存器 15 已经加载了例程 $$PRTOUT
的入口点地址。这很可能是由程序中06-0B区的指令完成的。
一切似乎都很合适。该程序似乎准备调用例程$$PRTOUT
,但不知何故缺少'jump'指令,例如BALR 14,15
,最常用于跳转到子例程。
但是,只有知道 06-0B 区域中的指令才能找到确切的问题。
并回答您的一个问题:不,JCL 没有任何问题。
我正在尝试使用“IBM Z 系统服务器的汇编语言编程”一书中介绍的一些简单 I/O 宏(附录 B 部分介绍的宏)。但是当我尝试 运行 示例程序时,程序一到达第一个宏系统转储就会发生。输出中也有 IEF686I。我是一名学习 IBM 汇编语言的学生,我对 JCL 不熟悉,我不知道我是否在其中做错了什么。获取输入和分配输出区域的格式是否正确,或者我应该以不同的方式进行?这是 JCL:
//XXXXXX JOB CLASS=A,MSGCLASS=T,MSGLEVEL=(1,1)
// EXEC PROC=ASMACLG
//SYSPRINT DD SYSOUT=*
//C.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
// DD DSN=HATAM.MACLIB.SRC,DISP=SHR
//C.SYSIN DD DSN=HATAM.ASM.SRC(MACSAMP),DISP=SHR
//G.SYSPRINT DD SYSOUT=*
//G.SYSIN DD *
+123456 * FIRST RECORD
-000034567890 * SECOND AND LAST RECORD
/*
请注意,HATAM.MACLIB.SRC 是包含 i/o 个宏的数据集($$GENIO、CONVERTI、...)。这是输出:
1 J E S 2 J O B L O G -- S Y S T E M S Y S 1 -- N O D E N 1
0
19.05.18 JOB00756 ---- THURSDAY, 11 NOV 2021 ----
19.05.18 JOB00756 IRR010I USERID IBMUSER IS ASSIGNED TO THIS JOB.
19.05.18 JOB00756 IEF677I WARNING MESSAGE(S) FOR JOB XXXXXX ISSUED
19.05.18 JOB00756 ICH70001I IBMUSER LAST ACCESS AT 18:48:30 ON THURSDAY, NOVEMBER 11, 2021
19.05.18 JOB00756 $HASP373 XXXXXX STARTED - INIT 1 - CLASS A - SYS SYS1
19.05.18 JOB00756 IEF403I XXXXXX - STARTED - TIME=19.05.18
19.05.18 JOB00756 IEA995I SYMPTOM DUMP OUTPUT 159
159 SYSTEM COMPLETION CODE=0C2 REASON CODE=00000002
159 TIME=19.05.18 SEQ=00021 CPU=0000 ASID=001A
159 PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
159 ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
159 NAME=GO
159 DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
159 GR 0: FD000008 1: 00000000
159 2: 00000040 3: 008D79D4
159 4: 008D79B0 5: 008FF350
159 6: 008C6FE0 7: FD000000
159 8: 008FCC80 9: 008CFCC8
159 A: 00000000 B: 008FF350
159 C: 834C4BAA D: 00006008
159 E: 80FE507C F: 00007274
159 END OF SYMPTOM DUMP
19.05.18 JOB00756 IEF450I XXXXXX G - ABEND=S0C2 U0000 REASON=00000002 160
160 TIME=19.05.18
19.05.18 JOB00756 IEF404I XXXXXX - ENDED - TIME=19.05.18
19.05.18 JOB00756 $HASP395 XXXXXX ENDED
0------ JES2 JOB STATISTICS ------
- 11 NOV 2021 JOB EXECUTION DATE
- 12 CARDS READ
- 695 SYSOUT PRINT RECORDS
- 0 SYSOUT PUNCH RECORDS
- 42 SYSOUT SPOOL KBYTES
- 0.01 MINUTES EXECUTION TIME
1 //XXXXXX JOB CLASS=A,MSGCLASS=T,MSGLEVEL=(1,1) JOB00756
2 // EXEC PROC=ASMACLG
3 XXASMACLG PROC
XX*
XX*********************************************************************
XX* *
XX* Licensed Materials - Property of IBM *
XX* *
XX* 5696-234 5694-A01 *
XX* *
XX* Copyright IBM Corporation 1992, 2008 All Rights Reserved. *
XX* *
XX* US Government Users Restricted Rights - Use, duplication *
XX* or disclosure restricted by GSA ADP Schedule Contract *
XX* with IBM Corp. *
XX* *
XX*********************************************************************
XX* *
XX* ASMACLG *
XX* *
XX* This procedure runs the High Level Assembler, link-edits the *
XX* newly assembled program and runs the program after the *
XX* link-edit is accomplished. *
XX* *
XX*********************************************************************
XX*
4 XXC EXEC PGM=ASMA90
XX*
5 //C.SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
X/SYSLIB DD DSN=SYS1.MACLIB,DISP=SHR
6 // DD DSN=SYS1.MODGEN,DISP=SHR
7 // DD DSN=HATAM.MACLIB.SRC,DISP=SHR
8 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(4096,(120,120),,,ROUND),
XX UNIT=SYSALLDA,BUFNO=1
9 //SYSPRINT DD SYSOUT=*
X/SYSPRINT DD SYSOUT=*
10 XXSYSLIN DD DSN=&&OBJ,SPACE=(3040,(40,40),,,ROUND),
XX UNIT=SYSALLDA,DISP=(MOD,PASS),
XX BLKSIZE=3040,LRECL=80,RECFM=FB,BUFNO=1
XX*
11 //C.SYSIN DD DSN=HATAM.ASM.SRC(MACSAMP),DISP=SHR
12 XXL EXEC PGM=HEWL,PARM='MAP,LET,LIST',COND=(8,LT,C)
XX*
13 XXSYSLIN DD DSN=&&OBJ,DISP=(OLD,DELETE)
14 XX DD DDNAME=SYSIN
15 XXSYSLMOD DD DISP=(,PASS),UNIT=SYSALLDA,SPACE=(CYL,(1,1,1)),
XX DSN=&&GOSET(GO)
16 XXSYSUT1 DD DSN=&&SYSUT1,SPACE=(1024,(120,120),,,ROUND),
XX UNIT=SYSALLDA,BUFNO=1
17 XXSYSPRINT DD SYSOUT=*
XX*
18 XXG EXEC PGM=*.L.SYSLMOD,COND=((8,LT,C),(8,LT,L))
XX*
19 //G.SYSPRINT DD SYSOUT=*
20 //G.SYSIN DD *
STMT NO. MESSAGE
2 IEFC001I PROCEDURE ASMACLG WAS EXPANDED USING SYSTEM LIBRARY HLA.SASMSAM1
18 IEF686I DDNAME REFERRED TO ON DDNAME KEYWORD IN PRIOR STEP WAS NOT RESOLVED
ICH70001I IBMUSER LAST ACCESS AT 18:48:30 ON THURSDAY, NOVEMBER 11, 2021
IEF236I ALLOC. FOR XXXXXX C
IEF237I 0A81 ALLOCATED TO SYSLIB
IEF237I 0A81 ALLOCATED TO
IEF237I 0A81 ALLOCATED TO
IGD100I 0A95 ALLOCATED TO DDNAME SYSUT1 DATACLAS ( )
IEF237I JES2 ALLOCATED TO SYSPRINT
IGD100I 0A95 ALLOCATED TO DDNAME SYSLIN DATACLAS ( )
IEF237I 0A81 ALLOCATED TO SYSIN
IEF142I XXXXXX C - STEP WAS EXECUTED - COND CODE 0000
IEF285I SYS1.MACLIB KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I SYS1.MODGEN KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I HATAM.MACLIB.SRC KEPT
IEF285I VOL SER NOS= ZARES1.
IEF285I SYS21315.T190518.RA000.XXXXXX.SYSUT1.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000102.? SYSOUT
IEF285I SYS21315.T190518.RA000.XXXXXX.OBJ.H01 PASSED
IEF285I VOL SER NOS= ZASYS1.
IEF285I HATAM.ASM.SRC KEPT
IEF285I VOL SER NOS= ZARES1.
IEF373I STEP/C /START 2021315.1905
IEF374I STEP/C /STOP 2021315.1905 CPU 0MIN 00.19SEC SRB 0MIN 00.02SEC VIRT 220K SYS 276K EXT 32768K SYS 10732K
IEF236I ALLOC. FOR XXXXXX L
IEF237I 0A95 ALLOCATED TO SYSLIN
IEF237I DMY ALLOCATED TO
IGD100I 0A95 ALLOCATED TO DDNAME SYSLMOD DATACLAS ( )
IGD100I 0A95 ALLOCATED TO DDNAME SYSUT1 DATACLAS ( )
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF142I XXXXXX L - STEP WAS EXECUTED - COND CODE 0000
IEF285I SYS21315.T190518.RA000.XXXXXX.OBJ.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 PASSED
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.SYSUT1.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000103.? SYSOUT
IEF373I STEP/L /START 2021315.1905
IEF374I STEP/L /STOP 2021315.1905 CPU 0MIN 00.05SEC SRB 0MIN 00.00SEC VIRT 104K SYS 276K EXT 1640K SYS 10724K
IEF236I ALLOC. FOR XXXXXX G
IEF237I 0A95 ALLOCATED TO PGM=*.DD
IEF237I JES2 ALLOCATED TO SYSPRINT
IEF237I JES2 ALLOCATED TO SYSIN
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=0C2 REASON CODE=00000002
TIME=19.05.18 SEQ=00021 CPU=0000 ASID=001A
PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
NAME=GO
DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
GR 0: FD000008 1: 00000000
2: 00000040 3: 008D79D4
4: 008D79B0 5: 008FF350
6: 008C6FE0 7: FD000000
8: 008FCC80 9: 008CFCC8
A: 00000000 B: 008FF350
C: 834C4BAA D: 00006008
E: 80FE507C F: 00007274
END OF SYMPTOM DUMP
IEF472I XXXXXX G - COMPLETION CODE - SYSTEM=0C2 USER=0000 REASON=00000002
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 KEPT
IEF285I VOL SER NOS= ZASYS1.
IEF285I IBMUSER.XXXXXX.JOB00756.D0000104.? SYSOUT
IEF285I IBMUSER.XXXXXX.JOB00756.D0000101.? SYSIN
IEF373I STEP/G /START 2021315.1905
IEF374I STEP/G /STOP 2021315.1905 CPU 0MIN 00.04SEC SRB 0MIN 00.00SEC VIRT 8K SYS 256K EXT 0K SYS 10780K
IEF237I 0A95 ALLOCATED TO SYS00001
IEF285I SYS21315.T190518.RA000.XXXXXX.R0100017 KEPT
IEF285I VOL SER NOS= ZASYS1.
IEF285I SYS21315.T190518.RA000.XXXXXX.GOSET.H01 DELETED
IEF285I VOL SER NOS= ZASYS1.
IEF375I JOB/XXXXXX /START 2021315.1905
IEF376I JOB/XXXXXX /STOP 2021315.1905 CPU 0MIN 00.28SEC SRB 0MIN 00.02SEC
1 High Level Assembler Option Summary (PTF UK37157) Page 1
- HLASM R6.0 2021/11/11 19.05
0 No Overriding ASMAOPT Parameters
No Overriding Parameters
No Process Statements
Options for this Assembly
0 NOADATA
ALIGN
NOASA
BATCH
CODEPAGE(047C)
NOCOMPAT
NODBCS
NODECK
DXREF
ESD
NOEXIT
FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOPAGE0,PUSH,RECORD,NOSUBSTR,USING0)
NOFOLD
NOGOFF
NOINFO
LANGUAGE(EN)
NOLIBMAC
LINECOUNT(60)
LIST(121)
MACHINE(,NOLIST)
MXREF(SOURCE)
OBJECT
OPTABLE(UNI,NOLIST)
NOPCONTROL
NOPESTOP
NOPROFILE
NORA2
NORENT
RLD
RXREF
SECTALGN(8)
SIZE(MAX)
NOSUPRWARN
SYSPARM()
NOTERM
NOTEST
THREAD
NOTRANSLATE
TYPECHECK(MAGNITUDE,REGISTER)
USING(NOLIMIT,MAP,WARN(15))
NOWORKFILE
XREF(SHORT,UNREFS)
No Overriding DD Names
1 External Symbol Dictionary Page 2
-Symbol Type Id Address Length Owner Id Flags Alias-of HLASM R6.0 2021/11/11 19.05
0IOSAMP SD 00000001 00000000 00000251 00
$$PRTOUT ER 00000002
$$IOSECT SD 00000003 00000258 00000D6C 01
$$READCD LD 0000029C 00000003
$$PRTLIN LD 00000268 00000003
$$PRTOUT LD 00000274 00000003
$$DMPOUT LD 00000258 00000003
$$CNVRTO LD 00000284 00000003
$$CNVRTI LD 00000290 00000003
$$READCD ER 00000004
$$PRTLIN ER 00000005
$$CNVRTI ER 00000006
$$CNVRTO ER 00000007
$$DMPOUT ER 00000008
1 Page 3
Active Usings: None
0 Loc Object Code Addr1 Addr2 Stmt Source Statement HLASM R6.0 2021/11/11 19.05
0 1 PRINT NOGEN
000000 00000 00251 2 IOSAMP CSECT ,
R:F 00000 3 USING *,15
000000 1B11 4 SR 1,1
5 *
000002 90EF F00C 0000C 6 PRINTOUT
000024 0700 719 READ READCARD CARDOUT,EOF
00004A 4110 1001 00001 728 LA 1,1(0,1)
00004E 90EF F058 00058 729 PRINTOUT 1
00007C 0700 740 PRINTLIN OUT,LINELEN
00009C 0700 748 CONVERTI 2,CARDOUT
0000BC 0700 756 CONVERTO 2,OUTDATA
0000DC 0700 764 PRINTLIN OUTDATA,L'OUTDATA
0000FC 47F0 F026 00026 772 B READ
000100 0700 773 EOF DUMPOUT IOSAMP,LAST
000128 B982 0033 782 XGR 3,3
00012C B946 0030 783 BCTGR 3,0
000130 0700 784 PRINTOUT 1,19,32,*
000176 D6C9D5D7E4E340D9 799 OUT DC C'OINPUT RECORD = "'
000187 4040404040404040 800 CARDOUT DC CL80' ',C'"'
00062 801 LINELEN EQU *-OUT
0001D8 802 OUTDATA DS CL121
00251 803 LAST EQU *
804 END
1 Relocation Dictionary
1 Macro and Copy Code Source Summary Page 8
- Con Source Volume Members HLASM R6.0 2021/11/11 19.05
0 L1 SYS1.MACLIB ZARES1 CLOSE DCB GET IHBINNRA IHB01 OPEN PUT
L3 HATAM.MACLIB.SRC ZARES1 $$GENIO CONVERTI CONVERTO DUMPOUT PRINTLIN PRINTOUT
READCARD
1 Diagnostic Cross Reference and Assembler Summary Page 11
- HLASM R6.0 2021/11/11 19.05
0 No Statements Flagged in this Assembly
HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 6.0, PTF UK37157
0SYSTEM: z/OS 01.10.00 JOBNAME: XXXXXX STEPNAME: C PROCSTEP: (NOPROC)
0Data Sets Allocated for this Assembly
Con DDname Data Set Name Volume Member
P1 SYSIN HATAM.ASM.SRC ZARES1 MACSAMP
L1 SYSLIB SYS1.MACLIB ZARES1
L2 SYS1.MODGEN ZARES1
L3 HATAM.MACLIB.SRC ZARES1
SYSLIN SYS21315.T190518.RA000.XXXXXX.OBJ.H01 ZASYS1
SYSPRINT IBMUSER.XXXXXX.JOB00756.D0000102.?
31992K allocated to Buffer Pool Storage required 512K
24 Primary Input Records Read 3805 Library Records Read 0 Work File Reads
0 ASMAOPT Records Read 383 Primary Print Records Written 0 Work File Writes
80 Object Records Written 0 ADATA Records Written
0Assembly Start Time: 19.05.18 Stop Time: 19.05.18 Processor Time: 00.00.00.1433
Return Code 000
1z/OS V1 R10 BINDER 19:05:17 THURSDAY NOVEMBER 11, 2021
BATCH EMULATOR JOB(XXXXXX ) STEP(L ) PGM= HEWL
IEW2278I B352 INVOCATION PARAMETERS - MAP,LET,LIST
IEW2650I 5102 MODULE ENTRY NOT PROVIDED. ENTRY DEFAULTS TO SECTION IOSAMP.
1 *** M O D U L E M A P ***
---------------
CLASS B_TEXT LENGTH = FC4 ATTRIBUTES = CAT, LOAD, RMODE= 24
OFFSET = 0 IN SEGMENT 001 ALIGN = DBLWORD
---------------
SECTION CLASS ------- SOURCE --------
OFFSET OFFSET NAME TYPE LENGTH DDNAME SEQ MEMBER
0 IOSAMP CSECT 251 SYSLIN 01 **NULL**
258 $$IOSECT CSECT D6C SYSLIN 01 **NULL**
0 258 $$DMPOUT LABEL
10 268 $$PRTLIN LABEL
1C 274 $$PRTOUT LABEL
2C 284 $$CNVRTO LABEL
38 290 $$CNVRTI LABEL
44 29C $$READCD LABEL
1 *** DATA SET SUMMARY ***
DDNAME CONCAT FILE IDENTIFICATION
SYSLIN 01 SYS21315.T190518.RA000.XXXXXX.OBJ.H01
*** E N D O F M O D U L E M A P ***
1PROCESSING OPTIONS:
ALIASES NO
ALIGN2 NO
AMODE UNSPECIFIED
CALL YES
CASE UPPER
COMPAT UNSPECIFIED
COMPRESS AUTO
DCBS NO
DYNAM NO
EXTATTR UNSPECIFIED
EXITS: NONE
FILL NONE
GID UNSPECIFIED
HOBSET NO
INFO NO
LET 08
LINECT 060
LIST SUMMARY
LISTPRIV NO
MAP YES
MAXBLK 032760
MODMAP NO
MSGLEVEL 00
OVLY NO
PRINT YES
RES NO
REUSABILITY UNSPECIFIED
RMODE UNSPECIFIED
STORENX NOREPLACE
STRIPCL NO
STRIPSEC NO
TERM NO
TRAP ON
UID UNSPECIFIED
UPCASE NO
WKSPACE 000000K,000000K
XCAL NO
XREF NO
***END OF OPTIONS***
1SAVE OPERATION SUMMARY:
MEMBER NAME GO
LOAD LIBRARY SYS21315.T190518.RA000.XXXXXX.GOSET.H01
PROGRAM TYPE LOAD MODULE
VOLUME SERIAL ZASYS1
MAX BLOCK 32760
DISPOSITION ADDED NEW
TIME OF SAVE 19.05.18 NOV 11, 2021
1SAVE MODULE ATTRIBUTES:
AC 000
AMODE 24
COMPRESSION NONE
DC NO
EDITABLE YES
EXCEEDS 16MB NO
EXECUTABLE YES
MIGRATABLE YES
OL NO
OVLY NO
PACK,PRIME NO,NO
PAGE ALIGN NO
REFR NO
RENT NO
REUS NO
RMODE 24
SCTR NO
SSI
SYM GENERATED NO
TEST NO
XPLINK NO
MODULE SIZE (HEX) 00000FC8
1 ENTRY POINT AND ALIAS SUMMARY:
NAME: ENTRY TYPE AMODE C_OFFSET CLASS NAME STATUS
IOSAMP MAIN_EP 24 00000000 B_TEXT
***** E N D O F R E P O R T *****
1z/OS V1 R10 BINDER 19:05:17 THURSDAY NOVEMBER 11, 2021
BATCH EMULATOR JOB(XXXXXX ) STEP(L ) PGM= HEWL
IEW2008I 0F03 PROCESSING COMPLETED. RETURN CODE = 0.
1----------------------
MESSAGE SUMMARY REPORT
----------------------
TERMINAL MESSAGES (SEVERITY = 16)
NONE
SEVERE MESSAGES (SEVERITY = 12)
NONE
ERROR MESSAGES (SEVERITY = 08)
NONE
WARNING MESSAGES (SEVERITY = 04)
NONE
INFORMATIONAL MESSAGES (SEVERITY = 00)
2008 2278 2650
**** END OF MESSAGE SUMMARY REPORT ****
是JCL错了还是我应该去别的地方找问题?
您的私有宏 PRINTOUT 有问题,或者在您的汇编程序源代码的第 6 行中调用宏之前所做的设置有问题。我不知道它是什么,因为你没有提供有关该宏的详细信息(其他人建议使用 PRINT GEN 重新运行该作业)。
缺乏更多信息,这是我对发生的事情的分析:
这是作业日志中打印的 ABEND 信息
PSW AT TIME OF ERROR 078D1000 00007010 ILC 4 INTC 02
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
NAME=GO
DATA AT PSW 0000700A - 1EEF80FD DE080000 70000000
GR 0: FD000008 1: 00000000
2: 00000040 3: 008D79D4
4: 008D79B0 5: 008FF350
6: 008C6FE0 7: FD000000
8: 008FCC80 9: 008CFCC8
A: 00000000 B: 008FF350
C: 834C4BAA D: 00006008
E: 80FE507C F: 00007274
END OF SYMPTOM DUMP
第一行的 INTC 02
告诉您程序失败 'privileged-operation exception'。非授权程序(例如您的程序)中的特权操作异常通常表明程序跳转到了错误的地址,而且 - 幸运的是 - 在该地址没有有效指令。 (为什么幸运?因为如果在该地址有 valid 指令,调试起来会更困难。)
除了一些与存储相关的指令异常,PSW下一条顺序指令地址(NSI)指向失败指令后的下一条指令. NSI 是以 'PSW AT TIME OF ERROR' 开头的行中的第二个数字部分,即 00007010
.
第一行的 ILC 4
告诉您失败的指令是一条 4 字节指令。鉴于 NSI 指向 next 指令,失败的指令位于地址 00007010 - 4 = 0000700C
(请注意,地址以十六进制表示法显示,即 10 - 4 = C。)
所以程序一直在执行指令,直到它从地址 0000700C
上面第二行
ACTIVE LOAD MODULE ADDRESS=00007000 OFFSET=00000010
告诉您程序已在地址 00007000
处加载,并且失败发生在活动加载模块(程序)内的偏移量 00000010
处。
汇编程序列表列出了以偏移量0
开头的指令,所以我们可以取上面的offest,并从中减去ILC4
,得知失败指令的偏移量是00000C
.
Loc Object Code Addr1 Addr2 Stmt Source Statement
1 PRINT NOGEN
000000 00000 00251 2 IOSAMP CSECT ,
R:F 00000 3 USING *,15
000000 1B11 4 SR 1,1
5 *
000002 90EF F00C 0000C 6 PRINTOUT
000024 0700 719 READ READCARD CARDOUT,EOF
Offset 00000C
在列表中位于 000002
和 000024
之间,因此它在汇编程序源代码第 6 行的 PRINTOUT
宏生成的代码内.
由于PRINT NOGEN
,我们只能看到生成的第一条指令,其代码为90EF F00C
,也就是STM 14,15,12(15)
。这将寄存器 14 和 15 的内容存储在从寄存器 15 中的地址偏移量 12 开始的连续字节中。
此时寄存器15的地址是多少?根据所示的汇编程序指令,我们可以说它是程序入口处寄存器 15 的值。在 z/OS 中,这是程序入口点的地址(除了这里没有讨论的特殊情况)。所以寄存器 15 在入口处是 00007000
并且在修改之前将保持不变。它不会修改到 STM
指令。因此,寄存器 14 和 15 从地址 0000700C
.
存储寄存器的地址 0000700C
是不是很眼熟?是的,它确实。它是失败指令的地址(见上文)。
因此程序将地址 0000700C
开始的字节解释为 指令 ,其中它实际上是寄存器 14 和 15 的内容。在 z/OS,在程序入口处,寄存器 14 包含 return 地址(同样,特殊情况除外)。
程序存储的前几个字节如下所示:
00-01 = 1B11 = SR 1,1
02-05 = 90EF F00C = STM 14,15,12(15)
06 = ??
07 = ??
08 = ??
09 = ??
0A = ??
0B = ??
0C-0F = ???? ???? = content of register 14 at entry (= return address)
10-13 = 0000 7000 = content of register 15 at entry (= program entry point)
我们不知道字节 06-0B 的内容,但应该认为它们是指令,并且可能是 PRINTOUT
宏生成的数据。
一个有趣的细节是寄存器 15 的内容(15 是 x'0F')在故障发生时。这显示在 END OF SYMPTOM DUMP
E: 80FE507C F: 00007274
寄存器 15 包含 00007274
,因此它被字节 06-0B 中的指令修改。它指向哪里?它指向地址 00007274
,或 00007274
- 00007000
(程序的地址)= 偏移量 274
。汇编程序列表显示程序在偏移量 00251
处结束,因此偏移量 274
超出了此代码。
000187 4040404040404040 800 CARDOUT DC CL80' ',C'"'
00062 801 LINELEN EQU *-OUT
0001D8 802 OUTDATA DS CL121
00251 803 LAST EQU *
804 END
因此,在汇编程序语句显示的生成代码之外注册了 15 个点。查看活页夹列表,我们可以找出偏移量 274
是否仍在加载模块的存储范围内,如果是在哪一部分。
SECTION CLASS ------- SOURCE --------
OFFSET OFFSET NAME TYPE LENGTH DDNAME SEQ MEMBER
0 IOSAMP CSECT 251 SYSLIN 01 **NULL**
258 $$IOSECT CSECT D6C SYSLIN 01 **NULL**
0 258 $$DMPOUT LABEL
10 268 $$PRTLIN LABEL
1C 274 $$PRTOUT LABEL
加载模块中的 Offset 274
是名为 $$PRTOUT
的例程的开始,它似乎与汇编程序源代码中的 PRINTOUT
宏有关。因此,寄存器 15 指向例程 $$PRTOUT
的入口点。这表明寄存器 15 已经加载了例程 $$PRTOUT
的入口点地址。这很可能是由程序中06-0B区的指令完成的。
一切似乎都很合适。该程序似乎准备调用例程$$PRTOUT
,但不知何故缺少'jump'指令,例如BALR 14,15
,最常用于跳转到子例程。
但是,只有知道 06-0B 区域中的指令才能找到确切的问题。
并回答您的一个问题:不,JCL 没有任何问题。