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.70.1"><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 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 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">scanpos</code> <em class="replaceable"><code>pos</code></em>
61 Sets preferred position for scan. This value
62 is used in next scan. By default position is 1.
63 </dd><dt><span class="term">
64 <code class="literal">scansize</code> <em class="replaceable"><code>size</code></em>
66 Sets number of entries to be returned by scan. Default
67 number of entries is 20.
68 </dd><dt><span class="term">
69 <code class="literal">scanstep</code> <em class="replaceable"><code>step</code></em>
71 Set step-size for scan. This value is used in next scan
72 sent to the target. By default step-size is 0.
73 </dd><dt><a name="sortspec"></a><span class="term">
74 <code class="literal">sort</code> <em class="replaceable"><code>sortspecs</code></em>
75 </span></dt><dd><p>Sorts a result set. The sort command takes a
76 sequence of space-separated sort specifications, with each sort
77 specification consisting of two space-separated words (so that the
78 whole specification list is made up of an even number of words).
79 The first word of each specification
80 holds a field (sort criterion) and the second holds flags.
81 If the sort criterion includes <code class="literal">=</code> it is assumed
82 that the <code class="literal">SortKey</code> is of type
83 <code class="literal">sortAttributes</code> using Bib-1: in this case
84 the integer before <code class="literal">=</code> is
85 the attribute type and the integer following <code class="literal">=</code>
86 is the attribute value.
87 If no <code class="literal">=</code> is in the criterion it is treated as a
88 sortfield of type InternationalString.
89 The flags word of each sort specification must consist of
90 <code class="literal">s</code>
91 for case sensitive or <code class="literal">i</code> for case insensitive, and
92 <code class="literal"><</code> for ascending order or <code class="literal">></code>
94 </p></dd><dt><span class="term">
95 <code class="literal">sort+</code>
96 </span></dt><dd><p>Same as <code class="literal">sort</code> but stores the sorted
97 result set in a new result set.
98 </p></dd><dt><span class="term">
99 <code class="literal">authentication</code> <em class="replaceable"><code>openauth</code></em>
100 </span></dt><dd><p>Sets up a authentication string if a server requires
101 authentication (v2 OpenStyle). The authentication string is first
102 sent to the server when the
103 <a href="client.commands.html#command-open"><code class="literal">open</code></a> command is
104 issued and the Z39.50 Initialize Request is sent, so this command
105 must be used before <code class="literal">open</code> in order to be effective.
106 A common convention for the <em class="replaceable"><code>authopen</code></em> string
107 is that the username - and password is separated by a slash, e.g.
108 <code class="literal">myusername/mysecret</code>.
109 </p></dd><dt><span class="term">
110 <code class="literal">sru</code> <em class="replaceable"><code>method</code></em>
111 </span></dt><dd><p>Selects SRU method. Must be one of <code class="literal">POST</code>,
112 <code class="literal">GET</code>, <code class="literal">SOAP</code> (default).
113 </p></dd><dt><span class="term">
114 <code class="literal">list_all</code>
115 </span></dt><dd><p>This command displays status and values for many settings.
116 </p></dd><dt><span class="term">
117 <code class="literal">lslb</code> <em class="replaceable"><code>n</code></em>
118 </span></dt><dd><p>Sets the limit for when no records should be returned
119 together with the search result.
121 <a href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
125 </p></dd><dt><span class="term">
126 <code class="literal">ssub</code> <em class="replaceable"><code>n</code></em>
127 </span></dt><dd><p>Sets the limit for when all records should be returned with
130 <a href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
132 </a> for more details.
133 </p></dd><dt><span class="term">
134 <code class="literal">mspn</code> <em class="replaceable"><code>n</code></em>
135 </span></dt><dd><p>Sets the number of records should be returned if the
136 number of records in the result set is between the values of
137 <code class="literal">lslb</code> and <code class="literal">ssub</code>.
139 <a href="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6" target="_top">
143 </p></dd><dt><span class="term">
144 <code class="literal">status</code>
145 </span></dt><dd><p>Displays the values of <code class="literal">lslb</code>,
146 <code class="literal">ssub</code> and <code class="literal">mspn</code>.
147 </p></dd><dt><span class="term">
148 <code class="literal">setname</code>
149 </span></dt><dd><p>Switches named result sets on and off. Default is on.
150 </p></dd><dt><span class="term">
151 <code class="literal">cancel</code>
152 </span></dt><dd><p>Sends a Trigger Resource Control Request to the target.
153 </p></dd><dt><span class="term">
154 <code class="literal">format</code> <em class="replaceable"><code>oid</code></em>
155 </span></dt><dd><p>Sets the preferred transfer syntax for retrieved records.
156 yaz-client supports all the record syntaxes that currently
158 <a href="http://www.loc.gov/z3950/agency/defns/oids.html#5" target="_top">
161 for more details. Commonly used records syntaxes include usmarc,
163 </p></dd><dt><span class="term">
164 <code class="literal">elements</code> <em class="replaceable"><code>e</code></em>
165 </span></dt><dd><p>Sets the element set name for the records. Many targets support
166 element sets are B (for brief) and F (for full).
167 </p></dd><dt><span class="term">
168 <code class="literal">close</code>
169 </span></dt><dd><p>Sends a Z39.50 Close APDU and closes connection with the peer
170 </p></dd><dt><a name="command-querytype"></a><span class="term">
171 <code class="literal">querytype</code> <em class="replaceable"><code>type</code></em>
172 </span></dt><dd><p>Sets the query type as used by command
173 <a href="client.commands.html#command-find"><code class="literal">find</code></a>.
174 The following is supported:
175 <code class="literal">prefix</code> for
176 <a href="tools.html#PQF" title="1.1. Prefix Query Format">Prefix Query Notation</a> (Type-1 Query);
177 <code class="literal">ccl</code> for CCL search (Type-2 Query),
178 <code class="literal">cql</code> for CQL (Type-104 search with CQL OID),
179 <code class="literal">ccl2rpn</code> for
180 <a href="tools.html#CCL" title="1.2. CCL">CCL</a> to RPN conversion (Type-1 Query).
181 <code class="literal">cql2rpn</code> for
182 CQL to RPN conversion (Type-1 Query).
183 </p></dd><dt><span class="term">
184 <code class="literal">attributeset</code> <em class="replaceable"><code>set</code></em>
186 Sets attribute set OID for prefix queries (RPN, Type-1).
187 </p></dd><dt><span class="term">
188 <code class="literal">refid</code> <em class="replaceable"><code>id</code></em>
189 </span></dt><dd><p>Sets reference ID for Z39.50 Request(s).
190 </p></dd><dt><span class="term">
191 <code class="literal">itemorder</code>
192 <em class="replaceable"><code>type</code></em> <em class="replaceable"><code>no</code></em>
193 </span></dt><dd><p>Sends an Item Order Request using the ILL External.
194 <em class="replaceable"><code>type</code></em> is either 1 or 2 which corresponds to
195 ILL-Profile 1 and 2 respectively. The <em class="replaceable"><code>no</code></em>
196 is the Result Set position of the record to be ordered.
197 </p></dd><dt><span class="term">
198 <code class="literal">update</code>
199 <em class="replaceable"><code>action</code></em>
200 <em class="replaceable"><code>recid</code></em>
201 <em class="replaceable"><code>doc</code></em>
202 </span></dt><dd><p>Sends Item Update Request. The <em class="replaceable"><code>action</code></em>
203 argument must be the action type: one of <code class="literal">insert</code>,
204 <code class="literal">replace</code>, <code class="literal">delete</code> and
205 <code class="literal">update</code>. The second argument,
206 <em class="replaceable"><code>recid</code></em>, is the
207 record identifier (any string). Third argument which is optional is
208 the record document for the request. If doc is a quoted string
209 (double quotes) the string content is used verbatim. If doc is not
210 a quoted string, it is assumed to be a filename which is read, then
211 sent as the docuemnt content. If doc is omitted, the last received
212 record (as parf of present response or piggybacked search response)
213 is used for the update.
214 </p></dd><dt><span class="term">
215 <code class="literal">.</code>
216 <em class="replaceable"><code>filename</code></em>
217 </span></dt><dd><p>Executes list of commands from
218 file <em class="replaceable"><code>filename</code></em>, just like source on
220 </p></dd><dt><span class="term">
221 <code class="literal">!</code>
222 <em class="replaceable"><code>args</code></em>
223 </span></dt><dd><p>Executes command <em class="replaceable"><code>args</code></em> in subshell
224 using the <code class="literal">system</code> call.
225 </p></dd><dt><span class="term">
226 <code class="literal">push_command</code>
227 <em class="replaceable"><code>command</code></em>
228 </span></dt><dd><p>The push_command takes another command as its argument.
229 That command is then added to the history information (so
230 you can retrieve it later). The command itself is not
231 executed. This command only works if you have GNU readline/history
233 </p></dd><dt><span class="term">
234 <code class="literal">set_apdufile</code>
235 <em class="replaceable"><code>filename</code></em>
236 </span></dt><dd><p>Sets that APDU should be logged to file
237 <em class="replaceable"><code>filename</code></em>. Another way to achieve
238 APDU log is by using command-line option <code class="literal">-a</code>.
239 </p></dd><dt><span class="term">
240 <code class="literal">set_auto_reconnect</code>
241 <em class="replaceable"><code>flag</code></em>
242 </span></dt><dd><p>Specifies whether YAZ client automatically reconnect if
243 target closes connection (Z39.50 only).
245 <em class="replaceable"><code>flag</code></em> must be either
246 <code class="literal">on</code> or <code class="literal">off</code>.
247 </p></dd><dt><a name="command-set-auto-wait"></a><span class="term">
248 <code class="literal">set_auto_wait</code>
249 <em class="replaceable"><code>flag</code></em>
250 </span></dt><dd><p>Specifies whether YAZ client should wait for
251 response protocol packages after a request.
252 By default YAZ client waits (on) for response packages immediately
253 after a command (find, show) has been issued. If <code class="literal">off</code>
254 is used, YAZ client does not attempt to receive packages automatically.
255 These will have to be manually received when command
256 <a href="client.commands.html#command-wait-response">
257 <code class="literal">wait_response</code>
260 <em class="replaceable"><code>flag</code></em> must be either
261 <code class="literal">on</code> or <code class="literal">off</code>.
262 </p></dd><dt><span class="term">
263 <code class="literal">set_marcdump</code>
264 <em class="replaceable"><code>filename</code></em>
265 </span></dt><dd><p>Specifies that all retrieved records should be appended to
266 file <em class="replaceable"><code>filename</code></em>. This command does the
267 thing as option <code class="literal">-m</code>.
268 </p></dd><dt><span class="term">
269 <code class="literal">schema</code>
270 <em class="replaceable"><code>schemaid</code></em>
271 </span></dt><dd><p>Specifies schema for retrieval.
272 Schema may be specified as an OID for Z39.50.
273 For SRU, schema is a simple string URI.
274 </p></dd><dt><a name="command-charset"></a><span class="term">
275 <code class="literal">charset</code>
276 <em class="replaceable"><code>negotiationcharset</code></em>
277 [<em class="replaceable"><code>displaycharset</code></em>]
278 [[<em class="replaceable"><code>marccharset</code></em>]]
279 </span></dt><dd><p>Specifies character set (encoding) for Z39.50
280 negotiation / SRU encoding and/or character set for output (terminal).
282 <em class="replaceable"><code>negotiationcharset</code></em> is the name
283 of the character set to be negotiated by the server. The special name
284 <code class="literal">-</code> for <em class="replaceable"><code>negotiationcharset</code></em>
285 specifies <span class="emphasis"><em>no</em></span> character set to be negotiated.
287 If <em class="replaceable"><code>displaycharset</code></em> is given, it specifies name
288 of the character set of the output (on the terminal on which
289 YAZ client is running). To disable conversion of characters
290 to the output encoding, the special name <code class="literal">-</code> (dash)
292 If the special name <code class="literal">auto</code> is given, YAZ client will
293 convert strings to the encoding of the
294 terminal as returned by <code class="function">nl_langinfo</code> call.
296 If <em class="replaceable"><code>marcharset</code></em> is given, it specifies name
297 of the character set of retrieved MARC records from server. See
298 also <code class="literal">marcharset</code> command.
299 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
300 Since character set negotation takes effect in the Z39.50
301 Initialize Request you should issue this command before
302 command <a href="client.commands.html#command-open"><code class="literal">open</code></a>
304 </p></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
305 MARC records are not covered by Z39.50 character set negotiation,
306 so that's why there is a separate character that must be known
307 in order to do meaningful converson(s).
308 </p></div></dd><dt><span class="term">
309 <code class="literal">negcharset</code>
310 <em class="replaceable"><code>charset</code></em>
311 </span></dt><dd><p>Specifies character set for negotiation (Z39.50). The
312 argument is the same as second argument for command
313 <a href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
314 </p></dd><dt><span class="term">
315 <code class="literal">displaycharset</code>
316 <em class="replaceable"><code>charset</code></em>
317 </span></dt><dd><p>Specifies character set for output (display). The
318 argument is the same as second argument for command
319 <a href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
320 </p></dd><dt><span class="term">
321 <code class="literal">marccharset</code>
322 <em class="replaceable"><code>charset</code></em>
323 </span></dt><dd><p>Specifies character set for retrieved MARC records so
324 that YAZ client can display them in a character suitable
325 for your display. See <code class="literal">charset</code> command.
326 If <code class="literal">auto</code> is given, YAZ will assume
327 that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
328 for all other MARC variants. The charset argument is the
329 same as third argument for command
330 <a href="client.commands.html#command-charset"><code class="literal">charset</code></a>.
331 </p></dd><dt><span class="term">
332 <code class="literal">set_cclfile</code>
333 <em class="replaceable"><code>filename</code></em>
334 </span></dt><dd><p>Specifies that CCL fields should be read from file
335 file <em class="replaceable"><code>filename</code></em>. This command does the
336 thing as option <code class="literal">-c</code>.
337 </p></dd><dt><span class="term">
338 <code class="literal">set_cqlfile</code>
339 <em class="replaceable"><code>filename</code></em>
340 </span></dt><dd><p>Specifies that CQL fields should be read from file
341 file <em class="replaceable"><code>filename</code></em>. This command does the
342 thing as option <code class="literal">-q</code>.
343 </p></dd><dt><span class="term">
344 <code class="literal">register_oid</code>
345 <em class="replaceable"><code>name</code></em>
346 <em class="replaceable"><code>class</code></em>
347 <em class="replaceable"><code>OID</code></em>
348 </span></dt><dd><p>This command allows you to register your own object
349 identifier - so that instead of entering a long dot-notation
350 you can use a short name instead.
351 The <em class="replaceable"><code>name</code></em> is your
352 name for the OID, <em class="replaceable"><code>class</code></em> is the
353 class, and <em class="replaceable"><code>OID</code></em> is the raw OID in
354 dot notation. Class is one <code class="literal">appctx</code>,
355 <code class="literal">absyn</code>, <code class="literal">attet</code>,
356 <code class="literal">transyn</code>, <code class="literal">diagset</code>,
357 <code class="literal">recsyn</code>, <code class="literal">resform</code>,
358 <code class="literal">accform</code>, <code class="literal">extserv</code>,
359 <code class="literal">userinfo</code>, <code class="literal">elemspec</code>,
360 <code class="literal">varset</code>, <code class="literal">schema</code>,
361 <code class="literal">tagset</code>, <code class="literal">general</code>.
362 If you're in doubt use the <code class="literal">general</code>
364 </p></dd><dt><span class="term">
365 <code class="literal">register_tab</code>
366 <em class="replaceable"><code>command</code></em>
367 <em class="replaceable"><code>string</code></em>
368 </span></dt><dd><p>This command registers a TAB completion string for
370 </p></dd><dt><span class="term">
371 <code class="literal">sleep</code>
372 <em class="replaceable"><code>seconds</code></em>
373 </span></dt><dd><p>This command makes YAZ client sleep (be idle) for
374 the number of seconds given.
375 </p></dd><dt><a name="command-wait-response"></a><span class="term">
376 <code class="literal">wait_response</code>
377 [ <em class="replaceable"><code>number</code></em>]
378 </span></dt><dd><p>This command makes YAZ client wait for a number of
379 response packages from target. If <em class="replaceable"><code>number</code></em> is
380 omitted, 1 is assumed.
381 </p><p>This command is rarely used and is only useful if command
382 <a href="client.commands.html#command-set-auto-wait">
383 <code class="literal">set_auto_wait</code>
385 </p></dd><dt><a name="command-xmles"></a><span class="term">
386 <code class="literal">xmles</code>
387 <em class="replaceable"><code>OID</code></em>
388 <em class="replaceable"><code>doc</code></em>
389 </span></dt><dd><p>Sends XML Extended Services request using the OID and doc given.
390 </p></dd><dt><span class="term">
391 <code class="literal">zversion</code>
392 <em class="replaceable"><code>ver</code></em>
393 </span></dt><dd><p>This command sets Z39.50 version for negotiation.
394 Should be used before
395 <a href="client.commands.html#command-open"><code class="literal">open</code></a>.
396 By default 3 (version 3) is used.
397 </p></dd><dt><span class="term">
398 <code class="literal">options</code>
399 <em class="replaceable"><code>op1 op2..</code></em>
400 </span></dt><dd><p>This command sets Z39.50 options for negotiation.
401 Should be used before
402 <a href="client.commands.html#command-open"><code class="literal">open</code></a>.
404 The following options are supported:
405 <code class="literal">search</code>,
406 <code class="literal">present</code>,
407 <code class="literal">delSet</code>,
408 <code class="literal">resourceReport</code>,
409 <code class="literal">triggerResourceCtrl</code>,
410 <code class="literal">resourceCtrl</code>,
411 <code class="literal">accessCtrl</code>,
412 <code class="literal">scan</code>,
413 <code class="literal">sort</code>,
414 <code class="literal">extendedServices</code>,
415 <code class="literal">level_1Segmentation</code>,
416 <code class="literal">level_2Segmentation</code>,
417 <code class="literal">concurrentOperations</code>,
418 <code class="literal">namedResultSets</code>,
419 <code class="literal">encapsulation</code>,
420 <code class="literal">resultCount</code>,
421 <code class="literal">negotiationModel</code>,
422 <code class="literal">duplicationDetection</code>,
423 <code class="literal">queryType104</code>,
424 <code class="literal">pQESCorrection</code>,
425 <code class="literal">stringSchema</code>.
426 </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>