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

  1. * Program MUPCHNG - Allows changing a person's record on MEMBERS file
  2. Store T to EDITING
  3. If !(ESEL) = 'D'
  4.   Store '        Deleting' to DELED
  5. else
  6.   If !(ESEL) = 'J'
  7.     Store 'Making small church inactive' to DELED
  8.   else
  9.     If !(ESEL) = 'I'
  10.       Store 'Making full-church inactive' to DELED
  11.     else
  12.       Store '       Editing' to DELED
  13.     endif
  14.   endif
  15. endif
  16. Do while EDITING
  17.   ? '    '
  18.   ? DELED," a person's record on MEMBERS file. "
  19.   If FAUPDATE='Y'
  20.     ?? '  FAMILY ADDRESS UPDATING'
  21.   endif
  22.   ? ' '
  23.   ? 'Enter LAST NAME (3 characters) and FIRST NAME (2 characters) '
  24.   Accept '  Name code ' to INHH
  25.   Store T to invalcc
  26.   Do while invalcc
  27.     If len(INHH) = 1 .and. !(INHH) = 'Q'
  28.       Store F to EDITING
  29.       Store F to invalcc
  30.       return
  31.     else
  32.       If len(INHH) <> 5
  33.   Accept 'Invalid entry - must be 5 characters. Please re-enter ' to INHH
  34.       else
  35.        Store !($(INHH,1,1))+$(INHH,2,2) to INLN
  36.        Store !($(INHH,4,1))+$(INHH,5,1) to INFN
  37.        Store F to invalcc
  38.       endif
  39.     endif
  40.   enddo
  41.   ? 'Matching '+trim(INLN)+'..., '+trim(INFN)+'...'
  42.   Store F to MATCH
  43.   Store T to MATCHINGL
  44.   Store T to MATCHING
  45.   FIND &INLN
  46.   If # = 0
  47.     Accept 'No match. Press <retn> to continue. ' to XX
  48.   else
  49.     Do while MATCHING
  50.       Store T to PMATCHING
  51.       Do while PMATCHING *(partial matching)
  52. * Advance a record if current record is marked deleted.
  53.         Store T to NXTMATCH
  54.         Do while NXTMATCH
  55.           If EOF .or. $(last:name,1,3) <> INLN
  56.             ? 'No match. '
  57.             Store F to MATCHINGL
  58.             Store F to MATCHING
  59.             Store F to PMATCHING
  60.             Store F to NXTMATCH
  61.             Store F to MATCH
  62.           else
  63.            If *
  64.              SKIP
  65.            else
  66.              Store F to NXTMATCH
  67.            endif
  68.           endif
  69.         enddo
  70.         If MATCHINGL
  71.           If $(FIRST:NAME,1,2) = INFN
  72.             Store T to MATCH
  73.             Store F to PMATCHING
  74.           else
  75.           If .NOT. EOF
  76.            SKIP
  77.           endif
  78.         endif
  79.       endif
  80.       enddo  *(PMATCHING)
  81.       If MATCH
  82.         ? ' Name: '+trim(first:name)+' '+trim(last:name)+'  Phone: '+home:phone
  83.         Accept 'Is this the right name and phone? [Y/N] ' to XSELECT
  84.         Store T to invalcc
  85.         Do while invalcc
  86.           STORE F TO INVALCC
  87.           Do case
  88.             CASE !(XSELECT) = 'Q'
  89.               STORE F TO MATCHING
  90.             CASE !(XSELECT) = 'Y' .and. !(esel)='S'
  91.               Replace membstatus with $(membstatus,1,8)+'x'+$(membstatus,10,1)
  92.               ? "The above person's record has now been marked 'SPECIAL.'"
  93.               Store F to matching
  94.             CASE !(XSELECT) = 'Y' .AND. !(ESEL)='D'
  95.                 DELETE
  96.                 ? "The above person's record has now been deleted."
  97.                 Store '    ' to calling
  98.               Store F to Matching
  99.             CASE !(XSELECT)='Y' .AND. !(ESEL) = 'I'
  100.             Replace membstatus with $(MEMBSTATUS,1,1)+'*'+$(MEMBSTATUS,3,8)
  101.         ? "The above person's record has now been made full-church inactive."
  102.               Store '    ' to calling
  103.               Store $(dates,1,5)+indate to dates
  104.               Store F to matching
  105.             CASE !(XSELECT)='Y' .AND. !(ESEL) = 'J'
  106.                   Replace ss:sc:memb with $(ss:sc:memb,1,4)+"*"
  107.         ? "The above person's record has now been made Small Church inactive."
  108.               Store F to matching
  109.             CASE !(XSELECT)='Y' .AND. !(ESEL) = 'P'
  110.          Replace calling with $(indate,3,2)+'\'+$(indate,1,2)+'\'+$(date(),4,2)
  111.           ? "The above person's record now has today's date for pastoral call."
  112.               Store F to matching
  113.             CASE !(XSELECT)='Y' .and. !(ESEL)<>'I' .and. !(ESEL)<>'J'
  114.                   * Go edit current record
  115.               Release INHH,INLN,INFN,MATCHINGL,NXTMATCH,PMATCHING
  116.               Do MUPEDIT.CMD
  117.               Store F to MATCHING
  118.             CASE !(XSELECT) = 'N'
  119.               Store F to MATCH
  120.               SKIP
  121.             OTHERWISE
  122.               Accept 'Invalid entry. Please enter again: ' to XSELECT
  123.               STORE T TO INVALCC
  124.             ENDCASE
  125.           enddo
  126.         endif
  127.       enddo    * (MATCHING)
  128.     endif
  129.   ENDDO
  130. RETURN
  131.  
  132.