BltInFunc-KEYPATCH.xml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
  4. <sect1 id="KEYPATCH">
  5. <title>KEYPATCH</title>
  6. <para><emphasis>[ </emphasis><emphasis>attrname</emphasis><emphasis
  7. role="bold"> </emphasis><emphasis role="bold">:= ] KEYPATCH<indexterm>
  8. <primary>KEYPATCH</primary>
  9. </indexterm><indexterm>
  10. <primary>KEYPATCH function</primary>
  11. </indexterm>(</emphasis><emphasis> index, patchfile, newfile
  12. </emphasis><emphasis role="bold"> [, OVERWRITE<indexterm>
  13. <primary>OVERWRITE</primary>
  14. </indexterm> ] [</emphasis><emphasis>,</emphasis><emphasis role="bold">
  15. EXPIRE<indexterm>
  16. <primary>EXPIRE</primary>
  17. </indexterm>( [ </emphasis><emphasis>days </emphasis><emphasis
  18. role="bold">] ) ] </emphasis><emphasis role="bold">[, UNORDERED | ORDERED(</emphasis> <emphasis>bool </emphasis><emphasis role="bold">) ] [, STABLE | UNSTABLE ] [, PARALLEL [ (</emphasis> <emphasis>numthreads </emphasis><emphasis role="bold">) ] ] [, ALGORITHM(</emphasis> <emphasis>name </emphasis><emphasis role="bold">) ] );</emphasis></para>
  19. <informaltable colsep="1" frame="all" rowsep="1">
  20. <tgroup cols="2">
  21. <colspec colwidth="88.80pt" />
  22. <colspec />
  23. <tbody>
  24. <row>
  25. <entry><emphasis>attrname</emphasis></entry>
  26. <entry>Optional. The action name, which turns the action into an
  27. attribute definition, therefore not executed until the attrname is
  28. used as an action.</entry>
  29. </row>
  30. <row>
  31. <entry><emphasis>index</emphasis></entry>
  32. <entry>The INDEX attribute to apply the changes to.</entry>
  33. </row>
  34. <row>
  35. <entry><emphasis>patchfile</emphasis></entry>
  36. <entry>A string constant specifying the logical name of the file
  37. containing the changes to implement (created by KEYDIFF).</entry>
  38. </row>
  39. <row>
  40. <entry><emphasis>newfile</emphasis></entry>
  41. <entry>A string constant specifying the logical name of the file to
  42. write the new index to.</entry>
  43. </row>
  44. <row>
  45. <entry><emphasis role="bold">OVERWRITE</emphasis></entry>
  46. <entry>Optional. Specifies overwriting the
  47. <emphasis>newfile</emphasis> if it already exists.</entry>
  48. </row>
  49. <row>
  50. <entry><emphasis role="bold">EXPIRE</emphasis></entry>
  51. <entry>Optional. Specifies the <emphasis>newfile</emphasis> is a
  52. temporary file that may be automatically deleted after the specified
  53. number of days.</entry>
  54. </row>
  55. <row>
  56. <entry><emphasis>days</emphasis></entry>
  57. <entry>Optional. The number of days after which the file may be
  58. automatically deleted. If omitted, the default is seven (7).</entry>
  59. </row>
  60. <row>
  61. <entry><emphasis role="bold">UNORDERED</emphasis></entry>
  62. <entry>Optional. Specifies the output record order is not significant.</entry>
  63. </row>
  64. <row>
  65. <entry><emphasis role="bold">ORDERED</emphasis></entry>
  66. <entry>Specifies the significance of the output record order.</entry>
  67. </row>
  68. <row>
  69. <entry><emphasis>bool</emphasis></entry>
  70. <entry>When False, specifies the output record order is not significant. When True, specifies the default output record order.</entry>
  71. </row>
  72. <row>
  73. <entry><emphasis role="bold">STABLE</emphasis></entry>
  74. <entry>Optional. Specifies the input record order is significant.</entry>
  75. </row>
  76. <row>
  77. <entry><emphasis role="bold">UNSTABLE</emphasis></entry>
  78. <entry>Optional. Specifies the input record order is not significant.</entry>
  79. </row>
  80. <row>
  81. <entry><emphasis role="bold">PARALLEL</emphasis></entry>
  82. <entry>Optional. Try to evaluate this activity in parallel.</entry>
  83. </row>
  84. <row>
  85. <entry><emphasis>numthreads</emphasis></entry>
  86. <entry>Optional. Try to evaluate this activity using <emphasis>numthreads</emphasis> threads.</entry>
  87. </row>
  88. <row>
  89. <entry><emphasis role="bold">ALGORITHM</emphasis></entry>
  90. <entry>Optional. Override the algorithm used for this activity.</entry>
  91. </row>
  92. <row>
  93. <entry><emphasis>name</emphasis></entry>
  94. <entry>The algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options.</entry>
  95. </row>
  96. </tbody>
  97. </tgroup>
  98. </informaltable>
  99. <para>The <emphasis role="bold">KEYPATCH </emphasis>action uses the
  100. <emphasis>index</emphasis> and <emphasis>patchfile</emphasis> to write a new
  101. index to the specified <emphasis>newfile</emphasis> containing all the
  102. original index data updated by the information from the
  103. <emphasis>patchfile</emphasis>.</para>
  104. <para>Example:</para>
  105. <programlisting>Vehicles := DATASET('vehicles',
  106. {STRING2 st,
  107. STRING20 city,
  108. STRING20 lname,
  109. UNSIGNED8 filepos{virtual(fileposition)}},
  110. FLAT);
  111. i1 := INDEX(Vehicles,
  112. {st,city,lname,filepos},
  113. 'vkey::20041201::st.city.lname');
  114. i2 := INDEX(Vehicles,
  115. {st,city,lname,filepos},
  116. 'vkey::20050101::st.city.lname');
  117. a := KEYDIFF(i1,i2,'KEY::DIFF::20050101::i1i2',OVERWRITE);
  118. b := KEYPATCH(i1,
  119. 'KEY::DIFF::20050101::i1i2',
  120. 'vkey::st.city.lname'OVERWRITE);
  121. SEQUENTIAL(a,b);
  122. </programlisting>
  123. <para>See Also: <link linkend="KEYDIFF">KEYDIFF</link>, <link
  124. linkend="INDEX_record_structure">INDEX</link></para>
  125. </sect1>