File: yaz-client.html

package info (click to toggle)
yaz 3.0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 13,404 kB
  • ctags: 12,108
  • sloc: xml: 116,075; ansic: 52,205; sh: 9,746; tcl: 2,043; makefile: 1,141; yacc: 347
file content (547 lines) | stat: -rw-r--r-- 34,467 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>yaz-client</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="YAZ User's Guide and Reference"><link rel="up" href="reference.html" title="Reference"><link rel="prev" href="reference.html" title="Reference"><link rel="next" href="yaz-ztest.html" title="yaz-ztest"></head><body><link rel="stylesheet" type="text/css" href="common/style1.css"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">yaz-client</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="reference.html">Prev</a>�</td><th width="60%" align="center">Reference</th><td width="20%" align="right">�<a accesskey="n" href="yaz-ztest.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="yaz-client"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>yaz-client &#8212; Z39.50/SRU client for implementors</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">yaz-client</code>  [<code class="option">-a <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-b <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-c <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-d <em class="replaceable"><code>dump</code></em></code>] [<code class="option">-f <em class="replaceable"><code>cmdfile</code></em></code>] [<code class="option">-k <em class="replaceable"><code>size</code></em></code>] [<code class="option">-m <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-p <em class="replaceable"><code>addr</code></em></code>] [<code class="option">-q <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-u <em class="replaceable"><code>auth</code></em></code>] [<code class="option">-v <em class="replaceable"><code>level</code></em></code>] [<code class="option">-xV</code>] [addr]</p></div></div><div class="refsect1" lang="en"><a name="id2598838"></a><h2>DESCRIPTION</h2><p>
   <span class="command"><strong>yaz-client</strong></span> is a Z39.50/SRU client (origin) with a
   simple command line interface that allows you to test behavior and
   performance of Z39.50 targets and SRU servers.
  </p><p>
   If the <em class="replaceable"><code>addr</code></em> is specified, the client creates
   a connection to the Z39.50/SRU target at the address given.
  </p><p>
   When <span class="command"><strong>yaz-client</strong></span> is started it tries to read
   commands from one of the following files:
   </p><div class="itemizedlist"><ul type="disc"><li><p>
      Command file if it is given by option -f. 
     </p></li><li><p>
      <code class="filename">.yazclientrc</code> in current working directory.
     </p></li><li><p>
      <code class="filename">.yazclientrc</code> in the user's home directory.
      The value of the <code class="literal">HOME</code> is used to determine
      the home directory. Normally, <code class="literal">HOME</code> is only set
      on POSIX systems such as Linux, FreeBSD, Solaris.
     </p></li></ul></div><p>
  </p></div><div class="refsect1" lang="en"><a name="id2598919"></a><h2>OPTIONS</h2><div class="variablelist"><dl><dt><span class="term">-a <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
       If specified, logging of protocol packages will be appended
       file given. If <em class="replaceable"><code>filename</code></em> is
       specified as <code class="literal">-</code>, the output is written
       to <code class="literal">stdout</code>.
      </p></dd><dt><span class="term">-b <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
       If specified, YAZ will dump BER data in readable notation
       to the file specified. If <em class="replaceable"><code>filename</code></em>
       is specified as <code class="literal">-</code> the output is written
       to <code class="literal">stdout</code>.
      </p></dd><dt><span class="term">-c <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
       If specified, CCL configuration will be read from
       the file given.
      </p></dd><dt><span class="term">-d <em class="replaceable"><code>dump</code></em></span></dt><dd><p>
       If specified, YAZ will dump BER data for all PDUs sent and received 
       to individual files, named
       <em class="replaceable"><code>dump</code></em>.DDD.<code class="literal">raw</code>, 
       where DDD is 001, 002, 003, ..
      </p></dd><dt><span class="term">-f <em class="replaceable"><code>cmdfile</code></em></span></dt><dd><p>
      Reads commands from <em class="replaceable"><code>cmdfile</code></em>. When
      this option is used, YAZ client does not read .yazclientrc
      from current directory or home directory.
      </p></dd><dt><span class="term">-k <em class="replaceable"><code>size</code></em></span></dt><dd><p>
      Sets preferred messages and maximum record size for Initialize
      Request in kilobytes. Default value is 1024 (1 MB).
      </p></dd><dt><span class="term">-m <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
       If specified, retrieved records will be appended to the file given.
      </p></dd><dt><span class="term">-p <em class="replaceable"><code>addr</code></em></span></dt><dd><p>
       If specified, the client will use the proxy at the address
       given. YAZ client will
       connect to a proxy on the address and port given. 
       The actual target will be specified as part of the InitRequest
       to inform the proxy about actual target.
      </p></dd><dt><span class="term">-q <em class="replaceable"><code>filename</code></em></span></dt><dd><p>
       If specified, CQL configuration will be read from
       the file given.
      </p></dd><dt><span class="term">-u <em class="replaceable"><code>auth</code></em></span></dt><dd><p>
       If specified, the <em class="replaceable"><code>auth</code></em> string
       will be used for authentication.
      </p></dd><dt><span class="term">
      <code class="literal">-v</code> <em class="replaceable"><code>level</code></em>
     </span></dt><dd>Sets the LOG level to <em class="replaceable"><code>level</code></em>.
       Level is a sequence of tokens separated by comma. Each token
       is a integer or a named LOG item - one of 
       <code class="literal">fatal</code>,
       <code class="literal">debug</code>,
       <code class="literal">warn</code>,
       <code class="literal">log</code>,
       <code class="literal">malloc</code>,
       <code class="literal">all</code>,
       <code class="literal">none</code>.
      </dd><dt><span class="term">-V</span></dt><dd><p>
       Prints YAZ version.
     </p></dd><dt><span class="term">-x</span></dt><dd><p>
       Makes the YAZ client print hex dumps of packages sent and received
       on standard output.
       </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2599221"></a><h2>COMMANDS</h2><p>
    The YAZ client accepts the following commands.
   </p><div class="variablelist"><dl><dt><a name="command-open"></a><span class="term">
   <code class="literal">open </code><em class="replaceable"><code>zurl</code></em>
  </span></dt><dd><p>Opens a connection to a server. The syntax for
    <em class="replaceable"><code>zurl</code></em> is the same as described
    above for connecting from the command line.
   </p><p>
    Syntax:
   </p><p>
    [<code class="literal">(tcp|ssl|unix|http)':'</code>]<em class="replaceable"><code>host</code></em>
    [:<em class="replaceable"><code>port</code></em>][/<em class="replaceable"><code>base</code></em>]
   </p></dd><dt><span class="term">
   <code class="literal">quit</code>
  </span></dt><dd><p>Quits YAZ client</p></dd><dt><a name="command-find"></a><span class="term">
   <code class="literal">find </code><em class="replaceable"><code>query</code></em></span></dt><dd><p>Sends a Search Request using the <em class="replaceable"><code>query</code></em>
    given. By default the query is assumed to be PQF. See command
    <a class="link" href="yaz-client.html#command-querytype">querytype</a> for more information.
   </p></dd><dt><span class="term">
   <code class="literal">delete</code> <em class="replaceable"><code>setname</code></em></span></dt><dd><p>Deletes result set with name <em class="replaceable"><code>setname</code></em>
    on the server.</p></dd><dt><span class="term">
   <code class="literal">base </code><em class="replaceable"><code>base1</code></em>
   <em class="replaceable"><code>base2</code></em> ...
  </span></dt><dd><p>Sets the name(s) of the database(s) to search. One or more
    databases may be specified separated by blanks. This commands overrides
    the database given in <em class="replaceable"><code>zurl</code></em>.
   </p></dd><dt><span class="term">
   <code class="literal">show </code>
   [<em class="replaceable"><code>start</code></em>[+<em class="replaceable"><code>number</code></em>]]
  </span></dt><dd><p>Fetches records by sending a Present Request from the start
    position given by
    <em class="replaceable"><code>start</code></em>
    a number of records given by <em class="replaceable"><code>number</code></em>. If
    <em class="replaceable"><code>start</code></em> is not given, then the client
    will fetch from position of the last retrieved record plus 1. If
    <em class="replaceable"><code>number</code></em> is not given, then one record will
    be fetched at a time.
   </p></dd><dt><span class="term">
   <code class="literal">scan</code> <em class="replaceable"><code>term</code></em>
  </span></dt><dd><p>Scans
    database index for a term. The syntax resembles the syntax
    for <a class="link" href="yaz-client.html#command-find"><code class="literal">find</code></a>.
    If you want to scan for the word <code class="literal">water</code> you could
    write
   </p><pre class="screen">
    scan water
   </pre><p>
    but if you want to scan only in, say the title field, you would write
   </p><pre class="screen">
    scan @attr 1=4 water
   </pre></dd><dt><span class="term">
   <code class="literal">setscan</code> <em class="replaceable"><code>set</code></em> <em class="replaceable"><code>term</code></em>
  </span></dt><dd>Scans database index for a term within a result set. This
    is similar to the scan command but has a result set as its first argument.
   </dd><dt><span class="term">
   <code class="literal">scanpos</code> <em class="replaceable"><code>pos</code></em>
  </span></dt><dd>
    Sets preferred position for scan. This value
    is used in next scan. By default position is 1.
   </dd><dt><span class="term">
   <code class="literal">scansize</code> <em class="replaceable"><code>size</code></em>
  </span></dt><dd>
    Sets number of entries to be returned by scan. Default
    number of entries is 20.
   </dd><dt><span class="term">
   <code class="literal">scanstep</code> <em class="replaceable"><code>step</code></em>
  </span></dt><dd>
    Set step-size for scan. This value is used in next scan
    sent to the target. By default step-size is 0.
   </dd><dt><a name="sortspec"></a><span class="term">
   <code class="literal">sort</code> <em class="replaceable"><code>sortspecs</code></em>
  </span></dt><dd><p>Sorts a result set. The sort command takes a
    sequence of space-separated sort specifications, with each sort
    specification consisting of two space-separated words (so that the
    whole specification list is made up of an even number of words).
    The first word of each specification
    holds a field (sort criterion) and the second holds flags.
    If the sort criterion includes <code class="literal">=</code> it is assumed
    that the <code class="literal">SortKey</code> is of type
    <code class="literal">sortAttributes</code> using Bib-1: in this case
    the integer before <code class="literal">=</code> is
    the attribute type and the integer following <code class="literal">=</code>
    is the attribute value.
    If no <code class="literal">=</code> is in the criterion it is treated as a
    sortfield of type InternationalString.
    The flags word of each sort specification must consist of
    <code class="literal">s</code> 
    for case sensitive or <code class="literal">i</code> for case insensitive, and
    <code class="literal">&lt;</code> for ascending order or <code class="literal">&gt;</code>
    for descending order.
   </p></dd><dt><span class="term">
   <code class="literal">sort+</code>
  </span></dt><dd><p>Same as <code class="literal">sort</code> but stores the sorted
    result set in a new result set.
   </p></dd><dt><span class="term">
   <code class="literal">authentication</code> <em class="replaceable"><code>openauth</code></em>
  </span></dt><dd><p>Sets up a authentication string if a server requires
    authentication (v2 OpenStyle). The authentication string is first
    sent to the server when the 
    <a class="link" href="yaz-client.html#command-open"><code class="literal">open</code></a> command is
    issued and the Z39.50 Initialize Request is sent, so this command
    must be used before <code class="literal">open</code> in order to be effective.
    A common convention for the <em class="replaceable"><code>authopen</code></em> string
    is that the username - and password is separated by a slash, e.g.
    <code class="literal">myusername/mysecret</code>.
   </p></dd><dt><span class="term">
   <code class="literal">sru</code> <em class="replaceable"><code>method</code></em> <em class="replaceable"><code>version</code></em>
  </span></dt><dd><p>Selects SRU method and version.
    Must be one of <code class="literal">POST</code>,
    <code class="literal">GET</code>, <code class="literal">SOAP</code> (default). Version
    should be either 1.1 or 1.2. Other versions are allowed - for testing
    purposes (version negotiation with SRU server).
   </p></dd><dt><span class="term">
   <code class="literal">list_all</code>
  </span></dt><dd><p>This command displays status and values for many settings.
   </p></dd><dt><span class="term">
   <code class="literal">lslb</code> <em class="replaceable"><code>n</code></em>
  </span></dt><dd><p>Sets the limit for when no records should be returned
    together with the search result.
    See the
    <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
     Z39.50 standard
    </a>
    for more details.
   </p></dd><dt><span class="term">
   <code class="literal">ssub</code> <em class="replaceable"><code>n</code></em>
  </span></dt><dd><p>Sets the limit for when all records should be returned with
    the search result.
    See the
    <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
     Z39.50 standard
    </a> for more details.
   </p></dd><dt><span class="term">
   <code class="literal">mspn</code> <em class="replaceable"><code>n</code></em>
  </span></dt><dd><p>Sets the number of records should be returned if the
    number of records in the result set is between the values of
    <code class="literal">lslb</code> and <code class="literal">ssub</code>.
    See the
    <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
     Z39.50 standard
    </a>
    for more details.
   </p></dd><dt><span class="term">
   <code class="literal">status</code>
  </span></dt><dd><p>Displays the values of <code class="literal">lslb</code>,
    <code class="literal">ssub</code> and <code class="literal">mspn</code>.
   </p></dd><dt><span class="term">
   <code class="literal">setname</code>
  </span></dt><dd><p>Switches named result sets on and off. Default is on.
   </p></dd><dt><span class="term">
   <code class="literal">cancel</code>
  </span></dt><dd><p>Sends a Trigger Resource Control Request to the target.
   </p></dd><dt><span class="term">
   <code class="literal">format</code> <em class="replaceable"><code>oid</code></em>
  </span></dt><dd><p>Sets the preferred transfer syntax for retrieved records.
    yaz-client supports all the record syntaxes that currently
    are registered. See
    <a class="ulink" href="http://www.loc.gov/z3950/agency/defns/oids.html#5" target="_top">
     Z39.50 Standard
    </a>
    for more details. Commonly used records syntaxes include usmarc,
    sutrs, grs1 and xml.
   </p></dd><dt><span class="term">
   <code class="literal">elements</code> <em class="replaceable"><code>e</code></em>
  </span></dt><dd><p>Sets the element set name for the records. Many targets support
    element sets are B (for brief) and F (for full).
   </p></dd><dt><span class="term">
   <code class="literal">close</code>
  </span></dt><dd><p>Sends a Z39.50 Close APDU and closes connection with the peer
   </p></dd><dt><a name="command-querytype"></a><span class="term">
   <code class="literal">querytype</code> <em class="replaceable"><code>type</code></em>
  </span></dt><dd><p>Sets the query type as used by command 
   <a class="link" href="yaz-client.html#command-find"><code class="literal">find</code></a>.
    The following is supported:
    <code class="literal">prefix</code> for
	<a class="link" href="tools.html#PQF" title="1.1.�Prefix Query Format">Prefix Query Notation</a> (Type-1 Query);
    <code class="literal">ccl</code> for CCL search (Type-2 Query),
    <code class="literal">cql</code> for CQL (Type-104 search with CQL OID),
    <code class="literal">ccl2rpn</code> for
	<a class="link" href="tools.html#CCL" title="1.2.�CCL">CCL</a> to RPN conversion (Type-1 Query).
    <code class="literal">cql2rpn</code> for
	CQL to RPN conversion (Type-1 Query).
   </p></dd><dt><span class="term">
   <code class="literal">attributeset</code> <em class="replaceable"><code>set</code></em>
  </span></dt><dd><p>
    Sets attribute set OID for prefix queries (RPN, Type-1).
   </p></dd><dt><span class="term">
   <code class="literal">refid</code> <em class="replaceable"><code>id</code></em>
  </span></dt><dd><p>Sets reference ID for Z39.50 Request(s).
   </p></dd><dt><span class="term">
   <code class="literal">itemorder</code>
   <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>no</code></em>
  </span></dt><dd><p>Sends an Item Order Request using the ILL External. 
    <em class="replaceable"><code>type</code></em> is either 1 or 2 which corresponds to
    ILL-Profile 1 and 2 respectively. The <em class="replaceable"><code>no</code></em>
    is the Result Set position of the record to be ordered.
   </p></dd><dt><span class="term">
   <code class="literal">update</code>
   <em class="replaceable"><code>action</code></em>
   <em class="replaceable"><code>recid</code></em>
   <em class="replaceable"><code>doc</code></em>
  </span></dt><dd><p>Sends Item Update Request. The <em class="replaceable"><code>action</code></em>
    argument must be the action type: one of <code class="literal">insert</code>,
    <code class="literal">replace</code>, <code class="literal">delete</code> and
    <code class="literal">update</code>. The second argument, 
    <em class="replaceable"><code>recid</code></em>, is the
    record identifier (any string). Third argument which is optional is
    the record document for the request. If doc is a quoted string
    (double quotes) the string content is used verbatim. If doc is not
    a quoted string, it is assumed to be a filename which is read, then
    sent as the docuemnt content. If doc is omitted, the last received
    record (as parf of present response or piggybacked search response) 
    is used for the update.
   </p></dd><dt><span class="term">
   <code class="literal">source</code>
   <em class="replaceable"><code>filename</code></em>
  </span></dt><dd><p>Executes list of commands from
    file <em class="replaceable"><code>filename</code></em>, just like source on
    most UNIX shells. A single dot (<code class="literal">.</code>) can be used
    as an alternative.
   </p></dd><dt><span class="term">
   <code class="literal">!</code>
   <em class="replaceable"><code>args</code></em>
  </span></dt><dd><p>Executes command <em class="replaceable"><code>args</code></em> in subshell
    using the <code class="literal">system</code> call.
   </p></dd><dt><span class="term">
   <code class="literal">push_command</code>
   <em class="replaceable"><code>command</code></em>
  </span></dt><dd><p>The push_command takes another command as its argument.
    That command is then added to the history information (so
    you can retrieve it later). The command itself is not
    executed. This command only works if you have GNU readline/history
    enabled.
   </p></dd><dt><span class="term">
   <code class="literal">set_apdufile</code>
   <em class="replaceable"><code>filename</code></em>
  </span></dt><dd><p>Sets that APDU should be logged to file
    <em class="replaceable"><code>filename</code></em>. Another way to achieve
    APDU log is by using command-line option <code class="literal">-a</code>.
   </p></dd><dt><span class="term">
   <code class="literal">set_auto_reconnect</code>
   <em class="replaceable"><code>flag</code></em>
  </span></dt><dd><p>Specifies whether YAZ client automatically reconnect if
    target closes connection (Z39.50 only).
   </p><p>
    <em class="replaceable"><code>flag</code></em> must be either
    <code class="literal">on</code> or <code class="literal">off</code>.
   </p></dd><dt><a name="command-set-auto-wait"></a><span class="term">
   <code class="literal">set_auto_wait</code>
   <em class="replaceable"><code>flag</code></em>
  </span></dt><dd><p>Specifies whether YAZ client should wait for
   response protocol packages after a request.
   By default YAZ client waits (on) for response packages immediately
   after a command (find, show) has been issued. If <code class="literal">off</code>
   is used, YAZ client does not attempt to receive packages automatically.
   These will have to be manually received when command 
   <a class="link" href="yaz-client.html#command-wait-response">
    <code class="literal">wait_response</code>
   </a> is used.
   </p><p>
   <em class="replaceable"><code>flag</code></em> must be either
   <code class="literal">on</code> or <code class="literal">off</code>.
   </p></dd><dt><span class="term">
   <code class="literal">set_marcdump</code>
   <em class="replaceable"><code>filename</code></em>
  </span></dt><dd><p>Specifies that all retrieved records should be appended to
    file <em class="replaceable"><code>filename</code></em>. This command does the
    thing as option <code class="literal">-m</code>.
   </p></dd><dt><span class="term">
   <code class="literal">schema</code>
   <em class="replaceable"><code>schemaid</code></em>
  </span></dt><dd><p>Specifies schema for retrieval.
    Schema may be specified as an OID for Z39.50.
    For SRU, schema is a simple string URI.
   </p></dd><dt><a name="command-charset"></a><span class="term">
   <code class="literal">charset</code>
   <em class="replaceable"><code>negotiationcharset</code></em>
   [<em class="replaceable"><code>displaycharset</code></em>]
   [[<em class="replaceable"><code>marccharset</code></em>]]
  </span></dt><dd><p>Specifies character set (encoding) for Z39.50
    negotiation / SRU encoding and/or character set for output (terminal).
   </p><p>
    <em class="replaceable"><code>negotiationcharset</code></em> is the name
    of the character set to be negotiated by the server. The special name
    <code class="literal">-</code> for <em class="replaceable"><code>negotiationcharset</code></em>
    specifies <span class="emphasis"><em>no</em></span> character set to be negotiated.
   </p><p>
    If <em class="replaceable"><code>displaycharset</code></em> is given, it specifies name
    of the character set of the output (on the terminal on which
    YAZ client is running). To disable conversion of characters
    to the output encoding, the special name <code class="literal">-</code> (dash)
    can be used.
    If the special name <code class="literal">auto</code> is given, YAZ client will
    convert strings to the encoding of the
    terminal as returned by <code class="function">nl_langinfo</code> call.
   </p><p>
    If <em class="replaceable"><code>marcharset</code></em> is given, it specifies name
    of the character set of retrieved MARC records from server. See
    also <code class="literal">marcharset</code> command.
   </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     Since character set negotation takes effect in the Z39.50
     Initialize Request you should issue this command before
     command <a class="link" href="yaz-client.html#command-open"><code class="literal">open</code></a>
     is used.
    </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
     MARC records are not covered by Z39.50 character set negotiation,
     so that's why there is a separate character that must be known
     in order to do meaningful converson(s).
    </p></div></dd><dt><span class="term">
   <code class="literal">negcharset</code>
   <em class="replaceable"><code>charset</code></em>
  </span></dt><dd><p>Specifies character set for negotiation (Z39.50). The
    argument is the same as second argument for command
    <a class="link" href="yaz-client.html#command-charset"><code class="literal">charset</code></a>.
   </p></dd><dt><span class="term">
   <code class="literal">displaycharset</code>
   <em class="replaceable"><code>charset</code></em>
  </span></dt><dd><p>Specifies character set for output (display). The
    argument is the same as second argument for command 
    <a class="link" href="yaz-client.html#command-charset"><code class="literal">charset</code></a>.
   </p></dd><dt><span class="term">
   <code class="literal">marccharset</code>
   <em class="replaceable"><code>charset</code></em>
  </span></dt><dd><p>Specifies character set for retrieved MARC records so
    that YAZ client can display them in a character suitable
    for your display. See <code class="literal">charset</code> command.
    If <code class="literal">auto</code> is given, YAZ will assume
    that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
    for all other MARC variants. The charset argument is the
    same as third argument for command
    <a class="link" href="yaz-client.html#command-charset"><code class="literal">charset</code></a>.
   </p></dd><dt><span class="term">
   <code class="literal">querycharset</code>
   <em class="replaceable"><code>charset</code></em>
  </span></dt><dd><p>Specifies character set for query terms for Z39.50 RPN
    queries and Z39.50 Scan Requests (termListAndStartPoint).
    This is a pure client-side conversion which converts from
    displayCharset to queryCharset.
   </p></dd><dt><span class="term">
   <code class="literal">set_cclfile</code>
   <em class="replaceable"><code>filename</code></em>
  </span></dt><dd><p>Specifies that CCL fields should be read from file
    file <em class="replaceable"><code>filename</code></em>. This command does the
    thing as option <code class="literal">-c</code>.
   </p></dd><dt><span class="term">
   <code class="literal">set_cqlfile</code>
   <em class="replaceable"><code>filename</code></em>
  </span></dt><dd><p>Specifies that CQL fields should be read from file
    file <em class="replaceable"><code>filename</code></em>. This command does the
    thing as option <code class="literal">-q</code>.
   </p></dd><dt><span class="term">
   <code class="literal">register_oid</code>
   <em class="replaceable"><code>name</code></em>
   <em class="replaceable"><code>class</code></em>
   <em class="replaceable"><code>OID</code></em>
  </span></dt><dd><p>This command allows you to register your own object
    identifier - so that instead of entering a long dot-notation
    you can use a short name instead.
    The <em class="replaceable"><code>name</code></em> is your
    name for the OID, <em class="replaceable"><code>class</code></em> is the
    class, and <em class="replaceable"><code>OID</code></em> is the raw OID in
    dot notation. Class is one <code class="literal">appctx</code>,
    <code class="literal">absyn</code>, <code class="literal">attet</code>,
    <code class="literal">transyn</code>, <code class="literal">diagset</code>,
    <code class="literal">recsyn</code>, <code class="literal">resform</code>,
    <code class="literal">accform</code>, <code class="literal">extserv</code>,
    <code class="literal">userinfo</code>, <code class="literal">elemspec</code>,
    <code class="literal">varset</code>, <code class="literal">schema</code>,
    <code class="literal">tagset</code>, <code class="literal">general</code>.
    If you're in doubt use the <code class="literal">general</code>
    class.
   </p></dd><dt><span class="term">
   <code class="literal">register_tab</code>
   <em class="replaceable"><code>command</code></em>
   <em class="replaceable"><code>string</code></em>
  </span></dt><dd><p>This command registers a TAB completion string for
    the command given.
   </p></dd><dt><span class="term">
   <code class="literal">sleep</code>
   <em class="replaceable"><code>seconds</code></em>
  </span></dt><dd><p>This command makes YAZ client sleep (be idle) for
    the number of seconds given.
   </p></dd><dt><a name="command-wait-response"></a><span class="term">
   <code class="literal">wait_response</code>
   [ <em class="replaceable"><code>number</code></em>]
  </span></dt><dd><p>This command makes YAZ client wait for a number of
    response packages from target. If <em class="replaceable"><code>number</code></em> is
    omitted, 1 is assumed. 
   </p><p>This command is rarely used and is only useful if command
    <a class="link" href="yaz-client.html#command-set-auto-wait">
     <code class="literal">set_auto_wait</code>
    </a> is set to off.
   </p></dd><dt><a name="command-xmles"></a><span class="term">
   <code class="literal">xmles</code>
   <em class="replaceable"><code>OID</code></em>
   <em class="replaceable"><code>doc</code></em>
  </span></dt><dd><p>Sends XML Extended Services request using the OID and doc given.
   </p></dd><dt><span class="term">
   <code class="literal">zversion</code>
   <em class="replaceable"><code>ver</code></em>
  </span></dt><dd><p>This command sets Z39.50 version for negotiation. 
    Should be used before 
    <a class="link" href="yaz-client.html#command-open"><code class="literal">open</code></a>.
    By default 3 (version 3) is used.
   </p></dd><dt><span class="term">
   <code class="literal">options</code>
   <em class="replaceable"><code>op1 op2..</code></em>
  </span></dt><dd><p>This command sets Z39.50 options for negotiation. 
    Should be used before 
   <a class="link" href="yaz-client.html#command-open"><code class="literal">open</code></a>.
   </p><p>
    The following options are supported:
    <code class="literal">search</code>,  
    <code class="literal">present</code>,  
    <code class="literal">delSet</code>,  
    <code class="literal">resourceReport</code>,  
    <code class="literal">triggerResourceCtrl</code>,  
    <code class="literal">resourceCtrl</code>,  
    <code class="literal">accessCtrl</code>,  
    <code class="literal">scan</code>,  
    <code class="literal">sort</code>,  
    <code class="literal">extendedServices</code>,  
    <code class="literal">level_1Segmentation</code>,  
    <code class="literal">level_2Segmentation</code>,  
    <code class="literal">concurrentOperations</code>,  
    <code class="literal">namedResultSets</code>,  
    <code class="literal">encapsulation</code>,  
    <code class="literal">resultCount</code>,  
    <code class="literal">negotiationModel</code>,  
    <code class="literal">duplicationDetection</code>,  
    <code class="literal">queryType104</code>,  
    <code class="literal">pQESCorrection</code>,  
    <code class="literal">stringSchema</code>.
   </p></dd></dl></div></div><div class="refsect1" lang="en"><a name="id2601406"></a><h2>EXAMPLE</h2><p>
   The simplest example of a Prefix Query would be something like
   </p><pre class="screen">
    f knuth
   </pre><p>
   or
   </p><pre class="screen">
    f "donald knuth"
   </pre><p>
   In those queries no attributes was specified.
   This leaves it up to the server what fields to search but
   most servers will search in all fields. Some servers does not
   support this feature though, and require that some attributes
   are defined. To add one attribute you could do:
   </p><pre class="screen">
    f @attr 1=4 computer
   </pre><p>
   where we search in the title field, since the use(1) is title(4).
   If we want to search in the author field <span class="emphasis"><em>and</em></span>
   in the title field, and in the title field using right truncation
   it could look something like this:
   </p><pre class="screen">
    f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
   </pre><p>
   Finally using a mix of Bib-1 and GILS attributes could look
   something like this:
   </p><pre class="screen">
    f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
   </pre><p>
  </p></div><div class="refsect1" lang="en"><a name="id2601469"></a><h2>FILES</h2><p>
    <code class="filename">yaz-&lt;version&gt;/client/client.c</code>
   </p><p>
    <code class="filename">$HOME/.yazclientrc</code>
   </p><p>
    <code class="filename">$HOME/.yazclient.history</code>
   </p></div><div class="refsect1" lang="en"><a name="id2601502"></a><h2>SEE ALSO</h2><p>
    <span class="citerefentry"><span class="refentrytitle">yaz</span>(7)</span>
   </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="reference.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="reference.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="yaz-ztest.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Reference�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�yaz-ztest</td></tr></table></div></body></html>