get_sort_codes
General Purpose
This service formats the tab_sort table residing under a given library into an XML output reply.
Interface Type
X-Service
Product Version Compatibility
Version 18 and later
Input Parameter
1. LIBRARY – X (5).
Library: Insert the library for which you want to have an XML format tab_sort table.
Output XML Format
Each line in tab_sort will have an XML tag with its record number in the table (for example, <sort-01> for the first record in the table). For each record, all field codes and their subfields will also be included in the XML.
<?xml version = "1.0" encoding = "UTF-8"?> <get-sort-codes> <sort-01> <field-code-1>008</field-code-1> <field-code-2>260##</field-code-2> <sub-field-2>c</sub-field-2> </sort-01> <sort-02> <field-code-1>1####</field-code-1> <sub-field-1>a</sub-field-1> <field-code-2>700##</field-code-2> <sub-field-2>a</sub-field-2> </sort-02> <!-- ... --> <session-id>GIN346E1HGCA88S87MEKCXXPHMLUVH985EEP94JF9VA1Y49XN6</session-id> </get-sort-codes>
Example:
If you want to get formatted XML for the tab_sort table residing under the USM01 library, enter the following URL:
http://ram19:8991/X?op=get-sort-codes&library=usm01
In USM01, the tab_sort table looks like this:
! 1 1 1 1 !1 2 3 4 5 6 7 8 9 10 1 12 13 4 15 16 7 18 9 !!-!!-!!!!!-!!!!!-!-!!!!!-!!!!!-!-!!!!!-!!!!!-!-!!!!!-!!!!!-!-!!!!!-!!!!!-!-!!-!! 01 95 008 260## c 08 04 02 01 1#### a 700## a 00 00 03 11 245## a 2 240## 2 00 00 04 22 050## LOC## hjl 084## a 00 00 05 11 440## av 2 00 00 06 TYP## FMT## 00 00 07 01 BND 245## a 2 00 00
The output will only generate the codes (fields: 3, 6, 9, 12, 15) and subfields (fields: 4,7,10,13,16):
<?xml version = "1.0" encoding = "UTF-8"?> <get-sort-codes> <sort-01> <field-code-1>008</field-code-1> <field-code-2>260##</field-code-2> <sub-field-2>c</sub-field-2> </sort-01> <sort-02> <field-code-1>1####</field-code-1> <sub-field-1>a</sub-field-1> <field-code-2>700##</field-code-2> <sub-field-2>a</sub-field-2> </sort-02> <sort-03> <field-code-1>245##</field-code-1> <sub-field-1>a</sub-field-1> <field-code-2>240##</field-code-2> </sort-03> <sort-04> <field-code-1>050##</field-code-1> <field-code-2>LOC##</field-code-2> <sub-field-2>hjl</sub-field-2> <field-code-3>084##</field-code-3> <sub-field-3>a</sub-field-3> </sort-04> <sort-05> <field-code-1>440##</field-code-1> <sub-field-1>av</sub-field-1> </sort-05> <sort-06> <field-code-1>TYP##</field-code-1> <field-code-2>FMT##</field-code-2> </sort-06> <sort-07> <field-code-1>BND</field-code-1> <field-code-2>245##</field-code-2> <sub-field-2>a</sub-field-2> </sort-07> <session-id>GIN346E1HGCA88S87MEKCXXPHMLUVH985EEP94JF9VA1Y49XN6</session-id> </get-sort-codes>
Possible Error Codes
1. If the Get Sort Codes X-Service is activated without a library code having been entered, the following error message appears in the XML output:
< error>Library must be included in service params.</error>
2. If, for the given library, the tab_sort table is empty, the following error message appears in the XML output:
< error>Tab_Sort table is empty for given Library.</error>