Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help! alien tape...

Status
Not open for further replies.

WiccaChic

Technical User
Jan 21, 2004
179
US
Please help! Got a tape from a client that I am having trouble reading. I want to try my best to figure out how to read before I bug them. Rumor is, its from a mainframe but I am not positive. Looks like variable length to me, but I am really not sure about that either. At this point, I would settle for just dumping the raw data and worrying about deciphering it later.

When I tcopy the tape I see:

tcopy: Tape File: 1; Records: 1 to 3; Size: 80.
tcopy: File: 1; End of File after: 3 Records, 240 Bytes.
tcopy: Tape File: 2; Record: 1; Size 25444.
tcopy: Tape File: 2; Record: 2; Size 26116.
-------------------continues-------------------->
tcopy: Tape File: 2; Record: 26427; Size 25754.
tcopy: Tape File: 2; Record: 26428; Size 27152.
tcopy: File: 2; End of File after: 26428 Records, 700457878 Bytes.
tcopy: Tape File: 3; Records: 1 to 2; Size: 80.
tcopy: File: 3; End of File after: 2 Records, 160 Bytes.
tcopy: The end of the tape is reached.
tcopy: The total tape length is 700458278 bytes.

Can someone make any suggestions?
 
Hi,
you really have a tape from mainframe with Standart Label.
First file (3 records) is header label. Third file is end label. Your interest is second file only.
You can read header/end label like this.
For header label.
$ dd if=/dev/rmt0 of=HL bs=80 count=3 conv=ascii
$ cat HL
For end label
$ mt -f /dev/rmt0.1 fsf 2
$ dd if=/dev/rmt0 of=EL bs=80 count=3 conv=ascii
$ cat EL

Labels are in EBCDIC code therefor we need "conv=ascii"

Regards Boris
 
Hi Boria and thanks. Heres what the label looks like, but I cant seem to get file2 loaded and thats where the data I need to us is:

VOL1H05032
HDR1#A.C.D.TAPEH0503200010001 004045 980060000000IBM OS/VS 370
HDR2V279982593300DATASET/PARTC P B 81721

Does this header give you some clue as to how to read the data between the label and end label? IBM does not have a lot to say in their documentation except that mainframe data cant be translated with packed decimals. Thats okay, because if I can just get the data loaded in EBCDIC (dont need to translate it to ascii) I have an application that will take care of unpacking the mainframe formats.

 
What output are you getting trying to read the 2nd file ??
 
Hi,
I have not here (at the work) full information about
structure tapes with label but I hope tomorrow to have
it and will answer you.
Best regards Boris
 
Hi once more,
do please next command and result of last send.
$ mt -f /dev/rmt0.1 fsf 1
$ dd if=/dev/rmt0 of=b1 bs=25444 count=1
$ od -v -A x -t x -N 128 b1

This give hex dump of first 128 bytes of first block of
file 2.
Regards Boris
 
Hi,

I am trying to search for all the files which contain the word "D040". I tried the following;
find . -type f -print |xargs grep -i "D040"
When I do it, I always get the following:
grep: 0652-226 Maximum line length of 2048 exceeded.
What should I do so that I do not receive it?

Thanks in advance
 
Thanks Boria, I will try!

amins - that limit is a grep limitation so you may have to use some other strategy for pattern searching.
 
Hi,
Below is the MVS variable length tape structure.
HDR2… line contains information about tape structure.
Tape consists of blocks.
Byte 5 – V says that tape has variable size of blocks (from block to block)
Bytes 6-10 says that maximum block size value is 27998.
Each block consists of one or more logical record(s).
Bytes 11-15 says that maximum record length is 25933. This value includes
4 bytes length indicator contained at the beginning of each record.

/BL/< rec1 >/< rec2 >/….. A block.
BL – first four bytes of each block is block size (in hex) of this block. But uses first two byte only. Last two are zero.
/RI---- data -----/ A record.
RI – record length indicator – 4 bytes. First two bytes is record size (RS) of this record.
Last two bytes uses MVS system. And then is data itsetf. Data length into record = RS-4.

Regards Boris.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top