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

  1. * Program MCNAMES1 - Adds a Small Church name to the MDIRFILE
  2. Store T to LEVEL3
  3. Do while LEVEL3
  4. Store T to nogood
  5. Store 'SSSC=' to acttype
  6. Accept 'Enter Small Church code to be added (example: JRH = Jr. High): ' to IC
  7. Do while nogood
  8.   If !(IC) = 'Q'
  9.     Store F to invalid
  10.     RETURN
  11.   endif
  12.   If len(IC) = 3
  13.     Store acttype+IC to ICODE
  14.     Find &ICODE
  15.     If # = 0
  16.       Store F to nogood
  17.     else
  18.       ? 'Duplicate Small Church code found. [',spact,']'
  19.       ? ' '
  20.       Accept 'Enter another Small Church code: ' to IC
  21.     endif
  22.   else
  23.     Accept 'Small Church code does not have 3 characters. Enter again: ' to IC
  24.   endif
  25. enddo
  26. APPEND BLANK
  27. Accept 'Enter name for the above code: ' to XNAME
  28. Replace spact with acttype+IC+' '+$(XNAME,1,20)
  29. ? ' '
  30. ? spact, '  - NOW ADDED '
  31. ? ' '
  32. ? 'Do you want to change the codes of all members of '
  33. Accept 'an existing Small Church class to this new name? ' to XY
  34. If !(XY) = 'Y'
  35. Store T to nogood
  36. Accept 'Enter previous Small Church code: ' to OC
  37. Do while nogood
  38.   If !(XY) = 'Q' .or. !(OC) = 'Q'
  39.     Store F to nogood
  40.   else
  41.   Store acttype+OC to xysearch
  42.   Find &xysearch
  43.   If # = 0
  44.     Accept 'No Small Church code found with this name. Enter another ' to OC
  45.   else
  46.     Store F to nogood
  47.     ? ' '
  48.     ? 'Note: This does not change the Small Church teacher for this code.'
  49.     ? 'That must be done manually by finding the individual teacher and'
  50.     ? 'changing field = "TEACH:SSSC".'
  51.     Accept 'Now about to go through the MEMBERS file for changes. Ok? ' to XY
  52.     If !(XY) <> 'Y'
  53.       Store F to nogood
  54.     else
  55.     Select secondary
  56.     Store d+':members' to mfile
  57.     USE &MFILE index &MFILE
  58.     Store 0 to recm
  59.     Store 0 to recc
  60.     Store 0 to recnumb
  61.     Do while .not. EOF
  62.       If $(SS:SC:MEMB,1,3) = OC
  63.         Replace SS:SC:MEMB with IC+' '+$(SS:SC:MEMB,5,1)
  64.         ? last:name,first:name,'      -  Small Church changed to ',IC
  65.         Store recm+1 to recm
  66.       endif
  67.       SKIP
  68.       Store recc+1 to recc
  69.       If recc = 100
  70.         Store 0 to recc
  71.         Store recnumb+100 to recnumb
  72.         ? recnumb,'  RECORDS PROCESSED.'
  73.       endif
  74.     enddo
  75.     Select primary
  76.       ? recm,' RECORDS CHANGED TO NEW CODE.'
  77.     ENDIF
  78.    ENDIF
  79.   endif
  80. enddo
  81. else
  82.   ? '     No changes made.'
  83. endif
  84. ENDDO
  85. RETURN
  86. D '
  87. ? ' '
  88. ? 'Do you want to change the codes of all members of '
  89. Accept 'an existing Sunday School class to this new name? ' to XY
  90. If !(XY) = 'Y'
  91. Store T to nogood
  92. Accept 'Enter previous Sunday School code: ' Set console on
  93. endif
  94. RETURN
  95. SE mdirfilx
  96. Copy to SPACFILE STRUCTURE
  97. Use SPACFILE
  98. Select primary
  99. Store 1 to actcount
  100. Store ' ' to actlist
  101. Store chr(31) to chr31
  102. Do while $(spact,1,4) = 'SPAC'
  103.   Select secondary
  104.   Append blank
  105.   replace SPACT with $(P.SPACT,6,4)
  106.   If actcount<64
  107.     Store actlist+$(spact,1,4) to actlist
  108.     Store actcount+1 to actcount
  109.   else
  110.     ? 'Special Activities found are:  ',actlist
  111.     Store ' '+$(spact,1,4) to actlist
  112.   endif
  113.   Select primary
  114.   SKIP
  115. enddo
  116. Sel