home *** CD-ROM | disk | FTP | other *** search
/ Sams Cobol 24 Hours / Sams_Cobol_24_Hours.iso / source / ch15 / chapt15c.cob < prev    next >
Text File  |  1998-10-05  |  6KB  |  128 lines

  1. 000010 @OPTIONS MAIN,TEST
  2. 000020 Identification Division.
  3. 000030 Program-Id.  Chapt15c.
  4. 000031* Sequentially Read An Indexed File Via Alternate Key
  5. 000041 Environment Division.
  6. 000050 Configuration Section.
  7. 000051 Source-Computer.  IBM-PC.
  8. 000055 Object-Computer.  IBM-PC.
  9. 000056 Input-Output Section.
  10. 000057 File-Control.
  11. 000058     Select Dealer-File Assign To "Dealer.Dat"
  12. 000059            Organization Indexed
  13. 000060            Access Sequential
  14. 000061            Record Key Dealer-Number
  15. 000062            Alternate Record Key Dealer-Name
  16. 000063            File Status Dealer-Status.
  17. 000065 Data Division.
  18. 000066 File Section.
  19. 000067 Fd  Dealer-File.
  20. 000068 01  Dealer-Record.
  21. 000069     03  Dealer-Number         Pic X(8).
  22. 000070     03  Dealer-Name.
  23. 000071         05  Last-Name   Pic X(25).
  24. 000072         05  First-Name  Pic X(15).
  25. 000073         05  Middle-Name Pic X(10).
  26. 000083     03  Address-Line-1      Pic X(50).
  27. 000085     03  Address-Line-2      Pic X(50).
  28. 000086     03  City                Pic X(40).
  29. 000087     03  State-Or-Country    Pic X(20).
  30. 000088     03  Postal-Code         Pic X(15).
  31. 000089     03  Home-Phone          Pic X(20).
  32. 000090     03  Work-Phone          Pic X(20).
  33. 000091     03  Other-Phone         Pic X(20).
  34. 000092     03  Start-Date          Pic 9(8).
  35. 000093     03  Last-Rent-Paid-Date Pic 9(8).
  36. 000094     03  Next-Rent-Due-Date  Pic 9(8).
  37. 000095     03  Rent-Amount         Pic 9(4)v99.
  38. 000096     03  Consignment-Percent Pic 9(3).
  39. 000097     03  Filler              Pic X(50).
  40. 000098 Working-Storage Section.
  41. 000116 01  Dealer-Status     Pic X(2) Value Spaces.
  42. 000240     88  Dealer-Success Value "00".
  43. 000276 01  Show-Next-Record  Pic X Value "Y".
  44. 000277 01  Process-Flag      Pic X Value Spaces.
  45. 000278     88  End-Process   Value "Y".
  46. 000279 Screen Section.
  47. 000388 01  Data-Entry-Screen
  48. 000389     Blank Screen, Auto
  49. 000390     Foreground-Color Is 7,
  50. 000391     Background-Color Is 1.
  51. 000392*
  52. 000393     03  Screen-Literal-Group.
  53. 000394         05  Line 01 Column 30 Value "Darlene's Treasures"
  54. 000395             Highlight Foreground-Color 4 Background-Color 1.
  55. 000396         05  Line 03 Column 30 Value "Tenant Display Program"
  56. 000397             Highlight.
  57. 000398         05  Line 4  Column 01  Value "Number: ".
  58. 000399         05  Line 5  Column 01  Value "Name, Last: ".
  59. 000400         05  Line 5  Column 39  Value "First: ".
  60. 000401         05  Line 5  Column 62  Value "Middle: ".
  61. 000402         05  Line 6  Column 01  Value "Address 1: ".
  62. 000403         05  Line 7  Column 01  Value "Address 2: ".
  63. 000404         05  Line 8  Column 01  Value "City: ".
  64. 000405         05  Line 9  Column 01  Value "Country/State: ".
  65. 000406         05  Line 9  Column 36  Value "Postal Code: ".
  66. 000407         05  Line 11 Column 01  Value "Phone/Home: ".
  67. 000408         05  Line 11 Column 34  Value "Work: ".
  68. 000409         05  Line 12 Column 06  Value "Other: ".
  69. 000410         05  Line 14 Column 01  Value "Start Date: ".
  70. 000411         05  Line 14 Column 24  Value "Last Paid Date: ".
  71. 000412         05  Line 14 Column 51  Value "Next Rent Due on: ".
  72. 000413         05  Line 16 Column 01  Value "Consignment Percent: ".
  73. 000414         05  Line 17 Column 01  Value "Rent Amount: ".
  74. 000415         05  Line 22 Column 01
  75. 000416             Value "Display next Record? (Y/N):".
  76. 000417*
  77. 000418     03  Required-Reverse-Group Reverse-Video.
  78. 000419         05  Line 4 Column 13  Pic X(8)  From Dealer-Number.
  79. 000420         05  Line 5 Column 13  Pic X(25) From Last-Name.
  80. 000421         05  Line 5 Column 46  Pic X(15) From First-Name.
  81. 000422         05  Line 5  Column 70 Pic X(10) From Middle-Name.
  82. 000423         05  Line 6  Column 15 Pic X(50) From Address-Line-1.
  83. 000424         05  Line 7  Column 15 Pic X(50) From Address-Line-2.
  84. 000425         05  Line 8  Column 15 Pic X(40) From City.
  85. 000426         05  Line 9  Column 15 Pic X(20) From State-Or-Country.
  86. 000427         05  Line 9  Column 50 Pic X(15) From Postal-Code.
  87. 000428         05  Line 11 Column 13 Pic X(20) From Home-Phone.
  88. 000429         05  Line 11 Column 41 Pic X(20) From Work-Phone.
  89. 000430         05  Line 12 Column 13 Pic X(20) From Other-Phone.
  90. 000431         05  Line 14 Column 13 Pic 99/99/9999 From Start-Date.
  91. 000432         05  Line 14 Column 40 Pic 99/99/9999
  92. 000433             From Last-Rent-Paid-Date.
  93. 000434         05  Line 14 Column 69 Pic 99/99/9999
  94. 000435             From Next-Rent-Due-Date.
  95. 000436         05  Line 15 Column 14 Pic Z,ZZZ.99 From Rent-Amount.
  96. 000437         05  Line 16 Column 22 Pic ZZ9 From Consignment-Percent.
  97. 000438 Procedure Division.
  98. 000440 Chapt15c-Start.
  99. 000441     Perform Open-File
  100. 000442     If Dealer-Success
  101. 000443        Move "H" To Dealer-Name
  102. 000444        Start Dealer-File Key Not < Dealer-Name
  103. 000445              Invalid Key Set End-Process To True
  104. 000446        End-Start
  105. 000447        Perform Process-Screen Until Show-Next-Record = "N" Or
  106. 000448                                     Show-Next-Record = "n" Or
  107. 000449                                     End-Process
  108. 000450        Perform Close-File
  109. 000451     End-If
  110. 000452     Stop Run
  111. 000453     .
  112. 000454  Process-Screen.
  113. 000455     Read Dealer-File
  114. 000456       At End Set End-Process To True
  115. 000457       Not At End
  116. 000458           Perform Display-And-Accept
  117. 000459     End-Read
  118. 000460     .
  119. 000461 Display-And-Accept.
  120. 000462     Display Data-Entry-Screen
  121. 000463     Accept Data-Entry-Screen
  122. 000464     .
  123. 000465 Open-File.
  124. 000466     Open Input Dealer-File
  125. 000467     .
  126. 000468 Close-File.
  127. 000469     Close Dealer-File
  128. 000470     .