|
Back Issue
|
Processing Non-standard Datasets
This usually comes up in connection with tapes created on non-MVS
platforms, where the data may not look like fixed or variable data
to MVS.
Here are some basic rules for working with non-standard datasets:
- If you specify RECFM=U for an input dataset, MVS will truncate blocks
longer than the BLKSIZE and accept blocks shorter than the BLKSIZE.
This allows you to truncate unneeded data from data blocks, if that's
what you want to do.
- If the blocks are less than 32760, which is the largest BLKSIZE
value that you can specify in JCL, then the file can be copied as
RECFM=U,BLKSIZE=32760. This allows all blocks to be copied
intact without knowing much about the format of the input data.
- If you specify RECFM=FB for an input dataset, then all block lengths
must be less than or equal to the BLKSIZE value specified AND all block
lengths must be a multiple of the LRECL (record length) specified.
- A DCB specified in JCL takes precedence over any existing DCB
information associated with an input disk or tape dataset. However,
it must be compatible with the actual data blocks stored in the dataset.
- Refer to the books "DFSMS: Using Datasets" and "DFSMS: Using Magnetic
Tapes" for more information.
Checking out the Data
If you are not sure what you are dealing with, it may be helpful to
dump some blocks to disk for inspection. Here is some JCL which
could be used:
//S1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=OLD,DSN=tape.dsn,RECFM=U,
// BLKSIZE=32760
//SYSUT2 DD RECFM=U,BLKSIZE=32760,DISP=(,CATLG),
// DSN=disk.dsn,SPACE=(TRK,(1,1))
//SYSIN DD *
REPRO INFILE(SYSUT1) OUTFILE(SYSUT2) COUNT(5)
Because RECFM=U was specified, each record copied (in this case up
to 5) represents a block. At this point, ISPF BROWSE can be used to
examine the blocks of data. The IDCAMS PRINT command (also available
as a TSO command) can be used to print the blocks in hex format. You
can also use your installation's file dump utility if one is available.
Fixed Length Records
If the blocks of data are the same size, then you may be dealing
with fixed length records. MVS allows data blocks to be shorter than
the maximum; usually, this happens on the final block. All records
in the dataset will have the same record length which must divide
evenly into the size of each data block. Some non-MVS systems may pad
short blocks or add additional characters to the start or end of blocks.
You can use OPTCD=Q to translate an input tape dataset from ASCII
to EBCDIC. You should check the results especially if special character
sets may be in use.
The TSO OCOPY command can be used to copy an input DDNAME with RECFM=U
to an output DDNAME with RECFM=F and pad the blocks to a constant block
size. This makes it easier to remove extra data from each block when
not all blocks are the same length. Any additional records created by
this process can be easily removed using a utility such as
SORT (See last month's topic).
//S1 EXEC TSOBATCH
//TAPE DD DISP=OLD,DSN=tape.dsn,RECFM=U,BLKSIZE=800
//DISK DD SPACE=(TRK,1),DSN=disk.dsn,DISP=(,CATLG),
// RECFM=FB,LRECL=800,BLKSIZE=800
//SYSTSIN DD *
OCOPY INDD(TAPE) OUTDD(DISK)
OCOPY also has character set translation capabilities. The example
copies the data with LRECL=BLKSIZE to copy whole data blocks. Later,
the data will be recopied with the correct LRECL specified for the
input dataset DDname. The SORT utility can be useful for massaging
data blocks.
See Email notification from Batch Jobs
for more information on the TSOBATCH procedure.
Variable Length Records
Continued ...
Feedback
Comments or suggestions can be
sent to the author.
Last Month's Topic