home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv7.zip / vac22os2 / ibmcobol / macros / datadiv.lx < prev    next >
Text File  |  1998-02-24  |  1KB  |  49 lines

  1. /* */
  2. 'goview name Data_Division'
  3. 'top'
  4. 'find any data division'
  5. call process_rc rc
  6. if result = 0 then
  7.    'extract class'            /* get the class of this line */
  8. else
  9.    exit
  10. do while (pos("DIVISION",class) = 0)
  11.    'find any data division'
  12.    call process_rc rc
  13.    if result = 0 then
  14.       'extract class'            /* get the class of this line */
  15.    else
  16.       exit
  17. end /* do while */
  18. exit
  19.  
  20. process_rc: procedure 
  21. arg rt
  22. select
  23.    when rt = 0 then
  24.       do
  25.          return 0
  26.       end   
  27.    when rt = 1 then 
  28.       do
  29.          'quitview'
  30.          say 'No valid occurrences of Data Division found'
  31.          return 1
  32.       end
  33.    when rt = 2 then 
  34.       do
  35.          'quitview'
  36.          say 'No valid occurrences of Data Division found'
  37.          return 2
  38.       end
  39.    when rt = 3 then 
  40.       do
  41.          'quitview'
  42.          say 'No valid occurrences of Data Division found'
  43.          return 3
  44.       end
  45.    otherwise
  46.       say 'Unexpected return code ' rt ' from FIND' 
  47.       return rt
  48. end /* select */
  49.