home *** CD-ROM | disk | FTP | other *** search
/ Sams Cobol 24 Hours / Sams_Cobol_24_Hours.iso / source / ch17 / CHAPT17B.COB < prev    next >
Text File  |  1998-09-14  |  3KB  |  77 lines

  1. 000010 @OPTIONS MAIN,TEST
  2. 000020 Identification Division.
  3. 000030 Program-Id.  Chapt17b.
  4. 000031* Simple Sort Example
  5. 000041 Environment Division.
  6. 000050 Configuration Section.
  7. 000051 Source-Computer.  IBM-PC.
  8. 000056 Object-Computer.  IBM-PC.
  9. 000057 Input-Output Section.
  10. 000058 File-Control.
  11. 000059     Select Dealer-Text Assign To "Dealer.TXT"
  12. 000060            Organization Line Sequential
  13. 000061            Access Sequential.
  14. 000062     Select Sort-Work Assign To Dealer-Sort-Work.
  15. 000065 Data Division.
  16. 000066 File Section.
  17. 000067 Fd  Dealer-Text.
  18. 000068 01  Dealer-Record.
  19. 000069     03  Dealer-Number         Pic X(8).
  20. 000070     03  Dealer-Name.
  21. 000071         05  Last-Name   Pic X(25).
  22. 000074         05  First-Name  Pic X(15).
  23. 000075         05  Middle-Name Pic X(10).
  24. 000083     03  Address-Line-1      Pic X(50).
  25. 000085     03  Address-Line-2      Pic X(50).
  26. 000086     03  City                Pic X(40).
  27. 000087     03  State-Or-Country    Pic X(20).
  28. 000088     03  Postal-Code         Pic X(15).
  29. 000089     03  Home-Phone          Pic X(20).
  30. 000090     03  Work-Phone          Pic X(20).
  31. 000091     03  Other-Phone         Pic X(20).
  32. 000092     03  Start-Date          Pic 9(8).
  33. 000093     03  Last-Rent-Paid-Date Pic 9(8).
  34. 000094     03  Next-Rent-Due-Date  Pic 9(8).
  35. 000095     03  Rent-Amount         Pic 9(4)v99.
  36. 000096     03  Consignment-Percent Pic 9(3).
  37. 000097     03  Last-Sold-Amount    Pic S9(7)v99.
  38. 000098     03  Last-Sold-Date      Pic 9(8).
  39. 000099     03  Sold-To-Date        Pic S9(7)v99.
  40. 000100     03  Commission-To-Date  Pic S9(7)v99.
  41. 000101     03  Filler              Pic X(15).
  42. 000102 Sd  Sort-Work.
  43. 000103 01  Sort-Record.
  44. 000104     03  Dealer-Number         Pic X(8).
  45. 000105     03  Dealer-Name.
  46. 000106         05  Last-Name   Pic X(25).
  47. 000107         05  First-Name  Pic X(15).
  48. 000108         05  Middle-Name Pic X(10).
  49. 000109     03  Address-Line-1      Pic X(50).
  50. 000110     03  Address-Line-2      Pic X(50).
  51. 000111     03  City                Pic X(40).
  52. 000112     03  State-Or-Country    Pic X(20).
  53. 000113     03  Postal-Code         Pic X(15).
  54. 000114     03  Home-Phone          Pic X(20).
  55. 000115     03  Work-Phone          Pic X(20).
  56. 000116     03  Other-Phone         Pic X(20).
  57. 000117     03  Start-Date          Pic 9(8).
  58. 000118     03  Last-Rent-Paid-Date Pic 9(8).
  59. 000119     03  Next-Rent-Due-Date  Pic 9(8).
  60. 000120     03  Rent-Amount         Pic 9(4)v99.
  61. 000121     03  Consignment-Percent Pic 9(3).
  62. 000122     03  Last-Sold-Amount    Pic S9(7)v99.
  63. 000123     03  Last-Sold-Date      Pic 9(8).
  64. 000124     03  Sold-To-Date        Pic S9(7)v99.
  65. 000125     03  Commission-To-Date  Pic S9(7)v99.
  66. 000126     03  Filler              Pic X(15).
  67. 000128 Working-Storage Section.
  68. 000390 Procedure Division.
  69. 000391 Chapt17b-Start.
  70. 000401     Sort Sort-Work Descending Key Last-Name Of Sort-Record
  71. 000411                                   First-Name Of Sort-Record
  72. 000421                                   Middle-Name Of Sort-Record
  73. 000431          Using Dealer-Text
  74. 000441          Giving Dealer-Text
  75. 000461     Display "Sort Complete"
  76. 000471     Stop Run
  77. 000481     .