Get Record count of EBCDIC file

  • Follow


Hi all,

How can I get Record count of a EBCDIC file. I wanted to know the
number of records present in a EBCDIC file.
I am using HP UNIX.

TIA,
Sri
0
Reply srilaxmipeddapally (4) 6/28/2010 1:58:37 PM

In article 
<0f77f429-5274-40a2-bc34-8ddacea4abac@i9g2000prn.googlegroups.com>,
 sri <srilaxmipeddapally@gmail.com> wrote:

> Hi all,
> 
> How can I get Record count of a EBCDIC file. I wanted to know the
> number of records present in a EBCDIC file.
> I am using HP UNIX.
> 
> TIA,
> Sri

You've checked out the man page for dd, right?   It can read EBCDIC 
records IIRC.

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...
[I filter all Goggle Groups posts, so any reply may be automatically ignored]


0
Reply Michael 6/28/2010 3:23:55 PM


sri <srilaxmipeddapally@gmail.com> writes:

> How can I get Record count of a EBCDIC file. I wanted to know the
> number of records present in a EBCDIC file.
> I am using HP UNIX.

EBCDIC is a character encoding.  An EBCDIC file might have a record
structure unrelated to the encoding -- the most likely being fixed-size
records but no doubt there are others I have never seen.

In other words, it is probably not possible to answer the question
reliably without knowing what a record is, and once you know that you
can probably answer the question yourself!

-- 
Ben.
0
Reply Ben 6/28/2010 4:21:23 PM

On June 28, 2010 09:58, in comp.unix.shell, srilaxmipeddapally@gmail.com
wrote:

> Hi all,
> 
> How can I get Record count of a EBCDIC file.

Ask the operations department running the mainframe that created the file.

If that isn't an option, then, from the operations department running the
mainframe that created the file, obtain the "logical record length" (LRECL)
and "Record format" (RECFM) for the file. 

If the "Record Format" is "FIXED" (F) or "FIXED BLOCKED" (FB), "FIXED
BLOCKED SPANNED" (FBS) or "FIXED BLOCKED with ANSI control characters"
(FBA)
  divide the filesize by the "logical record length" to obtain the # of
  records in the file

If the "Record Format" is "VARIABLE" (V) or "VARIABLE BLOCKED"
(VB), "VARIABLE BLOCKED SPANNED" (VBS), or "VARIABLE BLOCKED with ANSI
control characters" (VBA)
  then you will have to interpret the file in order to determine the number
  of records. Each record will be preceeded by two  two-octet binary numbers
  recorded in big-endian format. The first number (the first 2 octets) will
  be the length of the record (including this 4-octet preamble) in octets.
  The second number (the third and fourth octets) will be binary zero. Read
  through the file, counting these preambles, and the count of the number of
  preambles will be the record count

If the "Record Format" is "UNDEFINED" (U), then the recordlength is not
determinable by outside means, and (effectively) the file size in bytes is
your "# of records".

> I wanted to know the number of records present in a EBCDIC file.

Once the file gets to Unix, your wants may not always be satisfied. Unix has
no concept of "records" (with respect to file metadata), and the only
reliable way to find out /that/ sort of information is to ask the people
who created the file.

> I am using HP UNIX.
> 
> TIA,
> Sri

-- 
Lew Pitcher
Master Codewright & JOAT-in-training   | Registered Linux User #112576
Me: http://pitcher.digitalfreehold.ca/ | Just Linux: http://justlinux.ca/
----------      Slackware - Because I know what I'm doing.         ------


0
Reply Lew 6/28/2010 4:45:05 PM

On Jun 28, 12:45=A0pm, Lew Pitcher <lpitc...@teksavvy.com> wrote:

Brampton's Lew Pitcher is a domain thief and he was recently let go by
the TDBank.

Check out http://lewpitcher.ca for further details.
0
Reply realto 7/2/2010 2:44:52 AM

4 Replies
1106 Views

(page loaded in 0.135 seconds)

Similiar Articles:













7/25/2012 2:27:07 AM


Reply: