The zclient Utility
The zclient utility is a Z39.50 client interface program that allows you to access a local or remote Z39.50 server and issue Z39.50 search, scan, and retrieval requests against the databases hosted on the target server. The zclient utility is a useful tool for testing and verifying your ability to search databases hosted on local or remote Z39.50 servers.
The zclient utility
is located in the <WebZ_root>/scripts directory of your
WebZ installation. The utility is a script which executes the ORG.oclc.z39.client.zclient
class.
Connecting to the ZBase Server with the zclient Utility
By using the zclient utility to connect to the ZBase server of your WebZ system, you can test/verify which databases and servers your WebZ system has access to. Once connected to the ZBase server, you can issue Z39.50 requests to the databases listed in your system's databases.ini file and thus test WebZ's ability to interract with the servers hosting those databases.
The following procedure describes how to connect to the ZBase server with zclient.
1. Identify which port the ZBase server is currently assigned to, as follows:
- In the <WebZ_root>/scripts directory, run the ssadmin interface program.
- Type "list" at the ssadmin command prompt and press Enter. This will list the current WebZ processes that are running. Note: If OpServe is the only process in the list, wait a few seconds and enter "list" again.
- In the PORT column of the list, note the port number ZBase is currently assigned to. If the "PORT" column does not appear in the list, exit ssadmin and modify the SSAdmin.ini file so that PORT appears in the list.
- After identifying the port number of ZBase, exit the ssadmin program by typing "quit" and pressing Enter.
|
2. Run zclient. To do this from the <WebZ_root>/scripts directory, type the following at the command prompt and press Enter:
"zclient -hhostname -pport -r [-u autho/password]"
where hostname is the name of the host on which ZBase is running and port is the port number identified in Step 1. The "-r" option activates zclient's reconnect capability and is required when connecting to the ZBase server. If your ZBase server requires an authorization and password, include the -u option.
Result: The zclient utility will display a startup message indicating that it is running, and the zclient command prompt will display. The end of the startup message lists the databases that zclient has access to via the ZBase server. The databases listed in the message should include each database that appears in your databases.ini file.
|
3. Once connected to the ZBase server, issue Z39.50 search, scan, and retrieval requests to the databases you have access to. Refer to the following section, Using zclient, for information on commonly-used zclient commands.
|
Commonly Used Commands in zclient
To view Help for zclient commands: Type "help" or "?" and press Enter at the zclient command prompt to display a list of zclient commands.
To view the List of Databases zclient has access to: Type "db" and press Enter to display a list of databases that zclient currently has access to.
To select a SINGLE database to search: To select a database to search, type "db database" where database is the name of an available database. The database you select will remain the "active" database until you specify another.
To select MULTIPLE databases to search: To select multiple databases to perform a cross-database search, type "db database1 database2 database3" and so on.
To search a database: The following are examples of common types of search requests you can issue through zclient.
Note: |
The use and structure attributes used in the following example are for the ABII database included with your WebZ installation. The use and structure attributes you use in Z39.50 requests to other databases depends on the index structure of those databases. Use and structure attributes for a particular database are defined in the database's configuration file.
|
Example 1: The command below searches the ABII database for the term "heart" in the Keyword index. The "u=1016" represents "use attribute = 1016", the MARC standard for a keyword index.
Example 2: The command below searches the ABII database for the term "amdur" in the Authors keyword index and for the term "boundless" in the Titles keyword index. The search uses the boolean operator "and". The "s=2" represents structure attribute 2 (a word index).
Command: f amdur/u=1003;s=2; boundless/u=4;s=2; and
|
Example 3: The command below searches the ABII database for the phrase "amdur meredith" in the FullAuthors index. The "s=1" represents structure attribute 1 (a phrase index). The use of the quotes is required when searching for an exact phrase.
Command: f "amdur meredith"/u=1003;s=1
|
To retrieve and display a record from a database:
You can retrieve and display records from a database only after
issuing a search request that found one or more records in the database.
To retrieve and display a record from a successful search, type "d recordnumber"
where recordnumber is the number of the record you wish to display.
By default, the record is displayed in BER format, though you can specify
another format using the syntax command (described below).
To change the current record syntax: To change or set the syntax used to retrieve and display records, type "syntax recsyntax" where recsyntax is BER, MARC, SUTRS, OPAC, or EXPLAIN. You will receive a "Present failed" message if the database server you are accessing does not support the selected syntax and you attempt to display a record received from that server.
Scanning for a term in a database: The command below scans (or browses) the ABII database for the term "davis" in the Authors keyword index. The result of this command is a list of twenty terms, with the term "davis" (or its nearest equivalent) in the middle of the list. Next to each term in the list is the number of occurences of the term in the database index.
Command: scan davis/u=1003
Scan Successful! 20 terms returned
'curt' 1
'd' 13
'dail' 1
'dana' 1
'daniel' 8
'danna' 1
'daoust' 1
'dave' 6
'david' 26
'davies' 5
'davis' 3
'dawn' 7
'debbie' 1
'deborah' 10
'debra' 4
'dechow' 1
'degeorge' 1
'del' 1
'denitto' 3
'dennis' 1
|
|