4897d76c2575ac71bf25423e59bdbe99a97c226f
[yaz-moved-to-github.git] / doc / yaz-client-man.xml
1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
2  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"
3 [
4      <!ENTITY % local SYSTEM "local.ent">
5      %local;
6      <!ENTITY % entities SYSTEM "entities.ent">
7      %entities;
8      <!ENTITY % idcommon SYSTEM "common/common.ent">
9      %idcommon;
10 ]>
11 <refentry id="yaz-client">
12  <refentryinfo>
13   <productname>YAZ</productname>
14   <productnumber>&version;</productnumber>
15   <info><orgname>Index Data</orgname></info>
16  </refentryinfo>
17
18  <refmeta>
19   <refentrytitle>yaz-client</refentrytitle>
20   <manvolnum>1</manvolnum>
21   <refmiscinfo class="manual">Commands</refmiscinfo>
22  </refmeta>
23
24  <refnamediv>
25   <refname>yaz-client</refname>
26   <refpurpose>Z39.50/SRU client for implementors</refpurpose>
27  </refnamediv>
28
29  <refsynopsisdiv>
30   <cmdsynopsis>
31    <command>yaz-client</command>
32    <arg choice="opt"><option>-a <replaceable>apdulog</replaceable></option></arg>
33    <arg choice="opt"><option>-b <replaceable>berdump</replaceable></option></arg>
34    <arg choice="opt"><option>-c <replaceable>cclfile</replaceable></option></arg>
35    <arg choice="opt"><option>-d <replaceable>dump</replaceable></option></arg>
36    <arg choice="opt"><option>-f <replaceable>cmdfile</replaceable></option></arg>
37    <arg choice="opt"><option>-k <replaceable>size</replaceable></option></arg>
38    <arg choice="opt"><option>-m <replaceable>marclog</replaceable></option></arg>
39    <arg choice="opt"><option>-p <replaceable>proxy-addr</replaceable></option></arg>
40    <arg choice="opt"><option>-q <replaceable>cqlfile</replaceable></option></arg>
41    <arg choice="opt"><option>-t <replaceable>dispcharset</replaceable></option></arg>
42    <arg choice="opt"><option>-u <replaceable>auth</replaceable></option></arg>
43    <arg choice="opt"><option>-v <replaceable>loglevel</replaceable></option></arg>
44    <arg choice="opt"><option>-V</option></arg>
45    <arg choice="opt"><option>-x</option></arg>
46    <arg choice="opt">server-addr</arg>
47   </cmdsynopsis>
48
49  </refsynopsisdiv>
50
51  <refsect1><title>DESCRIPTION</title>
52   <para>
53    <command>yaz-client</command> is a
54    <ulink url="&url.z39.50;">Z39.50</ulink>/<ulink url="&url.sru;">SRU</ulink>
55    client (origin) with a simple command line interface that allows
56    you to test behavior and performance of Z39.50 targets and SRU servers.
57   </para>
58   <para>
59    From YAZ version 4.1.0 <command>yaz-client</command> may also operate as a
60    <ulink url="&url.solr;">SOLR</ulink> Web Service
61    client.
62   </para>
63   <para>
64    If the <replaceable>server-addr</replaceable> is specified, the client creates
65    a connection to the Z39.50/SRU target at the address given.
66   </para>
67   <para>
68    When <command>yaz-client</command> is started it tries to read
69    commands from one of the following files:
70    <itemizedlist>
71     <listitem><para>
72       Command file if it is given by option -f.
73      </para></listitem>
74     <listitem><para>
75       <filename>.yazclientrc</filename> in current working directory.
76      </para></listitem>
77     <listitem><para>
78       <filename>.yazclientrc</filename> in the user's home directory.
79       The value of the <literal>HOME</literal> is used to determine
80       the home directory. Normally, <literal>HOME</literal> is only set
81       on POSIX systems such as Linux, FreeBSD, Solaris.
82      </para></listitem>
83    </itemizedlist>
84   </para>
85  </refsect1>
86   <refsect1>
87    <title>OPTIONS</title>
88    <variablelist>
89     <varlistentry>
90      <term>-a <replaceable>filename</replaceable></term>
91      <listitem><para>
92        If specified, logging of protocol packages will be appended
93        file given. If <replaceable>filename</replaceable> is
94        specified as <literal>-</literal>, the output is written
95        to <literal>stdout</literal>.
96       </para></listitem>
97     </varlistentry>
98     <varlistentry>
99      <term>-b <replaceable>filename</replaceable></term>
100      <listitem><para>
101        If specified, YAZ will dump BER data in readable notation
102        to the file specified. If <replaceable>filename</replaceable>
103        is specified as <literal>-</literal> the output is written
104        to <literal>stdout</literal>.
105       </para></listitem>
106     </varlistentry>
107     <varlistentry>
108      <term>-c <replaceable>filename</replaceable></term>
109      <listitem><para>
110        If specified, CCL configuration will be read from
111        the file given.
112       </para></listitem>
113     </varlistentry>
114     <varlistentry>
115      <term>-d <replaceable>dump</replaceable></term>
116      <listitem><para>
117        If specified, YAZ will dump BER data for all PDUs sent and received
118        to individual files, named
119        <replaceable>dump</replaceable>.DDD.<literal>raw</literal>,
120        where DDD is 001, 002, 003, ..
121       </para></listitem>
122     </varlistentry>
123
124     <varlistentry>
125      <term>-f <replaceable>cmdfile</replaceable></term>
126      <listitem><para>
127       Reads commands from <replaceable>cmdfile</replaceable>. When
128       this option is used, YAZ client does not read .yazclientrc
129       from current directory or home directory.
130       </para></listitem>
131     </varlistentry>
132
133     <varlistentry>
134      <term>-k <replaceable>size</replaceable></term>
135      <listitem><para>
136       Sets preferred messages and maximum record size for Initialize
137       Request in kilobytes. Default value is 65536 (64 MB).
138       </para></listitem>
139     </varlistentry>
140     <varlistentry>
141      <term>-m <replaceable>filename</replaceable></term>
142      <listitem><para>
143        If specified, retrieved records will be appended to the file given.
144       </para></listitem>
145     </varlistentry>
146     <varlistentry>
147      <term>-p <replaceable>proxy-addr</replaceable></term>
148      <listitem><para>
149        If specified, the client will use the proxy at the address
150        given. YAZ client will
151        connect to a proxy on the address and port given.
152        The actual target will be specified as part of the InitRequest
153        to inform the proxy about actual target.
154       </para></listitem>
155     </varlistentry>
156     <varlistentry>
157      <term>-q <replaceable>filename</replaceable></term>
158      <listitem><para>
159        If specified, CQL configuration will be read from
160        the file given.
161       </para></listitem>
162     </varlistentry>
163     <varlistentry>
164      <term>-t <replaceable>displaycharset</replaceable></term>
165      <listitem><para>
166        If displaycharset is given, it specifies name of the character set of the
167        output (on the terminal on which YAZ client is running).
168       </para></listitem>
169     </varlistentry>
170     <varlistentry>
171      <term>-u <replaceable>auth</replaceable></term>
172      <listitem><para>
173        If specified, the <replaceable>auth</replaceable> string
174        will be used for authentication.
175       </para></listitem>
176     </varlistentry>
177     <varlistentry><term>
178       <literal>-v</literal> <replaceable>level</replaceable>
179      </term><listitem>
180       <simpara>Sets the LOG level to <replaceable>level</replaceable>.
181        Level is a sequence of tokens separated by comma. Each token
182        is a integer or a named LOG item - one of
183        <literal>fatal</literal>,
184        <literal>debug</literal>,
185        <literal>warn</literal>,
186        <literal>log</literal>,
187        <literal>malloc</literal>,
188        <literal>all</literal>,
189        <literal>none</literal>.
190       </simpara></listitem>
191     </varlistentry>
192     <varlistentry>
193      <term>-V</term>
194      <listitem><para>
195        Prints YAZ version.
196      </para></listitem>
197     </varlistentry>
198     <varlistentry>
199      <term>-x</term>
200      <listitem><para>
201        Makes the YAZ client print hex dumps of packages sent and received
202        on standard output.
203        </para></listitem>
204     </varlistentry>
205    </variablelist>
206   </refsect1>
207  <refsect1>
208   <title>COMMANDS</title>
209   <para>
210    The YAZ client accepts the following commands.
211   </para>
212   <variablelist>
213    <varlistentry id="command-open"><term>
214      <literal>open </literal><replaceable>zurl</replaceable>
215     </term>
216     <listitem>
217      <para>Opens a connection to a server. The syntax for
218       <replaceable>zurl</replaceable> is the same as described
219       above for connecting from the command line.
220      </para>
221      <para>
222       Syntax:
223      </para>
224      <para>
225       [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
226       [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
227      </para>
228     </listitem>
229    </varlistentry>
230    <varlistentry><term>
231      <literal>quit</literal>
232     </term>
233     <listitem>
234      <para>Quits YAZ client</para>
235     </listitem>
236    </varlistentry>
237    <varlistentry id="command-find"><term>
238      <literal>find </literal><replaceable>query</replaceable></term>
239     <listitem>
240      <para>Sends a Search Request using the <replaceable>query</replaceable>
241       given. By default the query is assumed to be PQF. See command
242       <link linkend="command-querytype">querytype</link> for more information.
243      </para>
244     </listitem>
245    </varlistentry>
246    <varlistentry><term>
247      <literal>delete</literal> <replaceable>setname</replaceable></term>
248     <listitem>
249      <para>Deletes result set with name <replaceable>setname</replaceable>
250       on the server.</para>
251     </listitem>
252    </varlistentry>
253    <varlistentry><term>
254      <literal>base </literal><replaceable>base1</replaceable>
255      <replaceable>base2</replaceable> ...
256     </term>
257     <listitem>
258      <para>Sets the name(s) of the database(s) to search. One or more
259       databases may be specified separated by blanks. This commands overrides
260       the database given in <replaceable>zurl</replaceable>.
261      </para>
262     </listitem>
263    </varlistentry>
264    <varlistentry><term>
265      <literal>show </literal>
266      [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
267     </term>
268     <listitem>
269      <para>Fetches records by sending a Present Request from the start
270       position given by
271       <replaceable>start</replaceable>
272       a number of records given by <replaceable>number</replaceable>. If
273       <replaceable>start</replaceable> is not given, then the client
274       will fetch from position of the last retrieved record plus 1. If
275       <replaceable>number</replaceable> is not given, then one record will
276       be fetched at a time.
277      </para>
278     </listitem>
279    </varlistentry>
280    <varlistentry><term>
281      <literal>scan</literal> <replaceable>term</replaceable>
282     </term>
283     <listitem>
284      <simpara>Scans
285       database index for a term. The syntax resembles the syntax
286       for <link linkend="command-find"><literal>find</literal></link>.
287       If you want to scan for the word <literal>water</literal> you could
288       write
289      </simpara>
290      <screen>
291       scan water
292      </screen>
293      <simpara>
294       but if you want to scan only in, say the title field, you would write
295      </simpara>
296      <screen>
297       scan @attr 1=4 water
298      </screen>
299     </listitem>
300    </varlistentry>
301    <varlistentry><term>
302      <literal>setscan</literal> <replaceable>set</replaceable> <replaceable>term</replaceable>
303     </term>
304     <listitem>
305      <simpara>Scans database index for a term within a result set. This
306       is similar to the scan command but has a result set as its first argument.
307      </simpara>
308     </listitem>
309    </varlistentry>
310    <varlistentry><term>
311      <literal>scanpos</literal> <replaceable>pos</replaceable>
312     </term>
313     <listitem>
314      <simpara>
315       Sets preferred position for scan. This value
316       is used in next scan. By default position is 1.
317      </simpara>
318     </listitem>
319    </varlistentry>
320    <varlistentry><term>
321      <literal>scansize</literal> <replaceable>size</replaceable>
322     </term>
323     <listitem>
324      <simpara>
325       Sets number of entries to be returned by scan. Default
326       number of entries is 20.
327      </simpara>
328     </listitem>
329    </varlistentry>
330    <varlistentry><term>
331      <literal>scanstep</literal> <replaceable>step</replaceable>
332     </term>
333     <listitem>
334      <simpara>
335       Set step-size for scan. This value is used in next scan
336       sent to the target. By default step-size is 0.
337      </simpara>
338     </listitem>
339    </varlistentry>
340    <varlistentry id="sortspec"><term>
341      <literal>sort</literal> <replaceable>sortspecs</replaceable>
342     </term>
343     <listitem>
344      <para>Sorts a result set. The sort command takes a
345       sequence of space-separated sort specifications, with each sort
346       specification consisting of two space-separated words (so that the
347       whole specification list is made up of an even number of words).
348       The first word of each specification
349       holds a field (sort criterion) and the second holds flags.
350       If the sort criterion includes <literal>=</literal> it is assumed
351       that the <literal>SortKey</literal> is of type
352       <literal>sortAttributes</literal> using Bib-1: in this case
353       the integer before <literal>=</literal> is
354       the attribute type and the integer following <literal>=</literal>
355       is the attribute value.
356       If no <literal>=</literal> is in the criterion it is treated as a
357       sortfield of type InternationalString.
358       The flags word of each sort specification must consist of
359       <literal>s</literal>
360       for case sensitive or <literal>i</literal> for case insensitive, and
361       <literal>&lt;</literal> for ascending order or <literal>&gt;</literal>
362       for descending order.
363      </para>
364     </listitem>
365    </varlistentry>
366    <varlistentry><term>
367      <literal>sort+</literal>
368     </term>
369     <listitem>
370      <para>Same as <literal>sort</literal> but stores the sorted
371       result set in a new result set.
372      </para>
373     </listitem>
374    </varlistentry>
375    <varlistentry><term>
376      <literal>authentication</literal> <replaceable>openauth</replaceable>
377     </term>
378     <listitem>
379      <para>Sets up a authentication string if a server requires
380       authentication (v2 OpenStyle). The authentication string is first
381       sent to the server when the
382       <link linkend="command-open"><literal>open</literal></link> command is
383       issued and the Z39.50 Initialize Request is sent, so this command
384       must be used before <literal>open</literal> in order to be effective.
385       A common convention for the <replaceable>authopen</replaceable> string
386       is that the username - and password is separated by a slash, e.g.
387       <literal>myusername/mysecret</literal>.
388      </para>
389     </listitem>
390    </varlistentry>
391
392    <varlistentry><term>
393      <literal>sru</literal> <replaceable>method</replaceable> <replaceable>version</replaceable>
394     </term>
395     <listitem>
396      <para>Selects Web Service method and version.
397       Must be one of <literal>POST</literal>,
398       <literal>GET</literal>, <literal>SOAP</literal> (default)
399       or <literal>SOLR</literal>. Version
400       should be either 1.1 or 1.2 for SRU. Other versions are allowed - for testing
401       purposes (version negotiation with SRU server).
402       The version is currently not used for SOLR Web Services
403      </para>
404     </listitem>
405    </varlistentry>
406
407    <varlistentry><term>
408      <literal>list_all</literal>
409     </term>
410     <listitem>
411      <para>This command displays status and values for many settings.
412      </para>
413     </listitem>
414    </varlistentry>
415
416    <varlistentry><term>
417      <literal>lslb</literal> <replaceable>n</replaceable>
418     </term>
419     <listitem>
420      <para>Sets the limit for when no records should be returned
421       together with the search result.
422       See the
423       <ulink
424        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
425        Z39.50 standard on set bounds
426       </ulink>
427       for more details.
428      </para>
429     </listitem>
430    </varlistentry>
431
432    <varlistentry><term>
433      <literal>ssub</literal> <replaceable>n</replaceable>
434     </term>
435     <listitem>
436      <para>Sets the limit for when all records should be returned with
437       the search result.
438       See the
439       <ulink
440        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
441        Z39.50 standard on set bounds
442       </ulink> for more details.
443      </para>
444     </listitem>
445    </varlistentry>
446
447    <varlistentry><term>
448      <literal>mspn</literal> <replaceable>n</replaceable>
449     </term>
450     <listitem>
451      <para>Sets the number of records should be returned if the
452       number of records in the result set is between the values of
453       <literal>lslb</literal> and <literal>ssub</literal>.
454       See the
455       <ulink
456        url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
457        Z39.50 standard on set bounds
458       </ulink>
459       for more details.
460      </para>
461     </listitem>
462    </varlistentry>
463    <varlistentry><term>
464      <literal>status</literal>
465     </term>
466     <listitem>
467      <para>Displays the values of <literal>lslb</literal>,
468       <literal>ssub</literal> and <literal>mspn</literal>.
469      </para>
470     </listitem>
471    </varlistentry>
472    <varlistentry><term>
473      <literal>setname</literal>
474     </term>
475     <listitem>
476      <para>Switches named result sets on and off. Default is on.
477      </para>
478     </listitem>
479    </varlistentry>
480    <varlistentry><term>
481      <literal>cancel</literal>
482     </term>
483     <listitem>
484      <para>Sends a Trigger Resource Control Request to the target.
485      </para>
486     </listitem>
487    </varlistentry>
488    <varlistentry><term>
489      <literal>format</literal> <replaceable>oid</replaceable>
490     </term>
491     <listitem>
492      <para>Sets the preferred transfer syntax for retrieved records.
493       yaz-client supports all the record syntaxes that currently
494       are registered. See
495       <ulink
496        url="http://www.loc.gov/z3950/agency/defns/oids.html#5">
497        Z39.50 Record Syntax Identifiers
498       </ulink>
499       for more details. Commonly used records syntaxes include usmarc,
500       sutrs and xml.
501      </para>
502     </listitem>
503    </varlistentry>
504    <varlistentry><term>
505      <literal>elements</literal> <replaceable>e</replaceable>
506     </term>
507     <listitem>
508      <para>Sets the element set name for the records. Many targets support
509       element sets are B (for brief) and F (for full).
510      </para>
511     </listitem>
512    </varlistentry>
513    <varlistentry><term>
514      <literal>close</literal>
515     </term>
516     <listitem>
517      <para>Sends a Z39.50 Close APDU and closes connection with the peer
518      </para>
519     </listitem>
520    </varlistentry>
521    <varlistentry id="command-querytype"><term>
522      <literal>querytype</literal> <replaceable>type</replaceable>
523     </term>
524     <listitem>
525      <para>Sets the query type as used by command
526       <link linkend="command-find"><literal>find</literal></link>.
527       The following is supported:
528       <literal>prefix</literal> for
529       <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
530       <literal>ccl</literal> for CCL search (Type-2 Query),
531       <literal>cql</literal> for CQL (Type-104 search with CQL OID),
532       <literal>ccl2rpn</literal> for
533       <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
534       <literal>cql2rpn</literal> for
535       CQL to RPN conversion (Type-1 Query).
536      </para>
537     </listitem>
538    </varlistentry>
539    <varlistentry><term>
540      <literal>attributeset</literal> <replaceable>set</replaceable>
541     </term>
542     <listitem>
543      <para>
544       Sets attribute set OID for prefix queries (RPN, Type-1).
545      </para>
546     </listitem>
547    </varlistentry>
548    <varlistentry><term>
549      <literal>refid</literal> <replaceable>id</replaceable>
550     </term>
551     <listitem>
552      <para>Sets reference ID for Z39.50 Request(s).
553      </para>
554     </listitem>
555    </varlistentry>
556    <varlistentry><term>
557      <literal>itemorder</literal>
558      <replaceable>type</replaceable> <replaceable>no</replaceable>
559     </term>
560     <listitem>
561      <para>Sends an Item Order Request using the ILL External.
562       <replaceable>type</replaceable> is either 1 or 2 which corresponds to
563       ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
564       is the Result Set position of the record to be ordered.
565      </para>
566     </listitem>
567    </varlistentry>
568    <varlistentry><term>
569      <literal>update</literal>
570      <replaceable>action</replaceable>
571      <replaceable>recid</replaceable>
572      <replaceable>doc</replaceable>
573     </term>
574     <listitem>
575      <para>Sends Item Update Request. The <replaceable>action</replaceable>
576       argument must be the action type: one of <literal>insert</literal>,
577       <literal>replace</literal>, <literal>delete</literal> and
578       <literal>update</literal>. The second argument,
579       <replaceable>recid</replaceable>, is the
580       record identifier (any string). Third argument which is optional is
581       the record document for the request. If doc is preceded with
582       "&lt;", then the following characters are treated as a filename
583       with the records to be updated. Otherwise doc is treated as
584       a document itself. The doc may also be quited in double quotes.
585       If doc is omitted, the last received record (as part of present
586       response or piggybacked search response) is used for the update.
587      </para>
588     </listitem>
589    </varlistentry>
590
591    <varlistentry><term>
592      <literal>source</literal>
593      <replaceable>filename</replaceable>
594     </term>
595     <listitem>
596      <para>Executes list of commands from
597       file <replaceable>filename</replaceable>, just like source on
598       most UNIX shells. A single dot (<literal>.</literal>) can be used
599       as an alternative.
600      </para>
601     </listitem>
602    </varlistentry>
603
604    <varlistentry><term>
605      <literal>!</literal>
606      <replaceable>args</replaceable>
607     </term>
608     <listitem>
609      <para>Executes command <replaceable>args</replaceable> in subshell
610       using the <literal>system</literal> call.
611      </para>
612     </listitem>
613    </varlistentry>
614
615    <varlistentry><term>
616      <literal>push_command</literal>
617      <replaceable>command</replaceable>
618     </term>
619     <listitem>
620      <para>The push_command takes another command as its argument.
621       That command is then added to the history information (so
622       you can retrieve it later). The command itself is not
623       executed. This command only works if you have GNU readline/history
624       enabled.
625      </para>
626     </listitem>
627    </varlistentry>
628
629    <varlistentry><term>
630      <literal>set_apdufile</literal>
631      <replaceable>filename</replaceable>
632     </term>
633     <listitem>
634      <para>Sets that APDU should be logged to file
635       <replaceable>filename</replaceable>. Another way to achieve
636       APDU log is by using command-line option <literal>-a</literal>.
637      </para>
638     </listitem>
639    </varlistentry>
640
641    <varlistentry><term>
642      <literal>set_auto_reconnect</literal>
643      <replaceable>flag</replaceable>
644     </term>
645     <listitem>
646      <para>Specifies whether YAZ client automatically reconnect if
647       target closes connection (Z39.50 only).
648      </para>
649      <para>
650       <replaceable>flag</replaceable> must be either
651       <literal>on</literal> or <literal>off</literal>.
652      </para>
653     </listitem>
654    </varlistentry>
655
656    <varlistentry id="command-set-auto-wait"><term>
657      <literal>set_auto_wait</literal>
658      <replaceable>flag</replaceable>
659     </term>
660     <listitem>
661      <para>Specifies whether YAZ client should wait for
662       response protocol packages after a request.
663       By default YAZ client waits (on) for response packages immediately
664       after a command (find, show) has been issued. If <literal>off</literal>
665       is used, YAZ client does not attempt to receive packages automatically.
666       These will have to be manually received when command
667       <link linkend="command-wait-response">
668        <literal>wait_response</literal>
669       </link> is used.
670      </para>
671      <para>
672       <replaceable>flag</replaceable> must be either
673       <literal>on</literal> or <literal>off</literal>.
674      </para>
675     </listitem>
676    </varlistentry>
677
678    <varlistentry><term>
679      <literal>set_marcdump</literal>
680      <replaceable>filename</replaceable>
681     </term>
682     <listitem>
683      <para>Specifies that all retrieved records should be appended to
684       file <replaceable>filename</replaceable>. This command does the
685       thing as option <literal>-m</literal>.
686      </para>
687     </listitem>
688    </varlistentry>
689
690    <varlistentry><term>
691      <literal>schema</literal>
692      <replaceable>schemaid</replaceable>
693     </term>
694     <listitem>
695      <para>Specifies schema for retrieval.
696       Schema may be specified as an OID for Z39.50.
697       For SRU, schema is a simple string URI.
698      </para>
699     </listitem>
700    </varlistentry>
701
702    <varlistentry id="command-charset"><term>
703      <literal>charset</literal>
704      <replaceable>negotiationcharset</replaceable>
705      [<replaceable>displaycharset</replaceable>]
706      [[<replaceable>marccharset</replaceable>]]
707     </term>
708     <listitem>
709      <para>Specifies character set (encoding) for Z39.50
710       negotiation / SRU encoding and/or character set for output (terminal).
711      </para>
712      <para>
713       <replaceable>negotiationcharset</replaceable> is the name
714       of the character set to be negotiated by the server. The special name
715       <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
716       specifies <emphasis>no</emphasis> character set to be negotiated.
717      </para>
718      <para>
719       If <replaceable>displaycharset</replaceable> is given, it specifies name
720       of the character set of the output (on the terminal on which
721       YAZ client is running). To disable conversion of characters
722       to the output encoding, the special name <literal>-</literal> (dash)
723       can be used.
724       If the special name <literal>auto</literal> is given, YAZ client will
725       convert strings to the encoding of the
726       terminal as returned by <function>nl_langinfo</function> call.
727      </para>
728      <para>
729       If <replaceable>marcharset</replaceable> is given, it specifies name
730       of the character set of retrieved MARC records from server. See
731       also <literal>marcharset</literal> command.
732      </para>
733      <note>
734       <para>
735        Since character set negotiation takes effect in the Z39.50
736        Initialize Request you should issue this command before
737        command <link linkend="command-open"><literal>open</literal></link>
738        is used.
739       </para>
740      </note>
741      <note>
742       <para>
743        MARC records are not covered by Z39.50 character set negotiation,
744        so that's why there is a separate character that must be known
745        in order to do meaningful conversion(s).
746       </para>
747      </note>
748     </listitem>
749    </varlistentry>
750
751    <varlistentry><term>
752      <literal>negcharset</literal>
753      <replaceable>charset</replaceable>
754     </term>
755     <listitem>
756      <para>Specifies character set for negotiation (Z39.50). The
757       argument is the same as second argument for command
758       <link linkend="command-charset"><literal>charset</literal></link>.
759      </para>
760     </listitem>
761    </varlistentry>
762
763    <varlistentry><term>
764      <literal>displaycharset</literal>
765      <replaceable>charset</replaceable>
766     </term>
767     <listitem>
768      <para>Specifies character set for output (display). The
769       argument is the same as second argument for command
770       <link linkend="command-charset"><literal>charset</literal></link>.
771      </para>
772     </listitem>
773    </varlistentry>
774
775    <varlistentry><term>
776      <literal>marccharset</literal>
777      <replaceable>charset</replaceable>
778     </term>
779     <listitem>
780      <para>Specifies character set for retrieved MARC records so
781       that YAZ client can display them in a character suitable
782       for your display. See <literal>charset</literal> command.
783       If <literal>auto</literal> is given, YAZ will assume
784       that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
785       for all other MARC variants. The charset argument is the
786       same as third argument for command
787       <link linkend="command-charset"><literal>charset</literal></link>.
788      </para>
789     </listitem>
790    </varlistentry>
791
792    <varlistentry><term>
793      <literal>querycharset</literal>
794      <replaceable>charset</replaceable>
795     </term>
796     <listitem>
797      <para>Specifies character set for query terms for Z39.50 RPN
798       queries and Z39.50 Scan Requests (termListAndStartPoint).
799       This is a pure client-side conversion which converts from
800       displayCharset to queryCharset.
801      </para>
802     </listitem>
803    </varlistentry>
804
805    <varlistentry><term>
806      <literal>set_cclfile</literal>
807      <replaceable>filename</replaceable>
808     </term>
809     <listitem>
810      <para>Specifies that CCL fields should be read from file
811       file <replaceable>filename</replaceable>. This command does the
812       thing as option <literal>-c</literal>.
813      </para>
814     </listitem>
815    </varlistentry>
816
817    <varlistentry><term>
818      <literal>set_cqlfile</literal>
819      <replaceable>filename</replaceable>
820     </term>
821     <listitem>
822      <para>Specifies that CQL fields should be read from file
823       file <replaceable>filename</replaceable>. This command does the
824       thing as option <literal>-q</literal>.
825      </para>
826     </listitem>
827    </varlistentry>
828
829    <varlistentry><term>
830      <literal>register_oid</literal>
831      <replaceable>name</replaceable>
832      <replaceable>class</replaceable>
833      <replaceable>OID</replaceable>
834     </term>
835     <listitem>
836      <para>This command allows you to register your own object
837       identifier - so that instead of entering a long dot-notation
838       you can use a short name instead.
839       The <replaceable>name</replaceable> is your
840       name for the OID, <replaceable>class</replaceable> is the
841       class, and <replaceable>OID</replaceable> is the raw OID in
842       dot notation. Class is one <literal>appctx</literal>,
843       <literal>absyn</literal>, <literal>attet</literal>,
844       <literal>transyn</literal>, <literal>diagset</literal>,
845       <literal>recsyn</literal>, <literal>resform</literal>,
846       <literal>accform</literal>, <literal>extserv</literal>,
847       <literal>userinfo</literal>, <literal>elemspec</literal>,
848       <literal>varset</literal>, <literal>schema</literal>,
849       <literal>tagset</literal>, <literal>general</literal>.
850       If you're in doubt use the <literal>general</literal>
851       class.
852      </para>
853     </listitem>
854    </varlistentry>
855
856    <varlistentry><term>
857      <literal>register_tab</literal>
858      <replaceable>command</replaceable>
859      <replaceable>string</replaceable>
860     </term>
861     <listitem>
862      <para>This command registers a TAB completion string for
863       the command given.
864      </para>
865     </listitem>
866    </varlistentry>
867
868    <varlistentry><term>
869      <literal>sleep</literal>
870      <replaceable>seconds</replaceable>
871     </term>
872     <listitem>
873      <para>This command makes YAZ client sleep (be idle) for
874       the number of seconds given.
875      </para>
876     </listitem>
877    </varlistentry>
878
879    <varlistentry id="command-wait-response"><term>
880      <literal>wait_response</literal>
881      [ <replaceable>number</replaceable>]
882     </term>
883     <listitem>
884      <para>This command makes YAZ client wait for a number of
885       response packages from target. If <replaceable>number</replaceable> is
886       omitted, 1 is assumed.
887      </para>
888      <para>This command is rarely used and is only useful if command
889       <link linkend="command-set-auto-wait">
890        <literal>set_auto_wait</literal>
891       </link> is set to off.
892      </para>
893     </listitem>
894    </varlistentry>
895
896    <varlistentry id="command-xmles"><term>
897      <literal>xmles</literal>
898      <replaceable>OID</replaceable>
899      <replaceable>doc</replaceable>
900     </term>
901     <listitem>
902      <para>Sends XML Extended Services request using the OID and doc given.
903      </para>
904     </listitem>
905    </varlistentry>
906
907    <varlistentry><term>
908      <literal>zversion</literal>
909      <replaceable>ver</replaceable>
910     </term>
911     <listitem>
912      <para>This command sets Z39.50 version for negotiation.
913       Should be used before
914       <link linkend="command-open"><literal>open</literal></link>.
915       By default 3 (version 3) is used.
916      </para>
917     </listitem>
918    </varlistentry>
919
920    <varlistentry><term>
921      <literal>options</literal>
922      <replaceable>op1 op2..</replaceable>
923     </term>
924     <listitem>
925      <para>This command sets Z39.50 options for negotiation.
926       Should be used before
927       <link linkend="command-open"><literal>open</literal></link>.
928      </para>
929      <para>
930       The following options are supported:
931       <literal>search</literal>,
932       <literal>present</literal>,
933       <literal>delSet</literal>,
934       <literal>resourceReport</literal>,
935       <literal>triggerResourceCtrl</literal>,
936       <literal>resourceCtrl</literal>,
937       <literal>accessCtrl</literal>,
938       <literal>scan</literal>,
939       <literal>sort</literal>,
940       <literal>extendedServices</literal>,
941       <literal>level_1Segmentation</literal>,
942       <literal>level_2Segmentation</literal>,
943       <literal>concurrentOperations</literal>,
944       <literal>namedResultSets</literal>,
945       <literal>encapsulation</literal>,
946       <literal>resultCount</literal>,
947       <literal>negotiationModel</literal>,
948       <literal>duplicationDetection</literal>,
949       <literal>queryType104</literal>,
950       <literal>pQESCorrection</literal>,
951       <literal>stringSchema</literal>.
952      </para>
953     </listitem>
954    </varlistentry>
955
956   </variablelist>
957  </refsect1>
958  <refsect1><title>EXAMPLE</title>
959   <para>
960    The simplest example of a Prefix Query would be something like
961    <screen>
962     f knuth
963    </screen>
964    or
965    <screen>
966     f "donald knuth"
967    </screen>
968    In those queries no attributes was specified.
969    This leaves it up to the server what fields to search but
970    most servers will search in all fields. Some servers does not
971    support this feature though, and require that some attributes
972    are defined. To add one attribute you could do:
973    <screen>
974     f @attr 1=4 computer
975    </screen>
976    where we search in the title field, since the use(1) is title(4).
977    If we want to search in the author field <emphasis>and</emphasis>
978    in the title field, and in the title field using right truncation
979    it could look something like this:
980    <screen>
981     f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
982    </screen>
983    Finally using a mix of Bib-1 and GILS attributes could look
984    something like this:
985    <screen>
986     f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
987    </screen>
988   </para>
989  </refsect1>
990  <refsect1><title>FILES</title>
991   <para>
992    <filename>yaz-&lt;version&gt;/client/client.c</filename>
993   </para>
994   <para>
995    <filename>$HOME/.yazclientrc</filename>
996   </para>
997   <para>
998    <filename>$HOME/.yazclient.history</filename>
999   </para>
1000  </refsect1>
1001  <refsect1><title>SEE ALSO</title>
1002   <para>
1003    <citerefentry>
1004     <refentrytitle>yaz</refentrytitle>
1005     <manvolnum>7</manvolnum>
1006    </citerefentry>
1007    <citerefentry>
1008     <refentrytitle>bib1-attr</refentrytitle>
1009     <manvolnum>7</manvolnum>
1010    </citerefentry>
1011   </para>
1012  </refsect1>
1013 </refentry>
1014
1015 <!-- Keep this comment at the end of the file
1016 Local variables:
1017 mode: sgml
1018 sgml-omittag:t
1019 sgml-shorttag:t
1020 sgml-minimize-attributes:nil
1021 sgml-always-quote-attributes:t
1022 sgml-indent-step:1
1023 sgml-indent-data:t
1024 sgml-parent-document:nil
1025 sgml-local-catalogs: nil
1026 sgml-namecase-general:t
1027 End:
1028 -->