1846559 Members
1356 Online
110256 Solutions
New Discussion

question on dd command

 
SOLVED
Go to solution
Tim Nelson
Honored Contributor

question on dd command

I have a simple ksh script that dd's a file to tape. My company then actually ships the tape to a customer. (Yes, via US Post Office) This script has been around for 2years, hasn't changed and works fine. Now the customer has approached me insisting that the tape must have an "IBM label" on it otherwise they can't read the data. Does anyone know if it is possible to shove an IBM label on the tape??
2 REPLIES 2
John Palmer
Honored Contributor
Solution

Re: question on dd command

Yes you could do it, it consists of (in UNIX terms) several files at the start and end of tape:-

VOL1 label
HDR1 label
HDR2 label
data
EOF2 label
EOF1 label
EOV label

I can't remember the full details but it will be a pain trying to write them yourself.
The problem is that the various labels contain information pertinent to the data and you would probably have to convert it all to EBCDIC. I guess that there must be a utility out there to do it for you.

However, I would query their statement that they can't read it. What have they changed to make this so. If they have an IBM mainframe then it will be perfectly capable of reading an unlabelled tape.

Bill Hassell
Honored Contributor

Re: question on dd command

IBM labeled tapes are almost like ANSI labeled tapes except that they are recorded in EBCDIC format. However, IBM mainframes can read ANSI labels (which are plain ASCII but the mainframe shop may need to write some JCL). The header records are all 80 characters wide and there are several fields in each header that must be filled in. They tell the mainframe what the record length and blocking factors are.

In the world of Unix, fixed records and blocking factors are totally foreign as there are no tools to read or write them. And storing files on tape in Unix format (ASCII variable length) may require a program on the mainframe to read the records and convert to the IBM format on disk. So you will have to make each ASCII record the same length as mainframe variable length records are nothing like Unix. If the data is pure binary, then the dd solution will work OK.

Your best bet is to ask the mainframe shop for an IBM Tape Labels Reference manual. You can usually get by with a VOL1, HDR1, HDR2 record prepended to the data file and append EOF2, EOF1 and EOV at the end of the file. This must be repeated for each additional file.

BTW: Any IBM mainframe shop worth their salt can handle unlabeled tapes. Labeled tapes makes it easier to hand the tape to an untrained operator but with appropriate JCL, any tape can be usually be read on any mainframe.


Bill Hassell, sysadmin