home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr4.zip / MCNAMES.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  7KB  |  237 lines

  1. * Program MCNAMES - Enables operator to change items in the Names Directory
  2. Select primary
  3. Use MDIRFILE index MDIRFILE
  4. Store T to LEVEL2
  5. Do while LEVEL2
  6.   Erase
  7.   @ 1,20 say  'Names Directory File Maintenance              8-5-/MCNAMES/'
  8.   @ 3,10 say  'This section allows adding and deleting codes and their'
  9.   @ 4,10 say  'corresponding names to the Names Directory file.'
  10.   @ 6,10 say  '1)  Display / Print the current Names Directory (MDIRFILE)'
  11.   @ 7,10 say  '2)  Add a Small Church name'
  12.   @ 8,10 say  '3)  Delete an existing Small Church name'
  13.   @ 9,10 say  '4)  Add a SP:ACTIVTY name'
  14.   @ 10,10 say '5)  Delete an existing SP:ACTIVTY name'
  15.   @ 11,10 say '6T) Add an OTHER category, with new title'
  16.   @ 12,10 say '6)  Add an OTHER name to an existing category'
  17.   @ 13,10 say '7)  Delete an existing OTHER name/category'
  18.   @ 14,10 say '8)  Add an INTEREST/ABILITY code'
  19.   @ 15,10 say '9)  Delete an existing INTEREST/ABILITY code'
  20.   @ 16,10 say 'P)  Purge inactive names out of the Names Directory file.'
  21.   @ 17,10 say 'Q)  QUIT'
  22. ?
  23. Accept '         Enter selection ' to MSEL
  24. ?
  25. Store F to validd
  26. Do while .NOT. validd
  27.   Store T to VALIDD
  28.   Do CASE
  29.     CASE MSEL = '2'
  30.       Do MCNAMES1.CMD
  31.     CASE MSEL = '4'
  32.       Store T to invalid
  33.       Store 'SPAC=' to acttype
  34.       Do while invalid
  35.         Store F to invalid
  36.   Accept 'Enter SPAC code to be added (example: ACH for Adult Choir) ' to FSEL
  37.         If !(FSEL) <> 'Q'
  38.           Store acttype+$(FSEL,1,3) to FSEL
  39.           Find &FSEL
  40.           If # <> 0
  41.        ? 'Duplicate SP:ACTIVTY code found - ",spact,'".  Not entered.'
  42.             Store T to invalid
  43.           else
  44.             APPEND BLANK
  45.        Accept 'Enter name for the above code (example: Adult Choir) ' to XNAME
  46.             Store FSEL+' '+$(XNAME,1,20) to XNAME
  47.             Replace spact with XNAME
  48.             ? spact,'-  ADDED'
  49.           endif
  50.         endif
  51.       ENDDO
  52.     CASE !(MSEL) = '6T'
  53.       Store T to invalid
  54.       Do while invalid
  55.        Store F to invalid
  56.        Accept 'Enter a new OTHER category code (example: SCH=school) ' to XSEL
  57.        If !(XSEL) <> 'Q'
  58.          Store $(XSEL,1,3)+': ' to XSEL
  59.          Find &XSEL
  60.            If # = 0
  61.             APPEND BLANK
  62.             Accept 'Enter OTHER category name, up to 20 characters ' to XNAME
  63.      Store XSEL+XNAME to XNAME
  64.             Replace SPACT with XNAME
  65.             ? SPACT,'-  ADDED'
  66.            else
  67.             Accept 'Duplicate OTHER category found.  Enter again ' to XSEL
  68.             Store T to invalid
  69.            endif
  70.        endif
  71.       ENDDO
  72.     CASE MSEL = '6'
  73.       Do MCNAMES2.CMD
  74.     CASE MSEL = '8'
  75.       Store ' ' to IC
  76.       Store 'SKLS=' to acttype
  77.       Do while !(IC)<>'Q'
  78.       Store T to invalid
  79.       Do while invalid
  80.         Store F to invalid
  81. Accept 'Enter a 2-character SKILLS code (example: SS for Sound System) ' to IC
  82.         If !(IC) <> 'Q'
  83.           Store acttype+$(IC,1,2) to IC
  84.           Find &IC
  85.           If # <> 0
  86.             ? 'Duplicate SKILLS code found - "',spact,'"  Not entered.'
  87.             Store T to invalid
  88.           else
  89.             APPEND BLANK
  90.       Accept 'Enter name for the above code (example: Sound System) ' to XNAME
  91.             Store IC+'  '+$(XNAME,1,20) to XNAME
  92.             Replace spact with XNAME
  93.             ? spact,'  -  ADDED'
  94.           endif
  95.         endif
  96.       ENDDO
  97.       ENDDO
  98.     CASE MSEL = '3'
  99.       Accept 'Enter a Small Church code to be deleted ' to FSEL
  100.       Store T to invalid
  101.       Do while invalid
  102.        Store F to invalid
  103.        If !(FSEL) <> 'Q'
  104.          Store 'SSSC='+$(FSEL,1,3) to FSEL
  105.          Find &FSEL
  106.          If # = 0
  107.            Accept 'No Small Church found by this code. Enter again ' to FSEL
  108.            Store T to invalid
  109.         else
  110.           ? spact,'-  DELETED '
  111.           Replace SPACT with '~ '
  112.           Delete
  113.         endif
  114.        endif
  115.       enddo
  116.     CASE MSEL = '5'
  117.       Accept 'Enter SP:ACTIVTY function code to be deleted ' to FSEL
  118.       Store T to invalid
  119.       Do while invalid
  120.         Store F to invalid
  121.         If !(FSEL) <> 'Q'
  122.           Store 'SPAC='+$(FSEL,1,3) to FSEL
  123.           Find &FSEL
  124.           If # = 0
  125.            Accept 'No SP:ACTIVTY code found by this name. Enter again ' to FSEL
  126.           else
  127.            ? spact,'-  DELETED'
  128.            Replace SPACT with '~ '
  129.            Delete
  130.           endif
  131.         endif
  132.       enddo
  133.     CASE MSEL = '7'
  134.       Store T to invalid
  135.       Do while invalid
  136.         Store F to invalid
  137.         ? 'Enter OTHER category and designator to be deleted.'
  138. Accept 'For example,  SCH=032  is the SCHOOL category with code 032 ' to XSEL
  139.         If !(XSEL) <> 'Q'
  140.           Find &XSEL
  141.           If # = 0
  142.   ? 'OTHER category, designator - "',XSEL,'"  not located in Names Directory.'
  143.             ? ' '
  144.             Store T to invalid
  145.           else
  146.             ? spact,'-  DELETED'
  147.             Replace spact with '~ '
  148.             Delete
  149.           endif
  150.         endif
  151.       enddo
  152.     CASE !(MSEL) = '9'
  153.       Store ' ' to FSEL
  154.       Do while !(FSEL)<>'Q'
  155.       Accept 'Enter SKILLS function code to be deleted ' to FSEL
  156.       Store T to invalid
  157.       Do while invalid
  158.         Store F to invalid
  159.         If !(FSEL) <> 'Q'
  160.           Store 'SKLS='+$(FSEL,1,3) to FSEL
  161.           Find &FSEL
  162.           If # = 0
  163.             Accept 'No SKILLS code found by this name. Enter again ' to FSEL
  164.             Store T to invalid
  165.           else
  166.             ? spact,'-  DELETED'
  167.             Replace SPACT with '~ '
  168.             Delete
  169.           endif
  170.         endif
  171.       enddo
  172.       ENDDO
  173.     CASE !(MSEL) = '1'
  174. Accept 'Do you want a print-out [P] or Display [D] of the MDIRFILE? ' to FSEL
  175. If !(FSEL)<>'Q'
  176.  If !(FSEL)<>'P' .and. !(FSEL)<>'D'
  177.   Store 'D' to FSEL
  178.  endif
  179.  Use MDIRFILE index MDIRFILE
  180.  If !(FSEL) = 'P'
  181.   ? 'Ready the printer.'
  182.   Set format to print
  183.   Store 66 to curline
  184.   Store T to BEGINNG
  185.   Store 0 to pagenum
  186.   Do while .not. EOF
  187.     If curline > 62
  188.       If .not. BEGINNG
  189.         EJECT
  190.       endif
  191.       Store pagenum+1 to pagenum
  192.       @ 0,10 say 'Names Directory file    '+date()+'    Page'+str(pagenum,2)
  193.       Store 3 to curline
  194.     endif
  195.     If .not. BEGINNG
  196.       @ curline,10 say spact
  197.       SKIP
  198.     endif
  199.     Store F to BEGINNG
  200.     Do while * .and. .not. EOF
  201.       SKIP
  202.     enddo
  203.     Store curline+1 to curline
  204.   enddo
  205.   EJECT
  206.   Set format to screen
  207.  else
  208.   ERASE
  209.   @ 2,1 say 'Names Directory file    '+date()
  210.   ?
  211.   Do while .not. EOF
  212.     ? '         ',spact
  213.     SKIP
  214.     Do while * .and. .not. EOF
  215.       SKIP
  216.     enddo
  217.   enddo
  218.   ?
  219.  endif
  220.  Accept 'MDIRFILE is complete. Press <retn> ' to XX
  221. endif
  222.     CASE !(MSEL) = 'Q'
  223.       Store F to LEVEL2
  224.     OTHERWISE
  225.       Accept 'Illegal selection. Please enter again ' to MSEL
  226.       Store F to validd
  227.     ENDCASE
  228.   ENDDO
  229. ENDDO
  230. USE
  231. QUIT
  232. haracter SKILLS code (example: SS for Sound System) ' to IC
  233.         If !(IC) <> 'Q'
  234.           Store acttype+$(IC,1,2) to IC
  235.           Find &IC
  236.           If # <> 0
  237.             ? 'Duplicate SKILLS code found - "',sp