home *** CD-ROM | disk | FTP | other *** search
/ Sams Cobol 24 Hours / Sams_Cobol_24_Hours.iso / source / ch07 / chapt07x.cob < prev   
Text File  |  1998-10-05  |  1KB  |  37 lines

  1. 000010 @OPTIONS MAIN
  2. 000020 Identification Division.
  3. 000030 Program-Id.  Chapt07x.
  4. 000040* Chapter 7 Exercise Solution
  5. 000050 Environment Division.
  6. 000060 Configuration Section.
  7. 000070 Source-Computer.  IBM-PC.
  8. 000080 Object-Computer.  IBM-PC.
  9. 000090 Data Division.
  10. 000100 Working-Storage Section.
  11. 000101 01  Word-In          Pic X(40)   Value Spaces.
  12. 000102 01  Word-Out         Pic X(40)   Value Spaces.
  13. 000103 01  Work-Field-1     Pic X(40)   Value Spaces.
  14. 000104 01  Work-Field-2     Pic X(40)   Value Spaces.
  15. 000106 Screen Section.
  16. 000107 01  Main-Screen Blank Screen.
  17. 000108     03  Line 01 Column 01 Value "Enter Word:".
  18. 000109     03  Line 01 Column 13 Pic X(40) Using Word-In.
  19. 000110     03  Line 03 Column 01 Value "Word Result:".
  20. 000114     03  Line 03 Column 14 Pic X(40) From Word-Out.
  21. 000116 Procedure Division.
  22. 000117 Chapt07x-Start.
  23. 000120     Display Main-Screen
  24. 000130     Accept Main-Screen
  25. 000131     Unstring Word-In 
  26. 000132       Delimited by "-" 
  27. 000133       Into Work-Field-1 Work-Field-2
  28. 000134     End-Unstring
  29. 000135     String Work-Field-1 
  30. 000136            Work-Field-2
  31. 000137            Delimited By Space
  32. 000138            Into Word-Out
  33. 000139     End-String
  34. 000161     Display Main-Screen
  35. 000164     Stop Run
  36. 000174     .
  37.