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

  1. * Program SCATTEND - Attendance Marking, Check Lists
  2. Select secondary
  3. Use MDIRFILE index MDIRFILE
  4. Select Primary
  5. Store d+':members' to MFILE
  6. Store d+':SCMEMBRS.NDX' to MFILENDX
  7. If .not. FILE(MFILENDX)
  8.   Use &MFILE
  9.   ? 'File',MFILENDX,'not found. Now indexing MEMBERS file to create it.'
  10.   Set talk on
  11.   Index on ss:sc:memb+last:name+first:name to &MFILENDX
  12.   Set talk off
  13. endif
  14. USE &MFILE index &MFILENDX
  15. Release LEVEL1,LEVEL2,cyearcon,invalidd
  16. Store T to LEVEL3
  17. Store T to undated
  18. STORE F TO FCATTD
  19. Do while LEVEL3
  20.   Erase
  21.   @ 1,1 say chname
  22.   @ 1,60 say curdate
  23.   @ 2,1 say 'DATA DISK = '+D
  24.   @ 3,15 say  'Small Church Attendance Marking, Reports'
  25.   @ 3,64 say '3-4-/SCATTEND/'
  26.   IF .NOT. UNDATED
  27.     @ 4,64 SAY 'WEEK: '+WEEKNAME
  28.   ENDIF
  29.   @ 5,9 say  '1)  Small Church MONTHLY Attendance Check Lists'
  30.   @ 6,9 say  '2)  Small Church WEEKLY Attendance Check Lists'
  31.   @ 7,9 say  '3)  Mark Attendance, by Small Church'
  32.   @ 8,9 say  '4)  Add New People'
  33.   @ 9,9 say  '5)  NEWLY-ACTIVES   List'
  34.   @ 10,9 say '6)  NEWLY-INACTIVES List   '
  35.   @ 11,9 say '7)  1ST TIMERS List'
  36.   @ 12,9 say '8)  Attendance Report - year-to-date'
  37.   @ 13,9 say '9)  Set up Attendance Marks for a New Year'
  38. ?
  39. Accept '         Enter selection' to NSEL
  40. IF !(NSEL)='Q'
  41.    Release MFILENDX,XX,N,BNAM,FCOLHDR,FCOLUMN,ANAME1,ANAME,INVALID3,INS,ACTVNAM
  42.    Release curwk5,curweek
  43.    Release ACTVNAME,BNAME,LEVEL3,UNDATED,FCATTD,NSEL,MFILE,valid3,weekname
  44.     Store T to LEVEL2
  45.     Store F to invalidd
  46.     STORE '4' to msel
  47.     RETURN
  48. endif
  49. STORE F TO VALID3
  50. If (nsel='2'.or.nsel='3'.or.nsel='4'.or.NSEL='5'.or.NSEL='6'.or.NSEL='7') ;
  51.   .and. undated
  52.   Do mattdate.cmd
  53.   Store F to undated
  54. endif
  55. Store "$(membstatus,2,1)='*' .or. $(ss:sc:memb,5,1)='*' " to BNAM
  56. Store ' ' to fcolhdr
  57. Store 'fcolhdr' to fcolumn
  58. Store val($(nsel,1,1)) to N
  59. If N>1 .and. N<10
  60.   Select secondary
  61.   ?
  62.   Accept 'Enter Small Church code ' to ANAME1
  63.   If aname1=' ' .or. !(aname1)='Q'
  64.     Store T to valid3
  65.   else
  66.       Store 'SS:SC:MEMB' to ANAME
  67.       Store T to invalid3
  68.       If NSEL='1' .and. !(ANAME1)='ALL'
  69.         Store 'SSSC=' to insssc
  70.         Find &INSSSC
  71.         If #=0
  72. Accept 'No S.C. section in MDIRFILE. It must be rebuilt. Press <retn> ' to XX
  73.           RETURN
  74.         endif
  75.         Store $(spact,6,4) to spactiv
  76.         Store 'ALL' to INS
  77.         Store ' ' to actvnam
  78.         SKIP
  79.         Store F to invalid3
  80.       else
  81.       Do while invalid3
  82.         Store 'SSSC='+ANAME1 to INS
  83.         If !(ANAME1)='Q'
  84.           USE
  85.           Select primary
  86.           Return
  87.         endif
  88.         Find &INS
  89.         If #=0
  90.           Accept 'Invalid entry. Please enter again ' to ANAME1
  91.         else
  92.           Store F to invalid3
  93.         endif
  94.       enddo
  95.       Store trim($(spact,10,20)) to actvnam
  96.       Set intensity off
  97.       Select primary
  98.       Find &ANAME1
  99.       IF #=0
  100.         Accept 'No names found with this S.C.code. Press <retn> to exit.' to XX
  101.         STORE T TO VALID3
  102.       endif
  103.       endif
  104.       Release INS,invalid3
  105.     endif
  106. endif
  107. Select primary
  108. Do while .NOT. valid3
  109.   Store T to valid3
  110.   Do CASE
  111.     CASE NSEL = '1'
  112.      ACCEPT 'Does the MSCROST file have the latest updates from MEMBERS?' to XX
  113.      If !(XX)<>'Y'
  114.        Do MGSCROST.CMD
  115.      endif
  116.      Store actvnam to actvname
  117.      Do SCATTD.CMD
  118.      Release N,XX,spactiv
  119.     CASE NSEL = '2'
  120.       Store BNAM+".or. $(membstatus,8,1)='*'" to BNAME
  121.       Store "$(membstatus,7,2)+' '+$(ssscattd,curwk5,6)" to fcolumn
  122.       Store "Attendance" to fcolhdr
  123.       Store actvnam+' Attendance Checker ' to actvname
  124.       ? '     ',actvname
  125.       Do MONELINE.CMD
  126.       Release curwk5,nn,na,np,nd,xx
  127.     CASE NSEL = '3'
  128.       Store BNAM+".or. $(membstatus,8,1)='*'" to BNAME
  129.       Store actvnam to actvname
  130.       Do MSSATTND.CMD
  131.     CASE NSEL = '4'
  132. * Enter MUPADD with a flag set for '1N' in MEMBSTATUS,7,2.
  133.       Store 'SCATT' to MSEL
  134.       Store d+':MEMBERS ' to MFILE
  135.       Use &MFILE index &MFILE
  136.       Store '       ' to eselect
  137.       Store ' ' to xaddress
  138.       Store ' ' to xcityst
  139.       Store ' ' to xzip
  140.       Store ' ' to xfamcode
  141.       Store ' ' to homephone
  142.       Store ' ' to lastname
  143.       Store ' ' to firstname
  144.       Do MUPADD.cmd
  145.         Store d+':SCMEMBRS.NDX' to MFILENDX
  146.         Set console off
  147.         delete file &MFILENDX
  148.         Store d+':OFFERNDX.NDX' to MFILENDX
  149.         delete file &MFILENDX
  150.         Release lastname,firstname,xaddress,xcityst,xzip,xfamcode,homephone
  151.         Release eselect,aname,inhh,inh1,inh2,fcode9,matching,match,curwk
  152.         Release lastcod,lastcode,firstcode,curfnum,addedrec,lastnam,locating
  153.         Release waraddr,inhhc,c2inhh,curfnumb,invalcc,valid1,curwk5,N,
  154.         Set console on
  155.         Select secondary
  156.         Use mdirfile index mdirfile
  157.         Select primary
  158.         Use &MFILE
  159.      ? 'Now re-indexing the MEMBERS file by SS:SC:MEMB producing SCMEMBRS.NDX.'
  160.         Set talk on
  161.         Index on ss:sc:memb+last:name+first:name to &MFILENDX
  162.         Set talk off
  163.         Use &MFILE index &MFILENDX
  164.     CASE NSEL = '5'
  165.       Store actvnam+' NEWLY-ACTIVES list   ' to actvname
  166.       Store BNAM+" .or. $(membstatus,8,1)<>'X' " to BNAME
  167.       ? '    ',actvname
  168.       Do MONELINE.cmd
  169.     CASE NSEL = '6'
  170.       Store actvnam+' NEWLY-INACTIVES list   ' to actvname
  171.       Store BNAM+".or.($(membstatus,7,1)<>'I')" to BNAME
  172.       ? '    ',actvname
  173.       Do MONELINE.cmd
  174.     CASE NSEL = '7'
  175.       Store actvnam+' 1ST TIME VISITORS  ' TO ACTVNAME
  176.       Store BNAM+".or. $(membstatus,7,2)<>'1N'" to BNAME
  177.       ? '    ',actvname
  178.       Do MONELINE.CMD
  179.     CASE NSEL = '8'
  180.       Store actvnam+' Attendance to date ' to actvname
  181.       ? 'Now printing ',ACTVNAME
  182.       Do MATTYEAR.CMD
  183.     CASE NSEL='9'
  184.       Accept 'Enter the last week number in the year just past [52/53]' to XX
  185.       Store val(XX)+1 to xnum
  186.       If xnum=53.or.xnum=54
  187.       ? 'Now setting up attendance markings for next year.'
  188.       Store 0 to curnum
  189.       Store 0 to curr
  190.       Do while .not. EOF .and. (&aname=ANAME1)
  191.         Replace ssscattd with $(ssscattd,xnum,5)
  192.         SKIP
  193.         Store curr+1 to curr
  194.         If curr=20
  195.           Store 20+curnum to curnum
  196.           ? curnum,' records processed.'
  197.           Store 0 to curr
  198.         endif
  199.       enddo
  200.       Store curnum+curr to curnum
  201.       ? curnum,' records processed.'
  202.      else
  203.       Accept 'Invalid week number (52 or 53). Press <retn> ' to XX
  204.      endif
  205.       Release xnum,curr,curnum
  206.     CASE !(NSEL) = 'Q'
  207.       STORE F TO LEVEL3
  208.     OTHERWISE
  209.       Accept 'Illegal selection. Please enter again ' to NSEL
  210.       Store F to validd1
  211.   ENDCASE
  212. ENDDO
  213. If NSEL='2'.or.NSEL='5'.OR.NSEL='6'.OR.NSEL='7'.OR.NSEL='8'
  214.   ?
  215.   ACCEPT 'Processing is complete. Press <RETURN> to exit.' to XX
  216. endif
  217. ENDDO
  218. Release undated,nsel,ins,curweek,weekname,N,fcattd,curwk5,actvnam,curwk
  219. Release MFILE,mfilendx,level3,fcattd
  220. Select secondary
  221. Use
  222. Select primary
  223. USE
  224. RETURN
  225.         STORE T TO VALID3
  226.       endif
  227.       endif
  228.       Release INS,invalid3
  229.     endif
  230. endif
  231. Select prima