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

  1. * Program SAREPORT - Prints various reports of members, by Special Activity
  2. Store T to LEVEL2
  3. Do while LEVEL2
  4.   Erase
  5.   @ 1,1 say chname
  6.   @ 1,62 say curdate
  7.   @ 2,1 say 'DATA DISK = '+D
  8.   @ 3,20 say  ' Special Activity Reports              4-/SAREPORT/'
  9.   @ 5,10 say '0)  One-line display'
  10.   @ 6,10 say '1)  Print standard report of a specified SPECIAL-ACTIVITY   [OL]'
  11.   @ 7,10 say '2)  Print two-line report of a SPECIAL-ACTIVITY, with OTHER [TL]'
  12.   @ 8,10 say '3)  Print 2-column roster of selected SPECIAL-ACTIVITY      [2C]'
  13.   @ 9,10 say '4)  Print a new-people list from this month                 [CL]'
  14.  @ 10,10 say '5)  Print a new-changes list from this month                [CL]'
  15.  @ 11,10 say '6)  Print a list of birthdays from this month               [CL]'
  16.  @ 12,10 say '7)  Mailing labels                                          [ML]'
  17. ?
  18. Accept '          Enter selection ' to MSEL
  19. ?
  20. Do while @(MSEL,'01234567Qq')=0
  21.   Accept 'Invalid entry. Please enter again ' to MSEL
  22. enddo
  23.   Store T to validd
  24.   Do CASE
  25.     CASE MSEL = '0' .or. MSEL = '1' .OR. MSEL = '2' .or. MSEL='3'
  26.   Accept 'Does the MACTIVTY file have the latest updates from MEMBERS? ' to XY
  27.       If !(XY)<>'Y'
  28.         Do MGSAROST.CMD
  29.       endif
  30.       Store d+':MACTIVTY index '+d+':MACTIVTY' to MFILE
  31.       If .not. file(MFILE)
  32.         ? 'File ',MFILE,' does not exist on "',d,'" disk.'
  33.       else
  34.       Select secondary
  35.       USE MDIRFILE index MDIRFILE
  36.       STORE T TO MORNAMES
  37.       Store ' ' to CNAME
  38.       Do while MORNAMES
  39.         Accept 'Enter Special Activity code ' to ANAME1
  40.         If !(ANAME1)='Q'
  41.           Store F to MORNAMES
  42.           Store 'Q' to CNAME
  43.         else
  44.           Store 'SPAC='+ANAME1 to infind
  45.           Find &infind
  46.           If #=0
  47.             ? 'Special Activity code not found in MDIRFILE'
  48.           else
  49.             Store F to mornames
  50.             Store trim($(SPACT,10,20)) to CNAME
  51.             Store "$(sp:activty,1,3)" to ANAME
  52.             Store "$(MEMBSTATUS,2,1)='*'" to BNAME
  53.           endif
  54.         endif
  55.       ENDDO
  56.       Select primary
  57.       If CNAME<>'Q'
  58.         USE &MFILE
  59.         If MSEL='1'
  60.           Store CNAME to actvname
  61.           Store ' ' to fcolhdr
  62.           Store 'fcolhdr' to fcolumn
  63.           DO MONELINE.CMD
  64.         ELSE
  65.         If MSEL='2'
  66.           Store '$(birthdate,1,8)' to fcolumn
  67.           Store 'Birthday' to fcolhdr
  68.           Store 'ACTIV: ' to othheadr
  69.           Store '$(sp:activty,1,8)' to othnam1
  70.           Do MTWOLINE.CMD
  71.         else
  72.           If MSEL='3'
  73.             Do M2COLROS.CMD
  74.           else
  75.       Accept 'Enter selection criteria (<retn> = all)' to xsel
  76.       Select primary
  77.       Find &ANAME1
  78.       If xsel=' '
  79.         Store 'LEVEL2' to xsel
  80.       endif
  81.       ?
  82.       ? '     ',cname,'Membership Report      ',curdate
  83.       ?
  84.       Store T to beginng
  85.       Do while sp:activty=ANAME1 .and. .not. EOF
  86.         If .not. Beginng
  87.     Store trim(first:name)+' '+trim(last:name)+'                    ' to xx
  88.           Store $(xx,1,20) to xx
  89.           ? $(ss:sc:memb,1,3),xx,home:phone,address,$(city:state,1,17)
  90.           SKIP
  91.         endif
  92.         Store F to beginng
  93.         Do while .not. (&XSEL).and..not.EOF
  94.           SKIP
  95.         enddo
  96.       enddo
  97.       ?
  98.       Accept 'End of report. Press <RETN> ' to xx
  99.           endif
  100.         endif
  101.         ENDIF
  102.       SELECT SECONDARY
  103.       USE
  104.       SELECT PRIMARY
  105.       endif
  106.      endif
  107.     CASE MSEL = '6' .or. MSEL='4' .or. MSEL='5'
  108.       Accept 'Does MACTIVTY file have the latest updates from MEMBERS? ' to XX
  109.       If !(XX)<>'Y'
  110.         Do MGSAROST.CMD
  111.       endif
  112.       Store d+':mactivty index '+d+':mactivty' to MFILE
  113.       If .not. file(MFILE)
  114.         ? 'File ',MFILE,' does not exist.'
  115.       else
  116.         USE &MFILE
  117.         Accept 'Enter Special Activity code ' to INSSSC
  118.         Select secondary
  119.         Use MDIRFILE index MDIRFILE
  120.         Store T to NOGOOD
  121.         Do while NOGOOD
  122.          If !(INSSSC)='ALL'
  123.            Store 'ALL'  to ANAME1
  124.            Store F to NOGOOD
  125.          else
  126.           If !(INSSSC)<>'Q'
  127.            Store 'SPAC='+INSSSC to INS
  128.            Find &INS
  129.            If #=0
  130.             Accept 'Special Activity code not found. Enter again ' to INSSSC
  131.            else
  132.             Store F to NOGOOD
  133.             Store INSSSC to ANAME1
  134.             Store trim($(spact,10,20)) to actvname
  135.            endif
  136.           endif
  137.          endif
  138.         enddo
  139.         Store F to BRTHDAYS
  140.         Select primary
  141.       If !(INSSSC)<>'Q'
  142.         If MSEL='4'
  143.           Store actvname+',   New People in ' to actvname
  144.           Store "$(membstatus,2,1)='*' .or. $(dates,1,4)<>inmo) " to BNAME
  145.         else
  146.           if MSEL='5'
  147.           Store actvname+',   Address / Phone Changes in ' to actvname
  148.           Store "$(membstatus,2,1)='*' .or. $(dates,6,4)<>inmo) " to BNAME
  149.         else
  150.           if MSEL='6'
  151.           Store T to BRTHDAYS
  152.           Store actvname+',   Birthdays in ' to actvname
  153.           Store "$(membstatus,2,1)='*' .or. $(birthdate,1,2)<>inbmo)" to BNAME
  154.           endif
  155.           endif
  156.         endif
  157.         Do MSPMINAC.CMD
  158.        endif
  159.       endif
  160.     CASE MSEL = '7'
  161. Accept 'Does the MACTIVTY file have the latest MEMBERS file changes? ' to XX
  162.       If !(XX)<>'Q'
  163.       If !(XX)<>'Y'
  164.         Do MGSAROST.CMD
  165.       endif
  166.       Store d+':MACTIVTY index '+d+':MACTIVTY' to SPFILE
  167.       If .not. file(SPFILE)
  168.         ? 'File ',SPFILE,' does not exist on "',d,'" disk.'
  169.       else
  170.       Accept 'Enter Special Activity code ' to ANAME1
  171.       If !(ANAME1)<>'Q'
  172.         Store '$(SP:ACTIVTY,1,3)' to ANAME
  173.         Store "$(membstatus,2,1)='*'" to BNAME
  174.         Do MSPFMAIL.CMD
  175.       endif
  176.       endif
  177.       endif
  178.     CASE !(MSEL) = 'Q'
  179.       Store F to LEVEL2
  180.       Store T to validd
  181.     ENDCASE
  182.   enddo
  183.   If !(MSEL)<>'Q'
  184.     Accept 'Report is complete. Press <retn> ' to MSEL
  185.     Set format to screen
  186.   endif
  187. enddo
  188. RETURNdary
  189.       USE MDIRFILE index MDIRFILE
  190.       STORE T TO MORNAMES
  191.       Store ' ' to CNAME
  192.       Do while MO