Home > OS >  How should I get inputs and print outputs in IBM z/OS assembler?
How should I get inputs and print outputs in IBM z/OS assembler?

Time:11-16

I'm trying to use some simple I/O macros introduced in book "Assembler Language Programming for IBM Z System Servers" (Macros introduced in Appendix B section). But when I'm tryin to run the sample program, as soon as program reach the first macro system dump occurs. Also there is IEF686I in the output. I'm a student learning IBM assembly language and I'm not familiar with JCL and I don't know if I'm doing something wrong in it. Is the format of getting input and assigning the output area OK or I should do it in a different way? Here is the 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
/*

Note that HATAM.MACLIB.SRC is the data set containing i/o macros ($$GENIO, CONVERTI, ...). And here is the output:

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 ****

Is the JCL wrong or I should seek the problem somewhere else?

CodePudding user response:

Something is wrong with your private macro PRINTOUT, or something is wrong with the stetup done before calling the macro in line 6 of your assembler source. I can't tell what it is, because you didn't provide details about that macro (others have suggested to rerun the job with PRINT GEN).

Lack of more information, this is my analysis of what happened:

This is the ABEND information printed in the joblog

 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

The INTC 02 in the first line tells you that the program failed with a 'privileged-operation exception'. A privileged-operation exception in a non-authorized program, such as yours, is most always an indication that the program jumped to a wrong address, and - luckily - there was no valid instruction at that address. (Why luckily? Because it would be more difficult to debug if there was a valid instruction at that address.)

Except from some storage related instruction exceptions, the PSW next sequential instruction address (NSI) points to the next instrucion after the failing one. The NSI is the second numeric part on the line beginning with 'PSW AT TIME OF ERROR', i.e. 00007010.

The ILC 4 in the first line tells you that the failing instruction was a 4 byte instruction. Given the NSI points to the next instruction, the failing instruction is at address 00007010 - 4 = 0000070C (note that adresses are shown in hexadecimal notation, this 10 - 4 = C.)

So the program was executing instructions until it fetched the next instruciton from address 0000700C

The second line above

ACTIVE LOAD MODULE           ADDRESS=00007000  OFFSET=00000010

tells you that the program was loaded at address 00007000, and that the failure was at offset 00000010 within the active load module (program).

The assembler listing lists the instructions beginning with offset 0, so we can take the offest above, and subtract the ILC 4 from it, to learn that the offset of the failing instruction is 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 is between 000002 and 000024 in the listing, so it is within the code generated by the PRINTOUT macros at line 6 of the assembler source.

Due to the PRINT NOGEN, we can only see the first instruction generated, of which the code is 90EF F00C, which is STM 14,15,12(15). This stores the content of registers 14, and 15 at consecutive bytes starting at offset 12 from the address in register 15.

What is the address in register 15 at that time? Given the assembler instructions shown, we can say it is the value that register 15 had at entry to the program. In z/OS, this is the address of the entry point into program (except from special cases not discussed here). So register 15 is 00007000 at entry and will stay so until modified. It is not modified up to the STM instruction. So, registers 14, and 15 are stored starting at address 0000700C.

Does this address 0000700C, where registers are stored look familiar? Yes, it does. It is the address of the failing instruction (see above).

So the program interprets the bytes starting at address 0000700C as an instruction, where it actually is the content of registers 14, and 15. In z/OS, at entry to a program, register 14 contains the return address (again except from special cases).

The first few bytes of the program storage look like this:

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)

We do not know the content of bytes 06-0B, but should expect them to be instrucitons, and possibly data generated by the PRINTOUT macro.

An interesting detail is the content of register 15 (15 is x'0F') at the time of the failure. This is shown in the line just before the line END OF SYMPTOM DUMP

E: 80FE507C   F: 00007274

Register 15 contains 00007274, so it was modified by the instrucitons in the bytes 06-0B. Where does it point to? It points to address 00007274, or 00007274 - 00007000 (the program's address) = offset 274. The assembler listing shows that the program ends at offset 00251, so offset 274is beyond this code.

000187 4040404040404040             800 CARDOUT DC CL80' ',C'"'
                      00062         801 LINELEN EQU *-OUT
0001D8                              802 OUTDATA DS CL121
                      00251         803 LAST    EQU *
                                    804         END   
   

So register 15 points beyond the code generated by the assembler statements show. Lookging at the binder listing, we can find out if offset 274 is still within the storage of the load module, and if so in what part.

  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 in the load module is the start of a routine called $$PRTOUT, which somehow seems to relate to the PRINTOUT macro seen in the assembler source. So, register 15 is pointing at the entry point of routine $$PRTOUT. This indicates that register 15 has been loaded with the entry point address of routine $$PRTOUT. This is most likely done by instructions in the area 06-0B in the program.

All seems to fit nicely. The program seems to be prepared to call routine $$PRTOUT, but somehow lacks a 'jump' instruction, such as BALR 14,15, which is most often used to jump to a subroutine.

The exact problem, however, can only be found when the instructions in the area 06-0B are known.

And to answer one of your questions: No there is nothing wrong with the JCL.

  • Related