home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / packdec.zip / README.TXT < prev   
Text File  |  1994-09-04  |  7KB  |  220 lines

  1.                                 Packed Decimal in C 
  2.  
  3.         Packed Decimal in C is a collection of subroutines that will convert 
  4. IBM/370 format packed decimal numbers to C language long binary numbers and 
  5. Also convert C language long binary to packed decimal.  These routines could  
  6. be useful in a client server environment where data is being exchanged with 
  7. an IBM mainframe.  IBM CICS/ESA supports C language, but C language does not 
  8. support packed decimal data.  CICS fields like EIBDATE and EIBTIME are in  
  9. packed decimal.  A bonus program provided to registered users will simulate 
  10. the IBM/370 edit and mark instruction.  The edit and mark program will help 
  11. in formatting numbers for reports. 
  12.  
  13. Packed Decimal in C is not public domain or free.  You may use it for a 30 
  14. day evaluation period.  After the evaluation period you are expected to 
  15. register. 
  16.  
  17. Shareware is a marketing technique that allows and encourages free sharing  
  18. or copying of programs as a method of distribution. This practice benefits  
  19. both users and developers. Users can test programs and become familiar with  
  20. them before deciding whether to buy them. Shareware programs are usually  
  21. less expensive than commercial software because there is very little  
  22. advertising expense; most of the price you pay actually goes to the  
  23. developer. However, none of this would be possible if the users did not do  
  24. their part by paying for the programs they decide to use. We who write  
  25. shareware depend on the good faith of you, the user, for our profit. When you  
  26. pay for this and other shareware programs, you allow developers to continue  
  27. making high quality, low-cost software available to everyone.  
  28.  
  29. DISCLAIMER:  Use Packed Decimal in C at your own risk. The author does not   
  30. warrant the suitability of Packed Decimal in C for any specific purpose,  
  31. and assumes no responsibility for damages of any kind resulting from its use.   
  32. Use of these programs for any period of time constitutes your assumed  
  33. acceptance of this agreement.  
  34.  
  35. Shareware distributors may not charge more than $8.00 per diskette to  
  36. distribute this product.  This price restriction does not apply to CD-ROM or  
  37. BBS distribution. 
  38.  
  39. Support is provided to registered users.  Problem reports and suggestions are   
  40. also welcome from unregistered users.  We can be contacted at: 
  41.  
  42.         IAMBIC SOFTWARE, Inc. 
  43.         6607 West 77th Street 
  44.         Overland Park, Kansas  66204-3143 
  45.  
  46.         Compuserve:  70541,3215 
  47.         Internet:    70541.3215@compuserve.com 
  48.  
  49. Telephone support is also provided for registered users.
  50.  
  51. CICS/ESA, IBM/370 are trademarks of International Business Machines, Inc.
  52.  
  53. /************************************************************ 
  54.  
  55.    Name:  sPackedToBin 
  56.  
  57.    Function: 
  58.  
  59.       This routine will convert IBM 370 packed decimal numbers to fixed 
  60.       point binary numbers four bytes long. 
  61.  
  62.    arguments: 
  63.  
  64.       1.  unsigned char pointer to the packed decimal number, max length 
  65.           is six bytes. 
  66.  
  67.       2.  pointer to a long int to receive the result. 
  68.  
  69.       3.  short int length of argument 1, the packed decimal number. 
  70.  
  71.    return codes: 
  72.  
  73.       0   success 
  74.       1   invalid decimal digit 
  75.       2   overflow, numbers greater than 2,147,483,647 (0x7fffff) 
  76.       3   invalid length specified 
  77.  
  78.  
  79. *************************************************************/ 
  80.  
  81.  
  82.  
  83. /************************************************************ 
  84.  
  85.    Name:  sBinToPacked 
  86.  
  87.    Function: 
  88.  
  89.       This routine will convert long binary number to IBM 370 packed 
  90.       decimal format eight bytes long. 
  91.  
  92.    arguments: 
  93.  
  94.       1.  unsigned char pointer to the packed decimal number result 
  95.           8 bytes long 
  96.  
  97.       2.  pointer to a long int to convert. 
  98.  
  99.    return codes: 
  100.  
  101.       0   success 
  102.  
  103. *************************************************************/ 
  104.  
  105.  
  106.  
  107.  
  108.  
  109. /************************************************************ 
  110.  
  111. Name:  sEdMk       ( bonus program for registered users ) 
  112.  
  113. Function: 
  114.  
  115. This routine will edit a IBM/370 packed decimal numbers under control of 
  116. an edit mask.   The IBM/370 principles of operation manual describes 
  117. the instruction that this routine will simulate.   This routine uses 
  118. different edit codes because ASCII code uses 0x20, 0x21, 0x22 for space, 
  119. '!', and '"' respectively.  The packed is changed to zone format and 
  120. modified under control of the edit pattern.  The edited result replaces 
  121. the edit mask.  The first byte of the edit mask is a fill byte.  The fill 
  122. byte replaces non significant digits. 
  123.  
  124. Examples: 
  125.  
  126.                           23,000 
  127.                         $153,237.25 
  128.                          $$$$$$2.32CR 
  129.  
  130.  
  131. Edit mask characters: 
  132.  
  133.     This routine               original IBM/370 EDMK codes 
  134.  
  135.         0x10       digit selector              0x21 
  136.         0x11       significance starter        0x21 
  137.         0x12       field separator             0x22 
  138.                    other message byte 
  139.  
  140. arguments: 
  141.  
  142. 1.  unsigned char pointer to an edit mask. 
  143.  
  144. 2.  short int length of argument 1, includes length of 0x00 for end of 
  145.     string. 
  146.  
  147. 3.  unsigned char pointer to a packed decimal number. 
  148.  
  149. 4.  unsigned char pointer to pointer of the 
  150.     byte before the first significant result byte 
  151.  
  152. returns condition code: 
  153.  
  154. 0.  last field is zero or of zero length 
  155. 1.  last field is less than zero 
  156. 2.  last field is greater than zero 
  157. 3.  not defined 
  158. 4.  data exception,  ( first nibble of byte is not a digit ) 
  159. **\
  160.  
  161.  
  162.                         Registration Form 
  163.  
  164.         QTY     Registration Type       Price           Ext. Price 
  165.   
  166.         ____    Single PC               $10.00          ______ 
  167.  
  168.  
  169.         ____    Mainframe/Midrange      $20.00          ______ 
  170.  
  171.  
  172.         ____    Unlimited Site License $100.00          ______ 
  173.  
  174.  
  175.                 TOTAL                                   ______ 
  176.  
  177.  
  178. Registration is required for the development platform only. 
  179.  
  180.  
  181. Name _______________________________________________________________ 
  182.  
  183.  
  184. Company ____________________________________________________________ 
  185.  
  186.  
  187. Address_____________________________________________________________ 
  188.  
  189.  
  190. City ______________________________State_______Zip__________________ 
  191.  
  192.  
  193. Phone/E-mail________________________________________________________ 
  194.  
  195.  
  196.  
  197. Where did you obtain your copy of Packed Decimal in C? 
  198.  
  199.  
  200. _____________________________________________________________________ 
  201.  
  202.  
  203.  
  204.  
  205.  
  206. Mail payment to: 
  207.  
  208.  
  209.  
  210.  
  211.         IAMBIC SOFTWARE, Inc. 
  212.         6607 West 77th Street 
  213.         Overland Park, Kansas  66204-3143 
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.