Determine BL and RL of a file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Determine BL and RL of a file
# 1  
Old 01-21-2010
Determine BL and RL of a file

A regular ebcdic mainframe tape usually contains header information the 1st three blocks of the tape. The header information tells the computer/user more information about what is on tape. The header info is 240 bytes in length at 80 bytes each header. The 1st block/header is volume name or volser (usually matches barcode), the next block contains information about the dataset on tape (eg block is 80 bytes and positions 5-21 contain data set identifier-The last 80 block of header information contains information on how the tape is written (80 bytes - Position 5-record format (fixed-or variable), position 6-10 is equal to block length, and positions 11-15 contain record length. I could usually find out the record length and block length of the tape by doing something like dd if=/dev/st0 bs=240 conv=ascii of=/root/header_info.

Think of blocks of data as managing data across the length of the tape and record length where next record of data to be processed or worked with begins....

Sometimes you can figure this out (more frequently if you have an un-labeled tape) by viewing the data on tape in a viewer and as you step thru the tape you determine the tape is fixed (same block size) and can determine the record length by trial and error=look at what you think 1st record ends and then divide by block size-if this is divisible you probably got the correct number...

Now a segy tape has two blocks of data that identify a tape. The 1st block is 3200 length and is usually ebcdic although it can be ascii, the next block is 400, and then comes the data. You can go to www.seg.org and do a search on segy header and it will point you to a document on how the data is put on tape and positions of information about tape (like above). Cannot save and open this document-wants a password-but if you want to view online-just open the word document from your browser....

Anyway I am trying to figure if there is a way to determine the correct block length and record length of a flat file (already on disk-not tape) with some kind of unix-linux script. Here the data would already be on disk-want to be able to format the data correctly if I put on tape. This would be cool and would help me with processing of data-

Thanks in advance-

Bryan

Last edited by Linux-wannabe; 01-25-2010 at 02:00 PM.. Reason: Bad example
# 2  
Old 01-21-2010
What do you mean by "block"? You don't seem to be talking about a hardware block size... What kind of file is this and why must it be broken up? How are locations relevant to a device like a tape that can't seek? You haven't given us a lot of information yet Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to determine if there's a file in directory!

Hi All, I'm just wondering how can i determined if there's a file in directory and put it in a logs? dir="/home/test/" Please advise, Thanks, Use code tags, thanks. (1 Reply)
Discussion started by: nikki1200
1 Replies

2. Shell Programming and Scripting

Determine file age in days?

I am using AIX 6.1 and would like to use a one line command to determine the age of a file in days. I would like to look at a specific file. I would like to use the command to run on a remote server (AIX 6.1) to return the age of a specific file in days. So if the file is 42 days old I would... (2 Replies)
Discussion started by: oldman2
2 Replies

3. Shell Programming and Scripting

How to Determine the file owner's username

I've read the following post here and I get no output from the command. I've tried changing the '$3' to $5, 7, 10...and still nothing. Ultimately what I'd like to is determine who owns the file and rename it to file_name_$USERNAME. $ uname -a SunOS sun001 5.10 Generic_118833-33 sun4u sparc... (3 Replies)
Discussion started by: nadeemsm
3 Replies

4. UNIX for Advanced & Expert Users

How to determine if a file is done copying

I have a file repository in a directory where files are copied into it by ftp or samba. Some of the ftp transfers can be slow, and some of the files can be fairly large. The files are not being used for anything in this directory other than being taken out of the directory and used by the... (2 Replies)
Discussion started by: husker_ricky
2 Replies

5. Shell Programming and Scripting

Determine if file changed within last minute

Is there a simple command to find or check if a file has been modified within the last minute? The mtime parameter from find cmd only allow days. I am trying to avoid timestamp parsing and do some sort of comparison as I'm real beginner at scripts. If this is the only way, any help is greatly... (3 Replies)
Discussion started by: ystee
3 Replies

6. Shell Programming and Scripting

determine owner of a file

Hello, I am on a mission to determine the user of file. I have used the ls -l command but it displays permission, link, user, group, etc, but I just want to display just the name of user of a specified file. Many thanks (4 Replies)
Discussion started by: unibboy
4 Replies

7. UNIX for Dummies Questions & Answers

determine the size of a file???

Hello, Can someone please tell me which command to use to determine the size of a file? When I log in to my shell account, I do this $>% ls -als total 632 8 -rw-r--r-- 1 user01 devgrp1 1558 Jul 30 23:25 .kshrc What is "1158"? Bytes? Kilobytes? I apologize if my... (8 Replies)
Discussion started by: alan
8 Replies

8. UNIX for Dummies Questions & Answers

How to determine if a file is ASCII?

I'm writing a script that takes a filename as an argument, which determines the "file type" of the file. I want to know if there is any command I can use to determine if a file is ASCII type, thanks all for giving a help. (11 Replies)
Discussion started by: popo
11 Replies

9. UNIX for Advanced & Expert Users

How to determine if a File is Open?

I need to know what the best way, if possible in a perl or shell script, to determine if a file is open by a process, and if it is open for writing. While I would rather use a perl or shell script, if I have to use C, that would be ok. Thanks. (2 Replies)
Discussion started by: derrikw2
2 Replies
Login or Register to Ask a Question