From: sri on
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
From: Ben Bacarisse on
sri <srilaxmipeddapally(a)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.
From: Lew Pitcher on
On June 28, 2010 09:58, in comp.unix.shell, srilaxmipeddapally(a)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. ------


From: realto on
On Jun 28, 12:45 pm, Lew Pitcher <lpitc...(a)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.