home *** CD-ROM | disk | FTP | other *** search
/ Sams Cobol 24 Hours / Sams_Cobol_24_Hours.iso / source / ch11 / CHAPT11B.COB < prev    next >
Encoding:
Text File  |  1998-09-15  |  1.6 KB  |  43 lines

  1. 000010 @OPTIONS MAIN
  2. 000020 Identification Division.
  3. 000030 Program-Id.  Chapt11b.
  4. 000031* Inline Perform Example, Name Join
  5. 000044 Environment Division.
  6. 000050 Configuration Section.
  7. 000051 Source-Computer.  IBM-PC.
  8. 000055 Object-Computer.  IBM-PC.
  9. 000056 Data Division.
  10. 000057 Working-Storage Section.
  11. 000058 01  Last-Name            Pic X(20) Value Spaces.
  12. 000059 01  First-Name           Pic X(20) Value Spaces.
  13. 000060 01  Combined-Name        Pic X(40) Value Spaces.
  14. 000061 01  Name-Length          Pic 99    Value Zeros.
  15. 000067 Screen Section.
  16. 000078 01  Name-Entry Blank Screen.
  17. 000079     03  Line 01 Column 01 Value " Last Name: ".
  18. 000080     03  Line 01 Column 13 Pic X(20) Using Last-Name.
  19. 000081     03  Line 03 Column 01 Value "First Name: ".
  20. 000082     03  Line 03 Column 13 Pic X(20) Using First-Name.
  21. 000083     03  Line 05 Column 01 Value " Full Name: ".
  22. 000084     03  Line 05 Column 13 Pic X(40) From Combined-Name.
  23. 000085 Procedure Division.
  24. 000159 Chapt11b-Start.
  25. 000160     Display Name-Entry
  26. 000161     Accept  Name-Entry
  27. 000171     Perform Varying Name-Length From 20 By -1
  28. 000181        Until First-Name (Name-Length:1) > Space
  29. 000191           Or Name-Length = Zeros
  30. 000201        Continue
  31. 000211     End-Perform
  32. 000221     If Name-Length = Zeros
  33. 000231        Move Last-Name To Combined-Name
  34. 000241     Else
  35. 000251        String First-Name (1:name-Length)
  36. 000261               Space
  37. 000271               Last-Name
  38. 000281               Delimited By Size
  39. 000291               Into Combined-Name
  40. 000301     End-If
  41. 000311     Display Name-Entry
  42. 000321     Stop Run
  43. 000331     .
  44.