Make your own free website on Tripod.com
DocBag

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:

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

Big Iron