get_sort_codes

General Purpose

This service formats the tab_sort table residing under a given library into an XML output reply.

Input Parameters

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 has 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 are also included in the XML.

<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>MJ6DAKYQANKTLPV82ESV6MN7FRDKXIKBGBRIH9QIQ1H46QEHK5</session-id>

Example:
If you want to get formatted XML for the tab_sort table residing under the GEN01 library, enter the following URL:

http://il-dtldev02:8881/X?op=get-sort-codes&library=gen01

In GEN01, 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

The output only generates the codes (fields: 3, 6, 9, 12, 15) and subfields (fields: 4,7,10,13,16):

<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>
</sort-04>
<sort-05>
<field-code-1>440##</field-code-1>
<sub-field-1>av</sub-field-1>
</sort-05>
<session-id>MJ6DAKYQANKTLPV82ESV6MN7FRDKXIKBGBRIH9QIQ1H4
6QEHK5</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>