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

  1. * Program FCREPORT - Prints various reports of everyone in MEMBERS
  2. Select primary
  3. Store T to LEVEL2
  4. Do while LEVEL2
  5. Erase
  6. @ 1,1 say chname
  7. @ 1,62 say curdate
  8. @ 2,1  say 'DATA DISK = '+D
  9. @ 3,10 say  '         FULL CHURCH PROCESSING'
  10. @ 3,66 say  '2-/FCREPORT/'
  11. @ 5,10 say  '0)  One-line display'
  12. @ 6,10 say  '1)  All membership information                               [FI]'
  13. @ 7,10 say  '2)  Briefer two-line report                                  [TL]'
  14. @ 8,10 say  '3)  One-line report, by offering envelope number             [OL]'
  15. @ 9,10 say  '4)  Full-church Directory                                    [FD]'
  16. @ 10,10 say '5)  SPECIAL DATES                                     / FCSDATES'
  17. @ 11,10 say '6)  MAILING LABELS - All members/attenders, by family        [ML]'
  18. @ 12,10 say '7)  MAILING LABELS - All voting members                      [ML]'
  19. @ 13,10 say '8)  MAILING LABELS - All offering envelope numbers           [ML]'
  20. @ 14,10 say '9)  Full-church attendance marking, reports           / FCATTEND'
  21. ?
  22. Accept '           Enter selection ' to MSEL
  23. ?
  24. Store CHNAME to CXNAME
  25. Store F to validd
  26. Do while .NOT. validd
  27.   Store T to VALIDD
  28.   Do CASE
  29.     CASE MSEL='0'
  30.       Store d+':MEMBERS' to mfile
  31.       Use &MFILE index &MFILE
  32.       Accept 'Enter selection criteria (<retn> = all)' to xsel
  33.       If xsel=' '
  34.         Store 'validd' to xsel
  35.       endif
  36.       ? chname,'Membership Report      ',curdate
  37.       ?
  38.       Store T to beginng
  39.       Do while .not. EOF
  40.         If .not. Beginng
  41.         ? ss:sc:memb,$(last:name,1,12),$(first:name,1,10),home:phone,address
  42.         SKIP
  43.         endif
  44.         Store F to beginng
  45.         Do while .not. (&XSEL).and..not.EOF
  46.           SKIP
  47.         enddo
  48.       enddo
  49.     CASE MSEL = '1'
  50.       Store d+':MEMBERS index '+d+':MEMBERS' to MFILE
  51.       Store CXNAME+'  -  Full Information Report' to CNAME
  52.       Store 'ALL' to ANAME1
  53.       Store 'ANAME1' to ANAME
  54.       Store '$(MEMBSTATUS,2,1)="*"' to BNAME
  55.       Do FCREPT1.CMD
  56.     CASE MSEL='2'
  57.       Select secondary
  58.       Use MDIRFILE index MDIRFILE
  59.       Select primary
  60.       Store d+':MEMBERS index '+d+':members' to MFILE
  61.       USE &MFILE
  62.       Store CXNAME+' - Brief Full-Church Report' to CNAME
  63.       Store 'ALL' to ANAME1
  64.       Store 'ANAME1' to ANAME
  65.       Store "$(membstatus,2,1)='*'" to BNAME
  66.       Store 'ACTIV:' to othheadr
  67.       Store 'SP:ACTIVTY' to othnam1
  68.       Store 'SS:SC:MEMB' to FCOLUMN
  69.       Store 'Sm.Church' to fcolhdr
  70.       Do MTWOLINE.CMD
  71.     CASE MSEL = '3' .or. !(MSEL)='8'
  72.       Store d+':OFFERNDX.NDX' to BNAME
  73.       If .not. file(BNAME)
  74.         ? 'Now indexing MEMBERS file by offering envelope.'
  75.         Store d+':MEMBERS' to ANAME
  76.         USE &ANAME
  77.         Set talk on
  78.         Index on offeringen to &BNAME
  79.         Set talk off
  80.       endif
  81.       endif
  82.       Store d+':MEMBERS index '+d+':OFFERNDX' to MFILE
  83.       USE &MFILE
  84.       Store 'str(offeringen,4)' to ANAME
  85.       Store ' offeringen=0 ' to BNAME
  86.       Store ' OFFERING ENVELOPES ' to CNAME
  87.       Find 1
  88.       If #=0
  89.         Find 2
  90.         If #=0
  91.           Find 3
  92.           If #=0
  93.      ? 'Offering envelopes 1,2, or 3 are not assigned to anyone, as required.'
  94.      Accept 'Press <retn> ' to XX
  95.      RETURN
  96.           endif
  97.         endif
  98.       endif
  99.        If MSEL = '3'
  100.         Store # to curenvl
  101.         Do MS1LINE.CMD
  102.        else
  103.         Select secondary
  104.         Use MDIRFILE index MDIRFILE
  105.         GOTO 19
  106.         Store val($(spact,28,2)) to MLSPACNG
  107.         SKIP
  108.         Store val($(spact,28,2)) to mlinespp
  109.         SKIP
  110.         Store val($(spact,28,2)) to MLCOL1
  111.         SKIP
  112.         Store val($(spact,29,2)) to MLCOL2
  113.         USE
  114.         Store MLINESPP-1 to MAXLINE
  115.         Select primary
  116.         ? 'Now printing Mailing Labels, all people with offering envelopes.'
  117.         Set format to print
  118.         Store 'str(offr,5)' to XNAME
  119.         Store '1' to C
  120.         Store 0 to curline
  121.         Do while .not. EOF
  122.           Store val($(familycode,8,1)) to fcode
  123.           Store trim(last:name) to lname
  124.           Store trim(first:name) to fname
  125.           Store offeringen to OFFR
  126.           Store address to xaddr
  127.           Store trim(city:state)+' '+zip to cs
  128.           SKIP
  129.           If .not. EOF
  130.             If offeringen=offr
  131.               Store val($(familycode,8,1)) to gcode
  132.               If gcode<fcode
  133.                 Store trim(first:name)+' and '+fname to fname
  134.               else
  135.                 Store fname+' and '+trim(first:name) to fname
  136.               endif
  137.               SKIP
  138.             endif
  139.           endif
  140.           Store fname+' '+lname to names
  141.           If len(names)>30
  142.             Store $(names,1,30) to names
  143.           endif
  144.           If MLCOL2=0
  145.             @ curline,MLCOL1 say NAMES
  146.             @ curline,MLCOL1+30 say &xname
  147.             @ curline+1,MLCOL1 say XADDR
  148.             @ curline+2,MLCOL1 say CS
  149.             Store curline+MLSPACNG to curline
  150.           else
  151.             Store names to NAMEC&C
  152.             Store &XNAME to XNAME&C
  153.             Store xaddr to ADDRC&C
  154.             Store CS to CITYC&C
  155.             If C='2'
  156.               @ curline,MLCOL1 say NAMEC1
  157.               @ curline,MLCOL1+30 say XNAME1
  158.               @ curline,MLCOL2 say NAMEC2
  159.               @ curline,MLCOL2+30 say XNAME2
  160.               @ curline+1,MLCOL1 say ADDRC1
  161.               @ curline+1,MLCOL2 say ADDRC2
  162.               @ curline+2,MLCOL1 say CITYC1
  163.               @ curline+2,MLCOL2 say CITYC2
  164.               Store curline+MLSPACNG to curline
  165.               Store '1' to C
  166.             else
  167.               Store '2' to C
  168.             endif
  169.           endif
  170.           If curline>MAXLINE
  171.             EJECT
  172.             Store 0 to curline
  173.           endif
  174.         enddo
  175.         If C='1' .and. MLCOL2>0
  176.           @ curline,MLCOL1 say NAMEC1
  177.           @ curline,MLCOL1+30 say LABELC1
  178.           @ curline+1,MLCOL1 say ADDRC1
  179.           @ curline+2 say CITYC1
  180.         endif
  181.         EJECT
  182.         Set format to screen
  183.       endif
  184.       Set DELETED on
  185.       Release MLCOL1,MLCOL2,MLINESPP,MLSPACNG,MAXLINE,XNAME,FCODE,LNAME,OFFR
  186.       rELEASE CS,XADDR,GCODE,C,NAMES,ADDRC1,ADDRC2,NAMEC1,NAMEC2
  187.     CASE MSEL = '4'
  188.       Do FCREPT4.CMD
  189.     CASE MSEL = '5'
  190.       Do FCSDATES.CMD
  191.     CASE !(MSEL) = '6'
  192.   Accept 'Does the FCMEMBRS file have the latest changes from MUPDATE? ' to XY
  193.       If !(XY)='Q'
  194.         RETURN
  195.       endif
  196.       If !(XY)<>'Y'
  197.         Do MGFCROST.CMD
  198.       endif
  199.       Store d+':FCMEMBRS index '+d+':FCMEMBRS' to SPFILE
  200.       If file(SPFILE)
  201.         Store 'ALL' to ANAME1
  202.         Store 'ANAME1' to ANAME
  203.         Store "$(membstatus,2,1)='*'" to BNAME
  204.         Store ' ' to XX
  205.         Store 'XX' to XNAME
  206.         DO MSPFMAIL.CMD
  207.       else
  208.         ? 'File ',SPFILE,' not present on data disk.'
  209.       endif
  210.     CASE !(MSEL)='7'
  211.       Store d+':MEMBERS index '+d+':MEMBERS' to SPFILE
  212.       If .not. file(SPFILE)
  213.         ? 'File ',SPFILE,' does not exist on "',d,'" disk.'
  214.       else
  215.       Store val($(date(),7,2))-voteage to yearval
  216.       Store val($(date(),7,2)+$(date(),1,2))-voteage*100 to votedate
  217.       Store str(yearval,2) to yearstr
  218.       Set format to print
  219.       Store 'VAL($(birthdate,7,2)+$(birthdate,1,2)) > votedate' to inbdate
  220.       Store inbdate+' .or. !(Membstatus)<>"Y" ' to bname
  221.       Store 'ANAME1' to ANAME
  222.       Store 'ALL' to ANAME1
  223.       Store ' ' to XX
  224.       Store 'XX' to XNAME
  225.       Do MSPFMAIL.CMD
  226.       endif
  227.     CASE !(MSEL) = '9'
  228.       Do FCATTEND.CMD
  229.     CASE !(MSEL)='Q'
  230.       Store F to LEVEL2
  231.     otherwise
  232.       Accept 'Illegal selection. Please enter again ' to MSEL
  233.       Store F to validd
  234.     endcase
  235.   enddo
  236. If LEVEL2
  237.   Set format to screen
  238.   Accept 'Report is complete. Press <retn> ' to XX
  239. endif
  240. enddo
  241. RETURN
  242.  
  243. mbstatus,2,1)='*'" to BNAME
  244.       Store 'ACTIV:' to othheadr
  245.       Store 'SP:ACTIVTY' to othnam1
  246.       Store 'SS:SC:MEMB' to FCOLUMN
  247.       Store 'Sm.Church' to fcolhdr
  248.       Do MTWOLINE.CMD
  249.     CASE MSEL = '3' .or. !(MSEL)='8'
  250.       Store d+':OFFERNDX.NDX' to BNAME
  251.       If .not. file(BNAME)
  252.         ?