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

  1. * Program PCALLING -Searches ,prints names from 1 year old to calling month gap
  2. * MGAP - number of months allowed between calls.  (Entered by operator)
  3. * MGAPP - Adjusted MGAP, running end-of-year       CXMONTH - current month
  4. * CXM   - running month    CXYEAR - current year   CXYEARX - running year
  5. * CYCALL - This year's oldest calling month, if found
  6. Store T to LEVEL2
  7.   Erase
  8.   @ 2,30 say 'PASTORAL CALLING               '+curdate
  9.   @ 4,0  say ;
  10.  'This routine assists in recording and reporting back information about your'
  11.  ? 'past congregational calling.  The first step is to establish a calling'
  12.  ?? 'record.'
  13.  ? 'Mark congregation MEMBER records with the date that you made a pastoral'
  14.  ?? ' call'
  15. ? 'to them:  with the computer date set to the date of some calls, go into the'
  16.  ? 'MPROFILE-Update process and select "P" for Pastoral call. The program will'
  17.  ?? 'ask'
  18. ? "for a name,  then will record the system date into CALLING of that member's"
  19. ? "record. (Always mark only the head-of-household's record). After this has"
  20.  ?? 'been'
  21. ? 'done for several months, you are ready to query your calling history.  This'
  22.  ? 'routine asks for the number of months that you allow between calls, then'
  23.  ?? 'dis-'
  24.  ? 'plays all names that have been called and have a last-called data farther'
  25.  ?? 'back'
  26.  ? 'than the number of months you allow between calls.'
  27.    ?
  28.   ? 'Now indexing the MEMBERS file by CALLING date.'
  29.   Store d+':MEMBERS' to MFILE
  30.   Store d+':MCALLING' to MFILEX
  31.   Use &MFILE
  32.   Set talk on
  33.   Index on calling+familycode to &MFILEX
  34.   Set talk off
  35. Use &MFILE index &MFILEX
  36. Store val($(indate,1,2)) to CXMONTH
  37. Store val($(indate,3,2)) to CXYEAR
  38. Do while LEVEL2
  39. ?
  40. ? '             Select one of the following functions.'
  41. ?
  42. ? '          1) Display calls that are due'
  43. ? '          2) Display a history of all calls'
  44. ? '          Q) Quit'
  45. ?
  46. Accept '          Enter selection' to XSEL
  47. Store T to invalid1
  48. Do while invalid1
  49.   If !(XSEL)='Q'
  50.     USE
  51.     RETURN
  52.   endif
  53.   If XSEL<>'1' .and. XSEL<>'2'
  54.     Accept 'Invalid entry. Please enter again ' to XSEL
  55.   else
  56.     Store F to invalid1
  57.   endif
  58. enddo
  59. If XSEL='1'
  60.   Accept '          Enter length of calling period, in months ' to MGAPX
  61.   IF !(MGAPX)='Q'
  62.     Store '0' to XSEL
  63.   else
  64.   Store val(mgapx) to mgap
  65.   Do while mgap<1 .or. mgap>12
  66. Accept 'Invalid calling period. Must be between 1 and 12. Enter again' to MGAPX
  67.   Store val(mgapx) to mgap
  68.   enddo
  69.   ?
  70.   ? '            Membership Calls-Due Report          ',curdate
  71.   endif
  72. else
  73.   ?
  74.   ? '            Membership Pastoral Calls Report    ',curdate
  75.   Store '1' to mgapx
  76.   Store 1 to mgap
  77. endif
  78.  If XSEL<>'0'
  79.   ?
  80.   Store str(cxyear,2) to CXYEARX
  81.   Set exact off
  82.   Store '                    ' to spaces
  83. * Find a first call date within the past year.
  84. * Start with the current year, save the oldest found record number.
  85.   Find &CXYEARX
  86.   Store str(#,4) to cycall
  87.   *Find the oldest call date last year within 12 months of current month.
  88.   Store str(cxyear-1,2) to cxyearx
  89.   Store cxmonth-1 to CXM
  90.   Store T to NOFIND
  91.   Do while CXM < 12 .and. NOFIND
  92.     Store CXM+1 to CXM
  93.     If cxm<10
  94.       Store cxyearx+'\0'+str(cxm,1) to CXDATE
  95.     else
  96.       Store cxyearx+'\'+str(cxm,2) to CXDATE
  97.     endif
  98.     Find &CXDATE
  99.     If #<>0
  100.       Store F to NOFIND
  101.     endif
  102.   enddo
  103.   * Go back to this year's find, if nothing in last year.
  104.   Store CXMONTH-MGAP+13 to MGAPP
  105.   If MGAPP>12
  106.     * This year
  107.     Store MGAPP-12 to MGAPN
  108.   else
  109.     Store 1 to MGAPN
  110.   endif
  111.   If #=0 .and. CYCALL<>'   0'
  112.     GOTO &CYCALL
  113.   endif
  114.   If #=0
  115.      ? 'No members found with call dates within the last year. '
  116.   else
  117.   If XSEL='2'
  118.     Store 13 to MGAPP
  119.   endif
  120.   * First display all call-due dates from last year; falls thru, if none.
  121.   Do while calling=CXDATE .and. .not. EOF .and. #<>0 .and. CXM < mgapp
  122.      Store ' ' to XM
  123.      Store CXDATE to XX
  124.      If !($(membstatus,1,1))='Y'
  125.         Store '-' to XM
  126.      endif
  127.      Store trim(first:name)+' '+trim(last:name) to names
  128.      Store len(names) to ln
  129.      If ln>19
  130.         Store $(names,1,20) to names
  131.      else
  132.         Store names+$(spaces,1,20-ln) to names
  133.      endif
  134.      If $(familycode,9,1)='M'
  135.        Store '='+xm+names to names
  136.      else
  137.        Store ' '+xm+names to names
  138.      endif
  139.      Store trim(address)+', '+trim(city:state) to taddr
  140.      If len(taddr)>31
  141.         Store $(taddr,1,31) to taddr
  142.      endif
  143.      Store $(calling,4,3)+$(calling,1,2) to XX
  144.      ? XX,' ',ss:sc:memb,home:phone,names,taddr
  145.       SKIP
  146.       Do while (calling<>cxdate .and. CXM < mgapp)
  147.         Store CXM+1 to CXM
  148.         If CXM<mgapp
  149.          If CXM<10
  150.            Store cxyearx+'\0'+str(cxm,1) to CXDATE
  151.          else
  152.           Store cxyearx+'\'+str(cxm,2) to CXDATE
  153.          endif
  154.          Find &CXDATE
  155.         endif
  156.       enddo
  157.       If cxdate<>XX
  158.         ?
  159.       endif
  160.     enddo
  161.     Store 1 to CXM
  162.     Store MGAPN to mgapp
  163.     If XSEL='2'
  164.       Store CXMONTH to mgapp
  165.     endif
  166.     Store str(cxyear,2) to cxyearx
  167.     If CXM<10
  168.       Store cxyearx+'\0'+str(cxm,1) to cxdate
  169.     else
  170.       Store cxyearx+'\'+str(cxm,2) to cxdate
  171.     endif
  172.     If CYCALL<>'   0'
  173.       GOTO &CYCALL
  174.     endif
  175.     Do while calling=CXDATE .and. .not. EOF .and. #<>0 .and. CXM < mgapp
  176.       Store ' ' to XM
  177.       Store CXDATE to XX
  178.       If !($(membstatus,1,1))='Y'
  179.         Store '-' to XM
  180.       endif
  181.       Store trim(first:name)+' '+trim(last:name) to names
  182.       Store len(names) to ln
  183.       If ln>19
  184.         Store $(names,1,20) to names
  185.       else
  186.         Store names+$(spaces,1,20-ln) to names
  187.       endif
  188.       If $(familycode,9,1)='M'
  189.         Store '='+xm+names to names
  190.       else
  191.         Store ' '+xm+names to names
  192.       endif
  193.       Store trim(address)+', '+trim(city:state) to taddr
  194.       If len(taddr)>31
  195.         Store $(taddr,1,31) to taddr
  196.       endif
  197.       ? $(calling,1,5),' ',ss:sc:memb,home:phone,names,taddr
  198.       SKIP
  199.       Do while (calling<>cxdate .and. CXM < mgapp);.and. #<>0
  200.         Store CXM+1 to CXM
  201.         If CXM<mgapp
  202.           Store cxyearx+'\'+str(cxm,2) to CXDATE
  203.           Find &CXDATE
  204.         endif
  205.       enddo
  206.       If CXDATE<> XX
  207.         ?
  208.       endif
  209.     enddo
  210.   endif
  211.   ?
  212.   Accept 'End of report. Press <RETURN>' to XX
  213.   endif
  214.   ERASE
  215.   @ 1,20 say 'PASTORAL CALLING'
  216.   ?
  217. enddo
  218. USE
  219. Delete file mcalling.ndx
  220. RETURN
  221.  endif
  222.   ERASE
  223.   @ 1,20 say 'PASTORAL CALLING'
  224.    ?
  225.    ?
  226. enddo
  227. USE
  228. Delete file mcalling.ndx
  229. RETURN
  230. 
  231.     Store 1 to CXM
  232.     Store MGAPN to mgapp
  233.     If XSEL='2'
  234.     
  235. Store $(spact,3,29) to MD3E
  236. SKIP
  237. Store $(spact,3,29) to MD3F
  238. SKIP
  239. Store $(spact,3,29) to MD3G
  240. SKIP
  241. STORE $(SPACT,3,29) TO MD3H
  242. SKIP
  243. STORE $(SPACT,3,29) TO MD3I
  244. SKIP
  245. STORE $(SPACT,3,29) TO MD3J
  246. SKIP
  247. STORE $(SPACT,3,29) TO MD3K
  248. SKIP
  249. STORE $(SPACT,3,29) TO MD3L
  250. GOTO 18
  251. Store $(spact,13,18) to MD8
  252. SKIP
  253. Store $(spact,28,2) to MD4
  254. SKIP
  255. STORE $(SPACT,28,2) TO MD5
  256. SKIP
  257. Store $(spact,28,2) to MD6
  258. SKIP
  259. Store $(spact,29,2) to MD7
  260. SKIP
  261. STORE $(SPACT,16,2) TO MD9
  262. SKIP
  263. STORE $(SPACT,26,3) TO