# jBASE XML FUNCTIONS

Created At: 4/27/2017 4:17:25 PM
Updated At: 5/3/2018 5:43:45 PM
Original Doc: 252772-jbase-xml-functions
Original ID: 252772
Internal: Yes

  1. Current functions

READXML WRITEXML DYNTOXML XMLTODYN XMLTOXML XML.VALIDATE XML.ADD.TEXT XML.ADD.NODE XML.GET.TAG.VALUE

NOTE: most of the XML functions have issues casting between strings and wchars,

not a big deal to fix, would be best if we get together and have a cunning plan on the functionality before starting.

1.1. READXML

READXML rec FROM file, id ELSE STOP 203

1.2. WRITEXML

WRITEXML rec ON file, id

1.3. DYNTOXML

resulting_xml = DYNTOXML(data, "", return_code)

resulting_xml = DYNTOXML(data, <template>, return_code)

1.4. XMLTODYN

resulting_syn_array = XMLTODYN(xml_data, "", return_code)

resulting_syn_array = XMLTODYN(xml_data, <template>, return_code)

1.5. XMLTOXML

resulting_xml = DYNTOXML(xml_data, <template>, return_code)

1.6. XML.VALIDATE

result = XML.VALIDATE(xml, "")

•returns "valid" if OK.

1.7. XML.ADD.TEXT

result_one_xml = XML.ADD.TEXT("firstname", "Greg")

<firstname>Greg</firstname>

1.8. XML.ADD.NODE

Has some issues, could be its just not working as expected...

xml = XML.ADD.NODE("people", <firstname<Greg</firstname<

<people><firstname>Greg</firstname></people>

1.9. XML.GET.TAG.VALUE

zzz = XML.GET.TAG.VALUE(xml_string, "details/detail/address")

  1. Working example of readxml/writexml

The READXML statement reads a record from a file using the style sheet held in @READXML to transform the data into XML format.

@READXML
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<mycustomer>
<xsl:for-each select="array/data">
<xsl:if test="@attribute=1"><firstname><xsl:value-of select="."/></firstname></xsl:if>
<xsl:if test="@attribute=2"><lastname><xsl:value-of select="."/></lastname></xsl:if>
. . .
<xsl:if test="@attribute=14"><numusers><xsl:value-of select="."/></numusers></xsl:if>
</xsl:for-each>
</mycustomer>
</xsl:template>
</xsl:stylesheet>
1
2
3
4
5
6
7
8
9
10
11
12
13
14

For this example without worrying about what the template does, the key bit to look at is as follows…

<xsl:if test="@attribute=1">

<firstname><xsl:value-of select="."/></firstname>

</xsl:if>

•We tell the XML parser we want attribute 1, @attribute=1

•We supply some tags to wrap it in, <firstname></firstname>

•The xml parser takes care of all the MVs, <xsl:value-of select="."/>

The WRITEXML statement writes a dynamic array to a hashed file in XML format, using a style sheet from the DICT.

@WRITEXML
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="mycustomer"><array><xsl:apply-templates/></array></xsl:template>
<xsl:template match="firstname">
<data>
<xsl:attribute name="attribute">1</xsl:attribute>
<xsl:attribute name="value"><xsl:number level="single"/></xsl:attribute>
<xsl:attribute name="subvalue">1</xsl:attribute>
<xsl:value-of select="."/>
</data>
</xsl:template>
<xsl:template match="lastname">
. . .
</xsl:template>
</xsl:stylesheet>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

In the write template the bits to note are:

<xsl:attribute name="attribute">1</xsl:attribute>

<xsl:attribute name="value"><xsl:number level="single"/></xsl:attribute>

<xsl:attribute name="subvalue">1</xsl:attribute>

  • This tells the XML parser to add something for the attribute and value for each element in the current attribute. (sub values are limmited to 1)

Just like in the read template, the xml parser takes care of all MVs, <xsl:value-of select="."/>

  1. Testing

•Create test file using code at the bottom of this page.

•To see the whole thing working, run this test program

OPEN "XMLCUSTOMERS" TO file ELSE STOP 201
CRT "===================="
CRT "file jbase data"
SELECT file
LOOP WHILE READNEXT id
READ jbasedata FROM file, id ELSE STOP 203
CRT jbasedata
REPEAT
CRT "===================="
CRT "files as XML"
SELECT file
LOOP WHILE READNEXT id
READXML xmldata FROM file, id ELSE STOP 203
CRT xmldata
REPEAT
CRT "===================="
xmlrecord = ""
xmlrecord := '<?xml version="1.0" encoding="UTF-8"?>'
xmlrecord := "<mycustomer>"
xmlrecord := " <firstname>Luke</firstname>"
xmlrecord := " <lastname>WALKER</lastname>"
xmlrecord := " <address>10260 SW GREENBURG RD</address>"
xmlrecord := " <address2>#1020</address2>"
xmlrecord := " <city>PORTLAND</city>"
xmlrecord := " <state>IN</state>"
xmlrecord := "</mycustomer>"
id = "9999999"
CRT "Writing",xmlrecord
WRITEXML xmlrecord ON file, id
CRT "===================="
CRT "jbase record read back in"
CRT
READ jbasedata FROM file, id ELSE STOP 203
CRT jbasedata
CRT "===================="
CRT "xml record read back in..."
CRT
READXML xmldata FROM file, id ELSE STOP 203
CRT xmldata
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

We also have additional functions available in jBC to process XML using templates

XMLTODYN        Converts XML to a dynamic array

XMLTOXML        Transforms XML using an XSL

This can be covered in additional pages.

  1. Test data creation program
EXECUTE "CREATE-FILE XMLCUSTOMERS 1 1"
OPEN "XMLCUSTOMERS" TO file ELSE STOP 201,"XMLCUSTOMERS"
OPEN "DICT XMLCUSTOMERS" TO dict ELSE STOP 201,"XMLCUSTOMERS"


id = "FIRSTNAME"
rec = "41FE31FE46495253544E414D45FEFEFEFEFEFE4CFE3234"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "LASTNAME"
rec = "41FE32FE4C617374204E616D65FEFEFEFEFEFE4CFE3230"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "ADDR1"
rec = "41FE33FE41646472657373204C696E652031FEFEFEFEFEFE4CFE36"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "ADDR2"
rec = "41FE34FE41646472657373204C696E652032FEFEFEFEFEFE4CFE3230"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "CITY"
rec = "41FE35FE43697479FEFEFEFEFEFE4CFE3130"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "STATE"
rec = "41FE36FE5374617465FEFEFEFEFEFE4CFE33"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "ZIP"
rec = "41FE37FE5A6970FEFEFEFEFEFE4CFE3132"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "HOMETEL"
rec = "41FE38FE486F6D652054656CFEFEFEFEFEFE4CFE3136"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "WORKTEL"
rec = "41FE39FE576F726B2054656CFEFEFEFEFEFE4CFE3136"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "EMAIL"
rec = "41FE3130FE456D61696CFEFEFEFEFEFE4CFE3232"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "HARDWARE"
rec = "41FE3131FE4861726477617265FEFEFEFEFEFE4CFE3135"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "OS"
rec = "41FE3132FE4F53FEFEFEFEFEFE4CFE3135"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "NUMUSERS"
rec = "41FE3134FE4E756D205573657273FEFEFEFEFEFE4CFE36"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "SYSTEMTYPE"
rec = "41FE3133FE4D564442415345FEFEFEFEFEFE4CFE3234"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "@READXML"
rec = "3C3F786D6C2076657273696F6E3D22312E30223F3EFE3C78736C3A7374796C65736865657420786D6C6E733A78736C3D22687474703A2F2F7777772E77332E6F72672F313939392F58534C2F5472616E73666F726D222076657273696F6E3D22312E30223EFE3C78736C3A74656D706C617465206D617463683D222F223EFE3C6D79637573746F6D65723EFE3C78736C3A666F722D656163682073656C6563743D2261727261792F64617461223EFE3C78736C3A696620746573743D22406174747269627574653D31223E3C66697273746E616D653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F66697273746E616D653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D32223E3C6C6173746E616D653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F6C6173746E616D653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D33223E3C616464726573733E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F616464726573733E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D34223E3C61646472657373323E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F61646472657373323E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D35223E3C636974793E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F636974793E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D36223E3C73746174653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F73746174653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D37223E3C7A6970636F64653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F7A6970636F64653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D38223E3C74656C6570686F6E653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F74656C6570686F6E653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D39223E3C74656C6570686F6E65323E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F74656C6570686F6E65323E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D3130223E3C656D61696C3E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F656D61696C3E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D3131223E3C68617264776172653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F68617264776172653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D3132223E3C6F7065726174696E675F73797374656D3E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F6F7065726174696E675F73797374656D3E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D3133223E3C6D7664626173653E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F6D7664626173653E3C2F78736C3A69663EFE3C78736C3A696620746573743D22406174747269627574653D3134223E3C6E756D75736572733E3C78736C3A76616C75652D6F662073656C6563743D222E222F3E3C2F6E756D75736572733E3C2F78736C3A69663EFE3C2F78736C3A666F722D656163683EFE3C2F6D79637573746F6D65723EFE3C2F78736C3A74656D706C6174653EFE3C2F78736C3A7374796C6573686565743EFE"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id


id = "@WRITEXML"
rec = "3C3F786D6C2076657273696F6E3D22312E30223F3EFE3C78736C3A7374796C65736865657420786D6C6E733A78736C3D22687474703A2F2F7777772E77332E6F72672F313939392F58534C2F5472616E73666F726D222076657273696F6E3D22312E30223EFE3C78736C3A74656D706C617465206D617463683D226D79637573746F6D6572223EFE3C61727261793EFE3C78736C3A6170706C792D74656D706C617465732F3EFE3C2F61727261793EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D2266697273746E616D65223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E313C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226C6173746E616D65223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E323C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D2261646472657373223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E333C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226164647265737332223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E343C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D2263697479223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E353C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D227374617465223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E363C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D227A6970636F6465223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E373C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D2274656C6570686F6E65223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E383C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D2274656C6570686F6E6532223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E393C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D22656D61696C223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E31303C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226861726477617265223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E31313C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226F7065726174696E675F73797374656D223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E31323C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226D766462617365223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E31333C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C78736C3A74656D706C617465206D617463683D226E756D7573657273223EFE3C646174613EFE3C78736C3A617474726962757465206E616D653D22617474726962757465223E31343C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2276616C7565223E3C78736C3A6E756D626572206C6576656C3D2273696E676C65222F3E3C2F78736C3A6174747269627574653EFE3C78736C3A617474726962757465206E616D653D2273756276616C7565223E313C2F78736C3A6174747269627574653EFE3C78736C3A76616C75652D6F662073656C6563743D222E222F3EFE3C2F646174613EFE3C2F78736C3A74656D706C6174653EFEFE3C2F78736C3A7374796C6573686565743EFE"
out = OCONV(rec, "MCXA")
WRITE out ON dict,id




id = "0000051"
rec = "434C495645FE504950454E534C495050455253FE393939204C4554534245204156454E5545FE2331303230FE53454154544C45FE494EFE3234333538FE2835323429203535352D32343337FE2831323429203535352D31333337FE434C49564550406C7566637267726561742E636F6DFE415649494F4EFD525336303030FD44454C4CFD434F4D504151FD44454C4CFE44475558FD48505558FD554E495857415245FD5452553634FD44475558FE524F53FD416E6F74686572205069636BFD554E492AFD524F53FD554E492AFE393430FD31333635FD31303639FD31373034FD373639"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000084"
rec = "42494C4CFE424F59434F5454FE31323120454C4556454E2053515541524520FE415054203432FE455547454E45FE4341FE3234333538FE2835353529203535352D31323337FE2831323529203535352D31333337FE42494C4C4240747265782E636F6DFE434F4D504151FD5350415243FD44454C4CFE44475558FD554E495857415245FD5452553634FE426F6F21204E6F74206A42415345FD416E6F74686572205069636BFD554E492AFE31333336FD31393335FD3833"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000007"
rec = "444F4E4E41FE535545FE31323120454C4556454E2053515541524520FE415054203432FE53454154544C45FE4E5357FE3937323233FE2835353529203535352D31323337FE2835353529203535352D31323337FE444F4E4E415340636F6D70642E636F6DFE494E54454C20504949FD414C50484120415850FD44454C4CFD4850FD434F4D504151FE4C494E5558FD4E54FD554E495857415245FD554E495857415245FD5452553634FE6A42415345FD426F6F21204E6F74206A42415345FD554E492AFD426F6F21204E6F74206A42415345FD6A42415345FE31323230FD31353335FD363638FD31373739FD31343431"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000073"
rec = "444F5547FE4445434B4552FE313032363020535720475245454E42555247205244FE4C4556454C203432FE535052494E474649454C44FE4D49FE3937323233FE2831323429203535352D31333337FE2831323529203535352D31333337FE444F554744406E6F7370616D2E636F6DFE525336303030FD414C50484120415850FD414C50484120415850FD4449474954414CFE48505558FD44475558FD4F534631FD4E54FE554E492AFD426F6F21204E6F74206A42415345FD554E492AFD524F53FE383833FD363335FD373636FD31303438"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000106"
rec = "4841525259FE57414C4B4552FE313032363020535720475245454E42555247205244FE2331303230FE504F52544C414E44FE494EFE3039323834FE2835323429203535352D32343337FE2835323429203535352D32343337FE48415252595740636F6D707A2E636F6DFE4850FD4449474954414CFD5350415243FD494E54454C20504949FD525336303030FE534F4C41524953FD4C494E5558FD4F534631FD4C494E5558FD4E54FE6A42415345FD426F6F21204E6F74206A42415345FD416E6F74686572205069636BFD426F6F21204E6F74206A42415345FD416E6F74686572205069636BFE31373337FD393838FD31393733FD333032FD373337"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000062"
rec = "44415645FE534D495448FE31323120454C4556454E2053515541524520FEFE5359444E4559FE4341FE3039333234FE2831323429203535352D31333337FE2835353529203535352D31323337FE444156455340636F6D70652E636F6DFE525336303030FE48505558FE554E492AFE31313736"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "0000095"
rec = "46494F4E41FE4A4F484E534F4EFE363420484144444F434B454E20504C414345FE415054203432FE504F52544C414E44FE4D44FE3234333538FE2835353529203535352D31323337FE2835323429203535352D32343337FE46494F4E414A40636F6D70622E636F6DFE525336303030FD4449474954414CFD525336303030FD414C50484120415850FD5350415243FD414C50484120415850FD5350415243FE5452553634FD4F534631FD554E495857415245FD534F4C41524953FD4E54FD4E54FD554E495857415245FE416E6F74686572205069636BFD426F6F21204E6F74206A42415345FD524F53FD554E492AFD554E492AFD426F6F21204E6F74206A42415345FD6A42415345FE363135FD31333037FD343637FD31333331FD31313535FD373932FD383831"
out = OCONV(rec, "MCXA")
WRITE out ON file,id


id = "9999999"
rec = "4C756B65FE57414C4B4552FE313032363020535720475245454E42555247205244FE2331303230FE504F52544C414E44FE494E"
out = OCONV(rec, "MCXA")
WRITE out ON file,id
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149