DRS (Disk Record Scan)

Purpose
Locate data on a disk.
Usage notes
Use this function to locate physical disk records containing data that meet your search criteria. The scan range must be specified as a range of tracks.
You can search for a specific string or for end-of-file records. The search string can contain up to 50 characters and can be:
  • A character string. The string cannot contain blanks or commas. Case (uppercase or lowercase) is ignored.
  • A character string enclosed in quotation marks. The string can contain blanks and commas and must match exactly (including case).
  • A hexadecimal string, for example X'04'.

Z Data Tools prints all matching records in hexadecimal dump format and lists on the terminal the record location and the position of the string.

Options
Specify a record length to deblock the physical records before searching. The search can apply to the key or data part of the record. You can request searching everywhere in the data, from a position you specify, or only at the specified offset.
You can use the various SET processing options to control the print output:
  • SET PRINTOUT defines the destination of the print output. If set to PRINTOUT=SYSOUT, you can use the PB (Print Browse) function to browse the accumulated output.
  • SET RECLIMIT controls how many bytes of each record are printed.
  • The format of the print output also depends on the settings of SET PAGESIZE, SET PRINTLEN, and SET PRTTRANS.
  • Use SET DUMP to specify the dump format.
Related functions
DP
Print physical disk records
FCH
Find or change data
Read syntax diagramSkip visual syntax diagram
Syntax

>>-DRS--+-INPUT=ddname--------------------+--+-------------+---->
        +-DSNAME=dsname-+---------------+-+  '-BEGIN=begin-'   
        |               '-VOLSER=volser-' |                    
        '-VOLSER=volser-------------------'                    

>--+---------+--SCANTYPE=scantype--+-----------------+---------->
   '-END=end-'                     '-RECSIZE=recsize-'   

   .-SCANPOS=1-------.                        
>--+-----------------+--+-----------------+--------------------><
   '-SCANPOS=scanpos-'  '-SCANARG=scanarg-'   

begin
Start position in one of the following forms:
cylhd
Where the last two digits represent the head, and the other digits represent the cylinder (CKD)
Rnnnnnn
To indicate the track number (CKD)
*
The first track of the data set (the default).

Depending on the value of the SET CYLHD processing option, you specify either the absolute disk location or the relative location within the data set.

ddname
Refers to a DD or TSO ALLOC statement.
dsname
Name of a disk data set.
end
End position in one of the following forms:
cylhd
Where the last two digits represent the head, and the other digits represent the cylinder (CKD)
Rnnnnnn
To indicate the track number (CKD)
Nnnnnnnn
The number of tracks (CKD) to be processed
*
The last track of the data set (the default).

Depending on the value of the SET CYLHD processing option, you specify either the absolute disk location or the relative location within the data set.

recsize
Logical record size to be used to deblock each physical record into logical records. The maximum is 65 535. The physical block size does not need to be a multiple of recsize.
scanarg
The string to be searched for. The string can contain up to 50 characters and can be:
  • A character string. The string cannot contain blanks or commas. Case (uppercase or lowercase) is ignored.
  • A character string enclosed in quotation marks. The string can contain blanks and commas; the string must match exactly (including case).
  • X followed by a hexadecimal string enclosed in quotation marks (X'C1C2'), or a hexadecimal string enclosed in quotation marks followed by X ('C1C2'X).

The scanarg parameter is required unless scantype is E.

scanpos
Offset (byte position) where the search begins within a record. The default is 1.
scantype
One of the following:
D
Scans data fields only at the position in the record specified by scanpos
DP
Scans data fields starting at the position in the record specified by scanpos
K
Scans key fields only at the position in the record specified by scanpos (CKD disks only)
KP
Scans key fields starting at the position in the record specified by scanpos (CKD only)
E
Scans for end-of-file records.
volser
Volume serial number for a non-cataloged data set.
//DRS JOB (acct),'name'  Disk Record Scan
//*
//HFMBAT    PROC
//HFMBAT    EXEC PGM=HFMMAIN
//STEPLIB  DD DSN=HFM.SHFMMOD1,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSABEND DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//         PEND
//*
//DELETE   EXEC PGM=IEFBR14
//SYSUT2   DD DSN=HFMUSER.TEMP.SEARCH.FILE,
//            DISP=(MOD,DELETE),
//            UNIT=SYSALLDA,
//            SPACE=(TRK,(3,1),RLSE),
//            RECFM=FB,LRECL=80,BLKSIZE=24000
//*
//MAKEFILE EXEC PGM=IEBGENER
//SYSIN    DD *
/*
//SYSPRINT DD SYSOUT=*
//SYSUT1   DD *
Andrew Apple
Ted Dexter
Grant Smith
Keith Sampson
Graham Prestcott
John Laws
Bill McCork
Liz Childs
/*
//SYSUT2   DD DSN=HFMUSER.TEMP.SEARCH.FILE,
//            DISP=(,CATLG),
//            UNIT=SYSALLDA,
//            SPACE=(TRK,(3,1),RLSE),
//            RECFM=FB,LRECL=80,BLKSIZE=24000
//*
//ZDTOOLS  EXEC HFMBAT
//SYSPRINT DD SYSOUT=*
//DISK     DD DSN=HFMUSER.TEMP.SEARCH.FILE,
//            DISP=SHR
//SYSIN    DD *
$$FILEM DRS INPUT=DISK,BEGIN=*,END=*,
$$FILEM  SCANTYPE=DP,SCANARG='Laws'
$$FILEM EOJ
/*