Add link to MARCXML and MarcXhange Web content
[yaz-moved-to-github.git] / doc / yaz-marcdump-man.xml
index 99029ce..51ebcfb 100644 (file)
@@ -1,6 +1,18 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
-<!-- $Id: yaz-marcdump-man.xml,v 1.4 2005-02-08 13:51:30 adam Exp $ -->
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
+[
+     <!ENTITY % local SYSTEM "local.ent">
+     %local;
+     <!ENTITY % entities SYSTEM "entities.ent">
+     %entities;
+     <!ENTITY % idcommon SYSTEM "common/common.ent">
+     %idcommon;
+]>
 <refentry id="yaz-marcdump">
+ <refentryinfo>
+  <productname>YAZ</productname>
+  <productnumber>&version;</productnumber>
+ </refentryinfo>
  <refmeta>
   <refentrytitle>yaz-marcdump</refentrytitle>
   <manvolnum>1</manvolnum>
  <refsynopsisdiv>
   <cmdsynopsis>
    <command>yaz-marcdump</command>
-   <arg choice="opt"><option>-x</option></arg>
-   <arg choice="opt"><option>-X</option></arg>
-   <arg choice="opt"><option>-e</option></arg>
-   <arg choice="opt"><option>-I</option></arg>
-   <arg choice="opt"><option>-O</option></arg>
+   <arg choice="opt"><option>-i <replaceable>format</replaceable></option></arg>
+   <arg choice="opt"><option>-o <replaceable>format</replaceable></option></arg>
    <arg choice="opt"><option>-f <replaceable>from</replaceable></option></arg>
    <arg choice="opt"><option>-t <replaceable>to</replaceable></option></arg>
-   <arg choice="opt"><option>-v</option></arg>
+   <arg choice="opt"><option>-l <replaceable>spec</replaceable></option></arg>
    <arg choice="opt"><option>-c <replaceable>cfile</replaceable></option></arg>
+   <arg choice="opt"><option>-s <replaceable>prefix</replaceable></option></arg>
+   <arg choice="opt"><option>-C <replaceable>size</replaceable></option></arg>
+   <arg choice="opt"><option>-n</option></arg>
+   <arg choice="opt"><option>-p</option></arg>
+   <arg choice="opt"><option>-v</option></arg>
+   <arg choice="opt"><option>-V</option></arg>
    <arg choice="opt" rep="repeat">file</arg>
   </cmdsynopsis>
  </refsynopsisdiv>
  
  <refsect1><title>DESCRIPTION</title>
   <para>
-   <command>yaz-marcdump</command> reads ISO2709/MARC records from one or
+   <command>yaz-marcdump</command> reads MARC records from one or
    more files.
-   It validates each record and supports output in line-format, 
-   MARCXML, OAIMARC as well as Hex output.
+   It parses each record and supports output in line-format, 
+   ISO2709, MARCXML, MarcXchange as well as Hex output.
   </para>
   <para>
-   By default, each record is printed to standard output in a line
+   This utility parses records ISO2709(raw MARC) as well as XML
+   if that is structured as MARCXML/MarcXchange.
+  </para>
+  <note>
+   <para>
+    As of YAZ 2.1.18, OAI-MARC is no longer supported.
+    OAI-MARC is deprecated. Use MARCXML instead.
+   </para>
+  </note>
+  <para>
+   By default, each record is written to standard output in a line
    format with newline for each field, $x for each subfield x.
+   The output format may be changed with option <literal>-o</literal>,
   </para>
   <para>
    <command>yaz-marcdump</command> can also be requested to perform
   
   <variablelist>
    <varlistentry>
-    <term>-x</term>
+    <term>-i <replaceable>format</replaceable></term>
     <listitem><para>
-      Print MARC records in a simple XML format. 
-      This format is equivalent to YAZ_MARC_SIMPLEXML in
-      <filename>yaz/marcdisp.h</filename>.
+      Specifies input format. Must be one of
+      <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
+      <literal>marcxchange</literal> (ISO25577),
+      <literal>line</literal> (line mode MARC).
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
-    <term>-X</term>
+    <term>-o <replaceable>format</replaceable></term>
     <listitem><para>
-      Print MARC records in MARCXML.
-      This format is equivalent to YAZ_MARC_MARCXML in
-      <filename>yaz/marcdisp.h</filename>.
+      Specifies output format. Must be one of
+      <literal>marcxml</literal>, <literal>marc</literal> (ISO2709),
+      <literal>marcxchange</literal> (ISO25577),
+      <literal>line</literal> (line mode MARC).
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
-    <term>-X</term>
+    <term>-f <replaceable>from</replaceable></term>
     <listitem><para>
-      Print MARC records in MarcXchange format.
-      This format is equivalent to YAZ_MARC_XCHANGE in
-      <filename>yaz/marcdisp.h</filename>.
+      Specify the character set <replaceable>from</replaceable>
+      of the input MARC record.
+      Should be used in conjunction with option <literal>-t</literal>.
+      Refer to the yaz-iconv man page for supported character sets.
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
-    <term>-I</term>
+    <term>-t <replaceable>to</replaceable></term>
     <listitem><para>
-      Print MARC records in ISO2709 format.
-      This format is equivalent to YAZ_MARC_ISO2709 in
-      <filename>yaz/marcdisp.h</filename>.
+      Specify the character set <replaceable>of</replaceable>
+      of the output.
+      Should be used in conjunction with option <literal>-f</literal>.
+      Refer to the yaz-iconv man page for supported character sets.
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
-    <term>-O</term>
+    <term>-l <replaceable>leaderspec</replaceable></term>
     <listitem><para>
-      Print MARC records in OAIMARC. Another XML variant.
-      This format is equivalent to YAZ_MARC_OAIMARC in
-      <filename>yaz/marcdisp.h</filename>.
+      Specify a simple modification string for MARC leader. The
+      <replaceable>leaderspec</replaceable> is a list of pos=value
+      pairs, where pos is an integer offset (0 - 23) for leader. Value
+      is either a quoted string or an integer (character value in decimal).
+      Pairs are comma separated. For example, to set leader at offset 9
+      to a, use <literal>9=a</literal>.
      </para></listitem>
    </varlistentry>
-   
+
    <varlistentry>
-    <term>-f<replaceable>from</replaceable>]</term>
+    <term>-s <replaceable>prefix</replaceable></term>
     <listitem><para>
-      Specify the character set <replaceable>from</replaceable>
-      of the input MARC record.
-      Should be used in conjunction with option <literal>-t</literal>.
+      Writes a chunk of records to a separate file with prefix given,
+      i.e. splits a record batch into files with only at most
+      "chunk" ISO2709 record per file. By default chunk is 1 (one record
+      per file). See option <literal>-C</literal>.
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
-    <term>-t<replaceable>to</replaceable>]</term>
+    <term>-C <replaceable>chunksize</replaceable></term>
     <listitem><para>
-      Specify the character set <replaceable>of</replaceable>
-      of the output.
-      Should be used in conjunction with option <literal>-f</literal>.
+      Specifies chunk size; to be used conjunction with option 
+      <literal>-s</literal>.
+     </para></listitem>
+   </varlistentry>
+
+   <varlistentry>
+    <term>-p</term>
+    <listitem><para>
+      Makes yaz-marcdump prints record number and input file offset
+      of each record read.
+     </para></listitem>
+   </varlistentry>
+
+   <varlistentry>
+    <term>-n</term>
+    <listitem><para>
+      MARC output is omitted so that MARC input is only checkecd.
      </para></listitem>
    </varlistentry>
 
    <varlistentry>
     <term>-v</term>
     <listitem><para>
-      Print more information about the parsing process.
+      Writes more information about the parsing process.
       Useful if you have ill-formatted ISO2709 records as input.
      </para></listitem>
    </varlistentry>
+   
+   <varlistentry>
+    <term>-V</term>
+    <listitem><para>
+      Prints YAZ version.
+     </para></listitem>
+   </varlistentry>
 
   </variablelist>
  </refsect1>
  <refsect1><title>EXAMPLES</title>
   <para>
    The following command converts MARC21/USMARC in MARC-8 encoding to
-   MARC21/USMARC in UTF-8 encoding. (Both input and output is in ISO2709).
+   MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'.
+   Both input and output records are ISO2709 encoded.
    <screen>
-    yaz-marcdump -f MARC-8 -t UTF-8 -I marc21.raw >marc21.utf8.raw
+    yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
    </screen>
   </para>
   <para>
    The same records may be converted to MARCXML instead in UTF-8:
    <screen>
-    yaz-marcdump -f MARC-8 -t UTF-8 -X marc21.raw >marcxml.xml
+    yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
    </screen>
   </para>
  </refsect1> 
   </refsect1>
  <refsect1><title>SEE ALSO</title>
   <para>
-   yaz(7)
+   <citerefentry>
+    <refentrytitle>yaz</refentrytitle>
+    <manvolnum>7</manvolnum>
+   </citerefentry>
+  </para>
+  <para>
+   <citerefentry>
+    <refentrytitle>yaz-iconv</refentrytitle>
+    <manvolnum>1</manvolnum>
+   </citerefentry>
+  </para>
+  <para>
+   <ulink url="&url.marcxml;">MARCXML</ulink>.
+  </para>
+  <para>
+   <ulink url="&url.marcxchange;">ISO25577</ulink>.
   </para>
  </refsect1>
 </refentry>