Description

You can use the SNAP macro to obtain a dump of some or all of the storage assigned to the current job step. You can also dump some or all of the control program fields. The SNAP macro causes the specified storage to be displayed in the addressing mode of the caller.

Descriptions of the SNAP and SNAPX macros in this information are:
There are three ways to obtain a dump:
  1. Spool the dump by specifying SYSOUT=x on the DD statement. The dump is printed without a separate job but is deferred until after the job ends.
  2. Select a tape or direct access device. This method requires a separate job step to print the dump. This method might be used if the dump is to be printed more than once.
  3. Select a printer on the DD statement. This method is almost never used because the printer cannot be used by anyone else for the duration of the job step.

Both NUC and ALLVNUC are valid. Only ALLVNUC gives you the whole virtual nucleus. For more information about the SNAP macro, see z/OS MVS Programming: Assembler Services Guide.

Note: The SNAP and SNAPX macros have the same environment specifications, register information, programming requirements, restrictions and limitations, performance implications, and return codes described below. However, IBM® recommends that programs in access register (AR) address space control (ASC) mode use SNAPX. All parameters on SNAP are valid on SNAPX.

Environment

The requirements for the caller are:

Environmental factor Requirement
Minimum authorization: Problem state and any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN=HASN=SASN
AMODE: 24- or 31-bit
ASC mode: Primary or AR
Note: If your program is in AR mode and you issue SNAP rather than SNAPX following SYSSTATE ASCENV=AR, the system substitutes the SNAPX macro and issues a message telling you that it made the substitution.
Interrupt status: Enabled for I/O and external interrupts
Locks: No locks held, and no enabled, unlocked task (EUT) FRRs established
Control parameters: Must be in the primary address space

Input register information

Before issuing the SNAP(X) macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.

Output register information

When control returns to the caller, the general purpose registers (GPRs) contain:
Register
Contents
0-1
Used as work registers by the system
2-14
Unchanged
15
Return code
When control returns to the caller, the access registers (ARs) contain:
Register
Contents
0-1
Used as work registers by the system
2-13
Unchanged
14-15
Used as work registers by the system

Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after regaining control.

Programming requirements

Before you issue the SNAP macro, you must open the DCB that you designate on the DCB parameter, and ensure that the DCB is not closed until the SNAP macro returns control. To open the DCB, issue the DCB macro with the following parameters, and issue an OPEN macro for the data set (the DCB and OPEN macros are described in MVS/DFP Macro Instructions for Data Sets):
DSORG=PS,RECFM=VBA,MACRF=(W),BLKSIZE=nnn,LRECL=xxx,
and DDNAME=any name but SYSABEND, SYSMDUMP or SYSUDUMP

If the DD name for the SNAP dump has the XTIOT, UCB nocapture, or DSAB-above-the-line options of dynamic allocation, your DCB must point to a DCBE before you open the DCB. The DCBE must have the LOC=ANY option. You can code that even if the DD name does not have any of these dynamic allocation options. To point the DCB to the DCBE, code the DCBE operand on the DCB macro, or store into the DCBDCBE field if you also turn on the DCBH0 and DCBH1 bits. The DCBE can reside above the 16 MB line even if your program runs in 24-bit.

In order for the OPEN for the DCB to succeed, it is necessary for the NON_VSAM_XTIOT=YES option in the DEVSUPxx member of PARMLIB to be active.

For dynamic allocation, XTIOT option bit is S99TIOTEX, the UCB nocapture option bit is S99ACUCB, and the DSAB-above-the-line option bit is S99DSABA. These options are defined by the IEFZB4D0 macro. For more information about the XTIOT option for dynamic allocation of the dump data set, see S99PARMS programming interface in MVS Data Area Volume 6 from z/OS Internet Library.

If a standard dump of 120 characters per line is requested, BLKSIZE must be either 882 or 1632, and LRECL must be 125. A high-density dump printed on a 3800 Printing Subsystem has 204 characters per line. To obtain a high-density dump, you must code CHARS=DUMP on the DD statement describing the dump data set. The BLKSIZE= must be either 1470 or 2724, and the LRECL= must be 209. You can also code CHARS=DUMP on the DD statement describing a dump data set that will not be printed immediately. If you specify CHARS=DUMP and the output device is not a 3800, print lines are truncated and print data is lost. If you open a SNAP data set in a problem program that will be processed by the system loader, your problem program must close the data set.

The DCB and TCB must reside in 24-bit addressable storage. All other parameters can reside above 16 megabytes if the issuer is executing in 31-bit addressing mode.

If the program is in AR mode, issue SNAPX rather than SNAP; issue the SYSSTATE ASCENV=AR macro before SNAPX. SYSSTATE ASCENV=AR tells the system to generate code appropriate for AR mode.

Restrictions

None.

Performance implications

None.

Syntax

The standard form of the SNAP macro is written as follows:

Syntax Description
   
   name name: Symbol. Begin name in column 1.
   
One or more blanks must precede SNAP.
   
SNAP  
   
One or more blanks must follow SNAP.
   
DCB=dcb addr dcb addr: A-type address, or register (2) - (12).
   
   ,TCB=tcb addr tcb addr: A-type address, or register (2) - (12).
   
   ,ID=id nmbr id nmbr: Symbol, decimal digit, or register (2) - (12).
  Value range: 0-255
   
   ,SDATA=ALL  
   ,SDATA=(sys data code) sys data code: Any combination of the following, separated by commas. If you specify only one code, you do not need the parentheses.
 
NUC      CB        ERR
SQA      Q         IO
LSQA     TRT       ALLVNUC
PCDATA
SWA      DM        SUM
   
   ,PDATA=ALL  
   ,PDATA=(prob data code) prob data code: Any combination of the following, separated by commas. If you specify only one code, you do not need the parentheses.
   
 
PSW
REGS
SA or SAH
JPA or LPA or ALLPA
SPLS
SUBTASKS
   

   ,STORAGE=(strt addr,end
    addr)
   ,LIST=list addr

strt addr: A-type address, or register (2) - (12).
end addr:  A-type address, or register (2) - (12).
list addr:  A-type address, or register (2) - (12).

  Note: One or more pairs of addresses may be specified, separated by commas. For example: STORAGE=(strt addr,end addr, strt addr,end addr)
   
   ,STRHDR=(hdr addr) hdr addr: A-type address, or register (2) - (12).
   ,STRHDR=hdr list addr Note: hdr addr is one or more addresses separated by commas. If you specify only one header address as an A-type address, you do not need the parentheses. If you specify one or more registers, then you must code double parentheses (one set enclosing each register and one set enclosing the list of registers). If STRHDR=(hdr addr) is specified, then STORAGE must also be specified.
 

hdr list addr:  A-type address, or register (2) - (12).
Note:  If STRHDR=hdr list addr is specified, then LIST
must also be specified.

   
   ,SUBPLST=sbp list addr sbp list addr: A-type address, or register (2) - (12).
   

Parameters

The parameters are explained as follows:

DCB=dcb addr
Specifies the address of a previously opened data control block for the data set that is to contain the dump.
Note:
  1. DCB must reside in 24-bit addressable storage.
  2. The DCB parameter is not required when you issue the list form of SNAP or SNAPX to format a parameter list for the DUMPOPT/DUMPOPX parameter of the ABEND, CALLRTM, or SETRP macros. If the parameter list you specify on DUMPOPT/DUMPOPX contains a DCB value, the system overrides it. The DCB parameter is required when you issue the list form of SNAP or SNAPX to format a parameter list for an execute form of SNAP or SNAPX if the execute form does not specify the DCB parameter. That is, if you specify both a list and execute form of SNAP or SNAPX, you must specify DCB on one or the other.
  3. If the DD name for the SNAP dump has the XTIOT, UCB nocapture, or DSAB-above-the-line options of dynamic allocation, your DCB must point to a DCBE before you open the DCB. See the "Programming Requirements" section for more details.
,TCB=tcb addr
Specifies the address of a fullword on a fullword boundary containing the address of the task control block for a task of the current job step. If omitted, or if the fullword contains 0, the dump is for the active task. If a register is designated, the register can contain 0 to indicate the active task, or can contain the address of a TCB.
Note: TCB must reside in 24-bit addressable storage.
,ID=id nmbr
Specifies the number that is to be printed in the identification heading with the dump. If the number specified is not in the acceptable value range, it will not be printed properly in the heading.
,SDATA=ALL
,SDATA=(sys data code)
Specifies the system control program information to be dumped:
ALL
All of the SDATA options except ALLVNUC (The read-only portion of the nucleus is not included in the dump unless ALLVNUC is also specified as an option.)
NUC
The PSA, SQA, LSQA, and the read/write portion of the nucleus (if the entire nucleus is required, specify the ALLVNUC option.)
Note: The CVT will be included if this option is specified.
SQA
The system queue area (subpools 226, 239, and 245).
LSQA
The local system queue area and subpools 229, 230, and 249.

Note: Subpools 229, 230, and 249 will be dumped only for the current task.

SWA
The scheduler work area related to the task (subpools 236 and 237).
CB
The control blocks for the task.
Q
The global resource serialization control blocks for the task.
TRT
The GTF trace and system trace data. If system tracing is active and the requestor is authorized, all system trace entries for all address spaces are included in the dump. Unauthorized requestors obtain those system trace entries, after the job-start time stamp in the ASCB, for their current address space. If GTF tracing is active, only the GTF trace entries for the current address space are included in the dump.
DM
Data management control blocks for the task.
ERR
Recovery/termination control blocks for the task. These control blocks summarize information that describes abnormal terminations of the task.
IO
Input/Output supervisor control blocks for the task.
ALLVNUC
The entire virtual nucleus, the PSA, LSQA, and SQA. (The NUC option will not dump the read-only section of the nucleus.) If the SNAP parameter list is used for a SYSMDUMP, the ALLVNUC option is converted to ALLNUC on the SVC dump parameter list.
Note: The CVT is included if this option is specified.
PCDATA
Program call information for the task.
The SUM option is valid for an abending task or on a list form of the SNAP macro pointed to by the DUMPOPT keyword of the ABEND or SETRP macro. The option SUM causes the dump to contain a summary dump. If SUM is the only option requested, the dump contains a dump header, control blocks, and the other areas listed below. The header information, which is provided for all ABEND dumps, consists of the following information:
  • The dump title
  • The ABEND code and program status word (PSW) at the time of the error
  • If the PSW contains the address of an active load module:
    • The name and PSW address of the load module in error
    • The offset, into the load module, at which the error occurred
The following control blocks and areas are also included in the dump:
  • The control blocks dumped for the CB option
  • The error control blocks (RTM2WAs and SCBs)
  • The save areas
  • The registers at the time of the error, except for register 1
  • The contents of the load module (if the PSW contains the address of an active load module)
  • The module pointed to by the last PRB (if it can be found)
  • 1K of storage before and after the addresses pointed to by the PSW and the registers at the time of the error
    Note: This storage will only be dumped if the caller is authorized to obtain it. The storage is printed by ascending storage addresses with duplicate addresses removed.
  • System trace entries after the job-start time stamp in the ASCB for the current address space
    Note: The GTF trace records are not included.

If other options are specified with SUM, the summary dump is dispersed throughout the dump.

,PDATA=ALL
,PDATA=(prob data code)
Specifies the problem program information to be dumped:
ALL
All of the following fields.
PSW
Program status word when the SNAP or ABEND macro was issued.
REGS
Contents of the floating-point registers and general-purpose registers when the SNAP or ABEND macro was issued. Also, contents of the vector registers, vector status register, and the vector mask register when the SNAP or ABEND macro was issued for any task that uses the Vector Facility.
SA
Save area linkage information, program call linkage information, and a back trace through save areas.
SAH
Save area linkage information and program call linkage information.
JPA
Contents of job pack area.
LPA
Contents of active link pack area for the requested task.
ALLPA
Contents of job pack area and active link pack area for the requested task.
SPLS
Virtual storage subpools 0-127, 131-132, 252.
SUBTASKS
The designated task and the program data information for all of its subtasks.
,STORAGE=(strt addr,end addr)
,LIST=list addr
Specifies one or more pairs of starting and ending addresses or a list of starting and ending addresses of areas to be dumped. Each starting address is rounded down to a fullword boundary; each ending address is rounded up to a fullword boundary. The area is then dumped in fullword increments. Callers executing in either 24-bit or 31-bit addressing mode must set the high-order bit of the fullword containing the last address in this list to 1. Callers executing in 31-bit addressing mode must ensure that this bit is cleared in all other addresses in the list because SNAP processing truncates the list at the first address that contains a 1 in the high order bit.
,STRHDR=(hdr addr)
,STRHDR=hdr list addr
Specifies one or more header addresses or the address of a list of header addresses. Each header address must be the address of a one byte header length field, which is followed by the text of the header. The header has a maximum length of 100 characters.

If the STORAGE parameter was specified, the STRHDR (storage header) value must be one or more header addresses. The number of pairs of starting and ending addresses specified for STORAGE must be the same as the number of header addresses specified for STRHDR. If a header is not desired for a storage area, a comma must be used to indicate its absence.

If the LIST parameter was specified, the STRHDR value must be the address of a list of header addresses. The list of addresses must begin on a fullword boundary, and the high order bit of the fullword containing the last address of the list must be set to 1. The number of pairs of starting and ending addresses supplied with the LIST parameter must be the same as the number of addresses in the list supplied with STRHDR. If a header is not desired for a storage area, the STRHDR list must contain a zero address to indicate its absence.

,SUBPLST=sbp list addr
Specifies the address of a list of subpool numbers to be dumped. Each entry in the list must be a two-byte entry and must specify a valid subpool number. The first halfword of the list must contain the number of subpools in the list and must be on a fullword boundary. If you specify an invalid subpool number or a subpool number for which you do not have authorization, the number is skipped and you receive a comment in the dump output indicating the error. If a subpool contains 4k blocks of data that are mapped from a linear data set, the dump includes only the blocks that have changed since the last DIV SAVE function was invoked.
Note: A maximum of seven subpool numbers is permitted on the list form of the SNAP macro pointed to by the DUMPOPT keyword of ABEND or SETRP.

Return and reason codes

Control is returned to the instruction following the SNAP macro. When control is returned, register 15 contains one of the following return codes:

Hexadecimal Code Meaning
00 Successful completion.
04 Data control block was not open, or an invalid page exception occurred during the validity check of the DCB parameters.
08 Task control block address was not valid, an invalid page reference occurred during the validity check of the TCB address, a subtask is a job step task, sufficient storage was not available, or the READ for JFCB or JFCBE failed. In all cases, the dump is canceled. (Message IEA997I is issued when the READ for JFCB or JFCBE fails.)

Or, the ALET for SNAP parameter list or the ALETs for areas pointed to by the parameter list are not valid.

0C Data control block type (DSORG, RECFM, MACRF, BLKSIZE, or LRECL) was incorrect, or the DCB's BLKSIZE and/or LRECL were not compatible with the dump format options specified on the dump-related DD statement.
10 DEBCHK TYPE=VERIFY function failed. This may be due to DEBDCBAD not pointing to the DCB (or ACB) passed to DEBCHK.

Example 1

Dump the storage ranges pointed to by register 9, and dump all PDATA and SDATA options.
SNAP   DCB=(8),TCB=(5),PDATA=ALL,SDATA=ALL,LIST=(9)

Example 2

Dump the storage ranges pointed to by register 9, and dump only the trace table and enqueue control blocks.
SNAP   DCB=(8),TCB=(5),ID=4,LIST=(9),SDATA=(TRT,Q)

Example 3

Dump storage area 1000-2000 with no header, and dump storage area 3000-4000 with a header of ‘USER LABEL ONE’. The comma specified in the value for STRHDR indicates that no header is wanted for storage area 1000-2000.
       SNAP   DCB=(8),STORAGE=(1000,2000,3000,4000),   X
              STRHDR=(,L1)
       .
       .
       .
L1     DC     AL1(L'HDR1)
HDR1   DC     C'USER LABEL ONE'

Example 4

Dump storage area 1000-1999 with a header of ‘LABEL ONE’ and dump storage area 3000-3999 with a header of ‘LABEL TWO’.
       SNAP   DCB=(8),LIST=X,STRHDR=L1
       .
       .
       .
X      DC  A(1000)          Start address
       DC  A(1999)          End address
       DC  A(3000)          Start address
       DC  X'80'            End of list indicator
       DC  AL3(3999)        End address
L1     DC  A(HDR1)          Address of length label for
                            header one
       DC  X'80'            End of list
       DC  AL3(HDR2)        Address of length label for
                            header two
HDR1   DC  AL1(L'HDR1A)     Length of header one
HDR1A  DC  C'LABEL ONE'     Header one
HDR2   DC  AL1(L'HDR2A)     Length of header two
HDR2A  DC  C'LABEL TWO'     Header two

Example 5

Dump subpool 0, 1, and 2 storage related to the current TCB.
SNAP DCB=XYZ,TCB=0,SUBPLST=SUBADDR
           .
           .
           .
SUBADDR DS OF          Fullword boundary
        DC X'0003'     Number of entries in the list
        DC X'0000'     Subpool 0
        DC X'0001'     Subpool 1
        DC X'0002'     Subpool 2