1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3. Commands</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="client.html" title="Chapter 5. The YAZ client"><link rel="prev" href="client.invoking.html" title="2. Invoking the YAZ client"><link rel="next" href="client.searching.html" title="4. Searching"></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">3. Commands</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="client.invoking.html">Prev</a> </td><th width="60%" align="center">Chapter 5. The YAZ client</th><td width="20%" align="right"> <a accesskey="n" href="client.searching.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="client.commands"></a>3. Commands</h2></div></div></div><p>
2 When the YAZ client has read options and connected to a target, if given,
3 it will display <code class="literal">Z></code> and await your command.
4 Commands are executed by hitting the return key.
5 You can always issue the command <code class="literal">?</code> to see the list
8 The commands are (the letters in parenthesis are short
9 names for the commands):
10 </p><div class="variablelist"><dl><dt><a name="command-open"></a><span class="term">
11 <code class="literal">open </code><em class="replaceable"><code>zurl</code></em>
12 </span></dt><dd><p>Opens a connection to a server. The syntax for
13 <em class="replaceable"><code>zurl</code></em> is the same as described
14 above for connecting from the command line.
18 [<code class="literal">(tcp|ssl|unix|http)':'</code>]<em class="replaceable"><code>host</code></em>
19 [:<em class="replaceable"><code>port</code></em>][/<em class="replaceable"><code>base</code></em>]
20 </p></dd><dt><span class="term">
21 <code class="literal">quit</code>
22 </span></dt><dd><p>Quits YAZ client</p></dd><dt><a name="command-find"></a><span class="term">
23 <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>
24 given. By default the query is assumed to be PQF. See command
25 <a class="link" href="client.commands.html#command-querytype"><code class="literal">querytype</code></a>.
26 </p></dd><dt><span class="term">
27 <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>
28 on the server.</p></dd><dt><span class="term">
29 <code class="literal">base </code><em class="replaceable"><code>base1</code></em>
30 <em class="replaceable"><code>base2</code></em> ...
31 </span></dt><dd><p>Sets the name(s) of the database(s) to search. One or more
32 databases may be specified separated by blanks. This commands overrides
33 the database given in <em class="replaceable"><code>zurl</code></em>.
34 </p></dd><dt><span class="term">
35 <code class="literal">show </code>
36 [<em class="replaceable"><code>start</code></em>[+<em class="replaceable"><code>number</code></em>]]
37 </span></dt><dd><p>Fetches records by sending a Present Request from the start
39 <em class="replaceable"><code>start</code></em>
40 a number of records given by <em class="replaceable"><code>number</code></em>. If
41 <em class="replaceable"><code>start</code></em> is not given, then the client
42 will fetch from position of the last retrieved record plus 1. If
43 <em class="replaceable"><code>number</code></em> is not given, then one record will
45 </p></dd><dt><span class="term">
46 <code class="literal">scan</code> <em class="replaceable"><code>term</code></em>
47 </span></dt><dd><p>Scans
48 database index for a term. The syntax resembles the syntax
49 for <a class="link" href="client.commands.html#command-find"><code class="literal">find</code></a>.
50 If you want to scan for the word <code class="literal">water</code> you could
52 </p><pre class="screen">
55 but if you want to scan only in, say the title field, you would write
56 </p><pre class="screen">
58 </pre></dd><dt><span class="term">
59 <code class="literal">setscan</code> <em class="replaceable"><code>set</code></em> <em class="replaceable"><code>term</code></em>
60 </span></dt><dd>Scans database index for a term within a result set. This
61 is similar to the scan command but has a result set as its first argument.
62 </dd><dt><span class="term">
63 <code class="literal">scanpos</code> <em class="replaceable"><code>pos</code></em>
65 Sets preferred position for scan. This value
66 is used in next scan. By default position is 1.
67 </dd><dt><span class="term">
68 <code class="literal">scansize</code> <em class="replaceable"><code>size</code></em>
70 Sets number of entries to be returned by scan. Default
71 number of entries is 20.
72 </dd><dt><span class="term">
73 <code class="literal">scanstep</code> <em class="replaceable"><code>step</code></em>
75 Set step-size for scan. This value is used in next scan
76 sent to the target. By default step-size is 0.
77 </dd><dt><a name="sortspec"></a><span class="term">
78 <code class="literal">sort</code> <em class="replaceable"><code>sortspecs</code></em>
79 </span></dt><dd><p>Sorts a result set. The sort command takes a
80 sequence of space-separated sort specifications, with each sort
81 specification consisting of two space-separated words (so that the
82 whole specification list is made up of an even number of words).
83 The first word of each specification
84 holds a field (sort criterion) and the second holds flags.
85 If the sort criterion includes <code class="literal">=</code> it is assumed
86 that the <code class="literal">SortKey</code> is of type
87 <code class="literal">sortAttributes</code> using Bib-1: in this case
88 the integer before <code class="literal">=</code> is
89 the attribute type and the integer following <code class="literal">=</code>
90 is the attribute value.
91 If no <code class="literal">=</code> is in the criterion it is treated as a
92 sortfield of type InternationalString.
93 The flags word of each sort specification must consist of
94 <code class="literal">s</code>
95 for case sensitive or <code class="literal">i</code> for case insensitive, and
96 <code class="literal"><</code> for ascending order or <code class="literal">></code>
98 </p></dd><dt><span class="term">
99 <code class="literal">sort+</code>
100 </span></dt><dd><p>Same as <code class="literal">sort</code> but stores the sorted
101 result set in a new result set.
102 </p></dd><dt><span class="term">
103 <code class="literal">authentication</code> <em class="replaceable"><code>openauth</code></em>
104 </span></dt><dd><p>Sets up a authentication string if a server requires
105 authentication (v2 OpenStyle). The authentication string is first
106 sent to the server when the
107 <a class="link" href="client.commands.html#command-open"><code class="literal">open</code></a> command is
108 issued and the Z39.50 Initialize Request is sent, so this command
109 must be used before <code class="literal">open</code> in order to be effective.
110 A common convention for the <em class="replaceable"><code>authopen</code></em> string
111 is that the username - and password is separated by a slash, e.g.
112 <code class="literal">myusername/mysecret</code>.
113 </p></dd><dt><span class="term">
114 <code class="literal">sru</code> <em class="replaceable"><code>method</code></em> <em class="replaceable"><code>version</code></em>
115 </span></dt><dd><p>Selects SRU method and version.
116 Must be one of <code class="literal">POST</code>,
117 <code class="literal">GET</code>, <code class="literal">SOAP</code> (default). Version
118 should be either 1.1 or 1.2. Other versions are allowed - for testing
119 purposes (version negotiation with SRU server).
120 </p></dd><dt><span class="term">
121 <code class="literal">list_all</code>
122 </span></dt><dd><p>This command displays status and values for many settings.
123 </p></dd><dt><span class="term">
124 <code class="literal">lslb</code> <em class="replaceable"><code>n</code></em>
125 </span></dt><dd><p>Sets the limit for when no records should be returned
126 together with the search result.
128 <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
132 </p></dd><dt><span class="term">
133 <code class="literal">ssub</code> <em class="replaceable"><code>n</code></em>
134 </span></dt><dd><p>Sets the limit for when all records should be returned with
137 <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
139 </a> for more details.
140 </p></dd><dt><span class="term">
141 <code class="literal">mspn</code> <em class="replaceable"><code>n</code></em>
142 </span></dt><dd><p>Sets the number of records should be returned if the
143 number of records in the result set is between the values of
144 <code class="literal">lslb</code> and <code class="literal">ssub</code>.
146 <a class="ulink" href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
150 </p></dd><dt><span class="term">
151 <code class="literal">status</code>
152 </span></dt><dd><p>Displays the values of <code class="literal">lslb</code>,
153 <code class="literal">ssub</code> and <code class="literal">mspn</code>.
154 </p></dd><dt><span class="term">
155 <code class="literal">setname</code>
156 </span></dt><dd><p>Switches named result sets on and off. Default is on.
157 </p></dd><dt><span class="term">
158 <code class="literal">cancel</code>
159 </span></dt><dd><p>Sends a Trigger Resource Control Request to the target.
160 </p></dd><dt><span class="term">
161 <code class="literal">format</code> <em class="replaceable"><code>oid</code></em>
162 </span></dt><dd><p>Sets the preferred transfer syntax for retrieved records.
163 yaz-client supports all the record syntaxes that currently
165 <a class="ulink" href="http://www.loc.gov/z3950/agency/defns/oids.html#5" target="_top">
168 for more details. Commonly used records syntaxes include usmarc,
170 </p></dd><dt><span class="term">
171 <code class="literal">elements</code> <em class="replaceable"><code>e</code></em>
172 </span></dt><dd><p>Sets the element set name for the records. Many targets support
173 element sets are B (for brief) and F (for full).
174 </p></dd><dt><span class="term">
175 <code class="literal">close</code>
176 </span></dt><dd><p>Sends a Z39.50 Close APDU and closes connection with the peer
177 </p></dd><dt><a name="command-querytype"></a><span class="term">
178 <code class="literal">querytype</code> <em class="replaceable"><code>type</code></em>
179 </span></dt><dd><p>Sets the query type as used by command
180 <a class="link" href="client.commands.html#command-find"><code class="literal">find</code></a>.
181 The following is supported:
182 <code class="literal">prefix</code> for
183 <a class="link" href="tools.html#PQF" title="1.1. Prefix Query Format">Prefix Query Notation</a> (Type-1 Query);
184 <code class="literal">ccl</code> for CCL search (Type-2 Query),
185 <code class="literal">cql</code> for CQL (Type-104 search with CQL OID),
186 <code class="literal">ccl2rpn</code> for
187 <a class="link" href="tools.html#CCL" title="1.2. CCL">CCL</a> to RPN conversion (Type-1 Query).
188 <code class="literal">cql2rpn</code> for
189 CQL to RPN conversion (Type-1 Query).
190 </p></dd><dt><span class="term">
191 <code class="literal">attributeset</code> <em class="replaceable"><code>set</code></em>
193 Sets attribute set OID for prefix queries (RPN, Type-1).
194 </p></dd><dt><span class="term">
195 <code class="literal">refid</code> <em class="replaceable"><code>id</code></em>
196 </span></dt><dd><p>Sets reference ID for Z39.50 Request(s).
197 </p></dd><dt><span class="term">
198 <code class="literal">itemorder</code>
199 <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>no</code></em>
200 </span></dt><dd><p>Sends an Item Order Request using the ILL External.
201 <em class="replaceable"><code>type</code></em> is either 1 or 2 which corresponds to
202 ILL-Profile 1 and 2 respectively. The <em class="replaceable"><code>no</code></em>
203 is the Result Set position of the record to be ordered.
204 </p></dd><dt><span class="term">
205 <code class="literal">update</code>
206 <em class="replaceable"><code>action</code></em>
207 <em class="replaceable"><code>recid</code></em>
208 <em class="replaceable"><code>doc</code></em>
209 </span></dt><dd><p>Sends Item Update Request. The <em class="replaceable"><code>action</code></em>
210 argument must be the action type: one of <code class="literal">insert</code>,
211 <code class="literal">replace</code>, <code class="literal">delete</code> and
212 <code class="literal">update</code>. The second argument,
213 <em class="replaceable"><code>recid</code></em>, is the
214 record identifier (any string). Third argument which is optional is
215 the record document for the request. If doc is a quoted string
216 (double quotes) the string content is used verbatim. If doc is not
217 a quoted string, it is assumed to be a filename which is read, then
218 sent as the docuemnt content. If doc is omitted, the last received
219 record (as parf of present response or piggybacked search response)
220 is used for the update.
221 </p></dd><dt><span class="term">
222 <code class="literal">source</code>
223 <em class="replaceable"><code>filename</code></em>
224 </span></dt><dd><p>Executes list of commands from
225 file <em class="replaceable"><code>filename</code></em>, just like source on
226 most UNIX shells. A single dot (<code class="literal">.</code>) can be used
228 </p></dd><dt><span class="term">
229 <code class="literal">!</code>
230 <em class="replaceable"><code>args</code></em>
231 </span></dt><dd><p>Executes command <em class="replaceable"><code>args</code></em> in subshell
232 using the <code class="literal">system</code> call.
233 </p></dd><dt><span class="term">
234 <code class="literal">push_command</code>
235 <em class="replaceable"><code>command</code></em>
236 </span></dt><dd><p>The push_command takes another command as its argument.
237 That command is then added to the history information (so
238 you can retrieve it later). The command itself is not
239 executed. This command only works if you have GNU readline/history
241 </p></dd><dt><span class="term">
242 <code class="literal">set_apdufile</code>
243 <em class="replaceable"><code>filename</code></em>
244 </span></dt><dd><p>Sets that APDU should be logged to file
245 <em class="replaceable"><code>filename</code></em>. Another way to achieve
246 APDU log is by using command-line option <code class="literal">-a</code>.
247 </p></dd><dt><span class="term">
248 <code class="literal">set_auto_reconnect</code>
249 <em class="replaceable"><code>flag</code></em>
250 </span></dt><dd><p>Specifies whether YAZ client automatically reconnect if
251 target closes connection (Z39.50 only).
253 <em class="replaceable"><code>flag</code></em> must be either
254 <code class="literal">on</code> or <code class="literal">off</code>.
255 </p></dd><dt><a name="command-set-auto-wait"></a><span class="term">
256 <code class="literal">set_auto_wait</code>
257 <em class="replaceable"><code>flag</code></em>
258 </span></dt><dd><p>Specifies whether YAZ client should wait for
259 response protocol packages after a request.
260 By default YAZ client waits (on) for response packages immediately
261 after a command (find, show) has been issued. If <code class="literal">off</code>
262 is used, YAZ client does not attempt to receive packages automatically.
263 These will have to be manually received when command
264 <a class="link" href="client.commands.html#command-wait-response">
265 <code class="literal">wait_response</code>
268 <em class="replaceable"><code>flag</code></em> must be either
269 <code class="literal">on</code> or <code class="literal">off</code>.
270 </p></dd><dt><span class="term">
271 <code class="literal">set_marcdump</code>
272 <em class="replaceable"><code>filename</code></em>
273 </span></dt><dd><p>Specifies that all retrieved records should be appended to
274 file <em class="replaceable"><code>filename</code></em>. This command does the
275 thing as option <code class="literal">-m</code>.
276 </p></dd><dt><span class="term">
277 <code class="literal">schema</code>
278 <em class="replaceable"><code>schemaid</code></em>
279 </span></dt><dd><p>Specifies schema for retrieval.
280 Schema may be specified as an OID for Z39.50.
281 For SRU, schema is a simple string URI.
282 </p></dd><dt><a name="command-charset"></a><span class="term">
283 <code class="literal">charset</code>
284 <em class="replaceable"><code>negotiationcharset</code></em>
285 [<em class="replaceable"><code>displaycharset</code></em>]
286 [[<em class="replaceable"><code>marccharset</code></em>]]
287 </span></dt><dd><p>Specifies character set (encoding) for Z39.50
288 negotiation / SRU encoding and/or character set for output (terminal).
290 <em class="replaceable"><code>negotiationcharset</code></em> is the name
291 of the character set to be negotiated by the server. The special name
292 <code class="literal">-</code> for <em class="replaceable"><code>negotiationcharset</code></em>
293 specifies <span class="emphasis"><em>no</em></span> character set to be negotiated.
295 If <em class="replaceable"><code>displaycharset</code></em> is given, it specifies name
296 of the character set of the output (on the terminal on which
297 YAZ client is running). To disable conversion of characters
298 to the output encoding, the special name <code class="literal">-</code> (dash)
300 If the special name <code class="literal">auto</code> is given, YAZ client will
301 convert strings to the encoding of the
302 terminal as returned by <code class="function">nl_langinfo</code> call.
304 If <em class="replaceable"><code>marcharset</code></em> is given, it specifies name
305 of the character set of retrieved MARC records from server. See
306 also <code class="literal">marcharset</code> command.
307 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
308 Since character set negotation takes effect in the Z39.50
309 Initialize Request you should issue this command before
310 command <a class="link" href="client.commands.html#command-open"><code class="literal">open</code></a>
312 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
313 MARC records are not covered by Z39.50 character set negotiation,
314 so that's why there is a separate character that must be known
315 in order to do meaningful converson(s).
316 </p></div></dd><dt><span class="term">
317 <code class="literal">negcharset</code>
318 <em class="replaceable"><code>charset</code></em>
319 </span></dt><dd><p>Specifies character set for negotiation (Z39.50). The
320 argument is the same as second argument for command
321 <a class="link" href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
322 </p></dd><dt><span class="term">
323 <code class="literal">displaycharset</code>
324 <em class="replaceable"><code>charset</code></em>
325 </span></dt><dd><p>Specifies character set for output (display). The
326 argument is the same as second argument for command
327 <a class="link" href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
328 </p></dd><dt><span class="term">
329 <code class="literal">marccharset</code>
330 <em class="replaceable"><code>charset</code></em>
331 </span></dt><dd><p>Specifies character set for retrieved MARC records so
332 that YAZ client can display them in a character suitable
333 for your display. See <code class="literal">charset</code> command.
334 If <code class="literal">auto</code> is given, YAZ will assume
335 that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
336 for all other MARC variants. The charset argument is the
337 same as third argument for command
338 <a class="link" href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
339 </p></dd><dt><span class="term">
340 <code class="literal">querycharset</code>
341 <em class="replaceable"><code>charset</code></em>
342 </span></dt><dd><p>Specifies character set for query terms for Z39.50 RPN
343 queries and Z39.50 Scan Requests (termListAndStartPoint).
344 This is a pure client-side conversion which converts from
345 displayCharset to queryCharset.
346 </p></dd><dt><span class="term">
347 <code class="literal">set_cclfile</code>
348 <em class="replaceable"><code>filename</code></em>
349 </span></dt><dd><p>Specifies that CCL fields should be read from file
350 file <em class="replaceable"><code>filename</code></em>. This command does the
351 thing as option <code class="literal">-c</code>.
352 </p></dd><dt><span class="term">
353 <code class="literal">set_cqlfile</code>
354 <em class="replaceable"><code>filename</code></em>
355 </span></dt><dd><p>Specifies that CQL fields should be read from file
356 file <em class="replaceable"><code>filename</code></em>. This command does the
357 thing as option <code class="literal">-q</code>.
358 </p></dd><dt><span class="term">
359 <code class="literal">register_oid</code>
360 <em class="replaceable"><code>name</code></em>
361 <em class="replaceable"><code>class</code></em>
362 <em class="replaceable"><code>OID</code></em>
363 </span></dt><dd><p>This command allows you to register your own object
364 identifier - so that instead of entering a long dot-notation
365 you can use a short name instead.
366 The <em class="replaceable"><code>name</code></em> is your
367 name for the OID, <em class="replaceable"><code>class</code></em> is the
368 class, and <em class="replaceable"><code>OID</code></em> is the raw OID in
369 dot notation. Class is one <code class="literal">appctx</code>,
370 <code class="literal">absyn</code>, <code class="literal">attet</code>,
371 <code class="literal">transyn</code>, <code class="literal">diagset</code>,
372 <code class="literal">recsyn</code>, <code class="literal">resform</code>,
373 <code class="literal">accform</code>, <code class="literal">extserv</code>,
374 <code class="literal">userinfo</code>, <code class="literal">elemspec</code>,
375 <code class="literal">varset</code>, <code class="literal">schema</code>,
376 <code class="literal">tagset</code>, <code class="literal">general</code>.
377 If you're in doubt use the <code class="literal">general</code>
379 </p></dd><dt><span class="term">
380 <code class="literal">register_tab</code>
381 <em class="replaceable"><code>command</code></em>
382 <em class="replaceable"><code>string</code></em>
383 </span></dt><dd><p>This command registers a TAB completion string for
385 </p></dd><dt><span class="term">
386 <code class="literal">sleep</code>
387 <em class="replaceable"><code>seconds</code></em>
388 </span></dt><dd><p>This command makes YAZ client sleep (be idle) for
389 the number of seconds given.
390 </p></dd><dt><a name="command-wait-response"></a><span class="term">
391 <code class="literal">wait_response</code>
392 [ <em class="replaceable"><code>number</code></em>]
393 </span></dt><dd><p>This command makes YAZ client wait for a number of
394 response packages from target. If <em class="replaceable"><code>number</code></em> is
395 omitted, 1 is assumed.
396 </p><p>This command is rarely used and is only useful if command
397 <a class="link" href="client.commands.html#command-set-auto-wait">
398 <code class="literal">set_auto_wait</code>
400 </p></dd><dt><a name="command-xmles"></a><span class="term">
401 <code class="literal">xmles</code>
402 <em class="replaceable"><code>OID</code></em>
403 <em class="replaceable"><code>doc</code></em>
404 </span></dt><dd><p>Sends XML Extended Services request using the OID and doc given.
405 </p></dd><dt><span class="term">
406 <code class="literal">zversion</code>
407 <em class="replaceable"><code>ver</code></em>
408 </span></dt><dd><p>This command sets Z39.50 version for negotiation.
409 Should be used before
410 <a class="link" href="client.commands.html#command-open"><code class="literal">open</code></a>.
411 By default 3 (version 3) is used.
412 </p></dd><dt><span class="term">
413 <code class="literal">options</code>
414 <em class="replaceable"><code>op1 op2..</code></em>
415 </span></dt><dd><p>This command sets Z39.50 options for negotiation.
416 Should be used before
417 <a class="link" href="client.commands.html#command-open"><code class="literal">open</code></a>.
419 The following options are supported:
420 <code class="literal">search</code>,
421 <code class="literal">present</code>,
422 <code class="literal">delSet</code>,
423 <code class="literal">resourceReport</code>,
424 <code class="literal">triggerResourceCtrl</code>,
425 <code class="literal">resourceCtrl</code>,
426 <code class="literal">accessCtrl</code>,
427 <code class="literal">scan</code>,
428 <code class="literal">sort</code>,
429 <code class="literal">extendedServices</code>,
430 <code class="literal">level_1Segmentation</code>,
431 <code class="literal">level_2Segmentation</code>,
432 <code class="literal">concurrentOperations</code>,
433 <code class="literal">namedResultSets</code>,
434 <code class="literal">encapsulation</code>,
435 <code class="literal">resultCount</code>,
436 <code class="literal">negotiationModel</code>,
437 <code class="literal">duplicationDetection</code>,
438 <code class="literal">queryType104</code>,
439 <code class="literal">pQESCorrection</code>,
440 <code class="literal">stringSchema</code>.
441 </p></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="client.invoking.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="client.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="client.searching.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2. Invoking the YAZ client </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 4. Searching</td></tr></table></div></body></html>