Main -> Documentation -> WebZ System Administration -> WebZ Utility Programs -> The ber2marc Utility

The ber2marc Utility

The ber2marc utility allows you to convert ASN.1/BER data into Machine-Readable Cataloging (MARC) format. Open SiteSearch database records are stored in ASN.1/BER format. As part of the Open SiteSearch WebZ search and record retrieval process, the ZBase server formatting classes map ASN.1/BER records into MARC format before passing the records onto the JaSSI server for display in the WebZ Out-of-the-Box Interface (OBI). The ber2marc utility can be used as a tool to test any formatting classes that you have written at the ZBase level to map ASN.1/BER data to MARC.

Location: The ber2marc utility is located in the <WebZ_root>/scripts directory, where <WebZ_root> is the location of your installed WebZ environment.

Syntax

ber2marc -iber_file [-cformatClassName] [-mmaxrecs] [-sskiprecs] [-n]

Parameters

Description

-iber_file

Provides the name of the file containing at least one ASN.1/BER encoded record. The ber_file can contain one or more records that you would like to view in MARC format.

-cformatClassName

Allows you to format the MARC output displayed by defining a Java formatting class. The formatClassName should contain the full package name of the Java class that you wish to use to format the MARC records. Refer to the following example:

-cORG.oclc.fmts.zbase.WCATbriefMarcFmt

-mmaxrecs

Indicates the maximum number of records in the ber_file to output.

-sskiprecs

Indicates the number of records in the ber_file to skip before processing the remainder of the file.

-n

Removes the record number label displayed before the output for each record. For example, the following is the typical display for a record:

record number 1
DataDir: fldid(0) asn1class(1) form(1) length(0)
count(22)
child: DataDir: fldid(0) asn1class(2) form(0)
length(0) count(8)
data: 6e 6d 6d 20 20 49 61 20 nmm Ia
sibling: DataDir: fldid(1) asn1class(2) form(0)
length(0) count(12)
data: 6f 63 6d 33 35 30 30 33 36 34 32 20
ocm35003642

When the -n option is used, the "record number 1" label shown above is removed.

Example

The following example demonstrates how to use the ber2marc utility to view the last 5 records of an ASN.1/BER file that contains 35 total records in a MARC-formatted display.

ber2marc -i/cis/demos/phone.ber -cORG.oclc.fmts.zbase.WCATfullMarcFmt -s30

The following example is identical to the example above, but the output is directed to a text file.

ber2marc -i/cis/demos/phone.ber -s30 
-cORG.oclc.fmts.zbase.WCATfullMarcFmt > mydata.txt

See Also

WebZ Utility Programs
Database Builder Utility Programs


[Main][Documentation][Technical Reference][Glossary][Search]