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

  1. * Program SCREPORT - Prints various reports of members, by SS/SC
  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  'Small Church Reports                          3-/SCREPORT/'
  9. @ 5,10 say  '0)  One-line display'
  10. @ 6,10 say  '1)  Print two-line report of selected SC class with OTHER    [TL]'
  11. @ 7,10 say  '2)  Print briefer one-line report                            [OL]'
  12. @ 8,10 say  '3)  Print 2-column roster of selected SC class               [2C]'
  13. @ 9,10 say  '4)  Attendance Marking, Reports'
  14. @ 9,65 say  '/SCATTEND/'
  15. @ 10,10 say '5)  Print a new-people list from this month                  [CL]'
  16. @ 11,10 say '6)  Print a new-changes list from this month                 [CL]'
  17. @ 12,10 say '7)  Print a list of birthdays from this month                [CL]'
  18. @ 13,10 say '8)  Print people just made Small-Church-Inactive this month  [CL]'
  19. @ 14,10 say '9)  Mailing labels                                           [ML]'
  20. ?
  21. Accept '          Enter selection ' to MSEL
  22. ?
  23. Store T to invalidd
  24. Do while invalidd
  25.  Store F to invalidd
  26.  Do case
  27.   Case MSEL='0' .or. MSEL='1' .or. MSEL='2' .OR. MSEL='3'
  28.   Select secondary
  29.   USE MDIRFILE index MDIRFILE
  30.   Store T to MORNAMES
  31.   Store ' ' to XY
  32.   Do while MORNAMES
  33.    Accept 'Enter Small Church code ' to ANAME1
  34.    If !(ANAME1)='Q'
  35.     Store F to MORNAMES
  36.     Store 'Q' to XY
  37.     Store F to invalidd
  38.     USE
  39.    else
  40.     Store 'SSSC='+ANAME1 to infind
  41.     Find &infind
  42.     If #=0
  43.       ? 'Small Church code not found in MDIRFILE'
  44.     else
  45.       Store F to MORNAMES
  46.       Store trim($(spact,10,20)) to CNAME
  47.       Store cname to actvname
  48.     endif
  49.    endif
  50.   enddo
  51.   If XY<>'Q'
  52.     Store 'N' to XX
  53.     Store 'SS:SC:MEMB' to aname
  54.     If MSEL='3' .and. !(ANAME1)<>'ALL'
  55.       Accept "Is the Small Church for a married's class? " to XX
  56.       If !(XX) = 'Y'
  57. Accept 'Does the FCMEMBRS file have the latest updates from MEMBERS? ' to XY
  58.         If !(XY) <> "Y"
  59.           Do MGFCROST.CMD
  60.           Store 'Y' to XX
  61.         endif
  62.         Store d+':FCMEMBRS index '+d+':FCRSCNDX' to MFILE
  63.       endif
  64.     endif
  65.     If !(XX)<>'Y'
  66. Accept 'Does the MSCROST file have the latest updates from MEMBERS? ' to XY
  67.       If !(XY)='Q'
  68.         Store F to invalidd
  69.       else
  70.         If !(XY) <> 'Y'
  71.           Do MGSCROST.CMD
  72.         endif
  73.         Store d+':MSCROST index '+d+':MSCROST' to MFILE
  74.       endif
  75.      endif
  76.     endif
  77.     If !(XY)<>'Q'
  78.       Select primary
  79.       Store F to invalidd
  80.       Store "$(SS:SC:MEMB,5,1)='*'" to BNAME
  81.       Store '$(birthdate,1,8)' to fcolumn
  82.       Store 'Birthdate' to fcolhdr
  83.       Store 'ACTIV: ' to othheadr
  84.       Store '$(sp:activty,1,8)' to othnam1
  85.       IF FILE(MFILE)
  86.         USE &MFILE
  87.       else
  88.         ? 'File ',MFILE,' not found on the data disk.'
  89.         Accept 'Press <retn>' to XX
  90.         RETURN
  91.       endif
  92.       find &aname1
  93.       If   msel='1'
  94.         If len(MSEL) > 1
  95.           Store len(MSEL) to N
  96.           Store $(MSEL,2,1) to othf2
  97.           IF othf2='\'
  98.             Store fcolumn+"+'-'+graddate" to fcolumn
  99.           endif
  100.         endif
  101.         Do MTWOLINE.CMD
  102.       Else
  103.         IF MSEL='2'
  104.           DO MONELINE.CMD
  105.         else
  106.           If MSEL='3'
  107.             Do M2COLROS.CMD
  108.           else
  109.       Accept 'Enter selection criteria (<retn> = all)' to xsel
  110.       If xsel=' '
  111.         Store 'LEVEL2' to xsel
  112.       endif
  113.       ?
  114.       ? '     ',cname,'Membership Report      ',curdate
  115.       ?
  116.       Store T to beginng
  117.       Do while ss:sc:memb=ANAME1 .and. .not. EOF
  118.         If .not. Beginng
  119.     Store trim(first:name)+' '+trim(last:name)+'                    ' to xx
  120.           Store $(xx,1,20) to xx
  121.           ? $(sp:activty,1,8),xx,home:phone,address,$(city:state,1,12)
  122.           SKIP
  123.         endif
  124.         Store F to beginng
  125.         Do while .not. (&XSEL).and..not.EOF
  126.           SKIP
  127.         enddo
  128.       enddo
  129.       ?
  130.           endif
  131.         endif
  132.       endif
  133.     endif
  134.    CASE MSEL='4'
  135.      Do SCATTEND.CMD
  136.      Store T to LEVEL2
  137.    CASE MSEL = '5' .or. MSEL='6' .or. MSEL='7' .or. MSEL='8'
  138.     Accept 'Does the MSCROST file have the latest updates from MEMBERS? ' to XX
  139.       If !(XX)<>'Y'
  140.         Do MGSCROST.CMD
  141.       endif
  142.       Store d+':mscrost index '+d+':mscrost' to MFILE
  143.       If .not. file(MFILE)
  144.         ? 'File ',MFILE,' does not exist.'
  145.         Accept 'Press <RETURN>' to XX
  146.         RETURN
  147.       else
  148.         USE &MFILE
  149.         Accept 'Enter Small Church code ("ALL"=all) ' to INSSSC
  150.         Select secondary
  151.         Use MDIRFILE index MDIRFILE
  152.         Store T to NOGOOD
  153.         Do while NOGOOD
  154.          If !(INSSSC)='ALL'
  155.            Store 'ALL'  to ANAME1
  156.            Store F to NOGOOD
  157.          else
  158.           If !(INSSSC)<>'Q'
  159.            Store 'SSSC='+INSSSC to INS
  160.            Find &INS
  161.            If #=0
  162.             Accept 'Small Church code not found. Enter again ' to INSSSC
  163.            else
  164.             Store F to NOGOOD
  165.             Store INSSSC to ANAME1
  166.             Store trim($(spact,10,20)) to actvname
  167.            endif
  168.           endif
  169.          endif
  170.         enddo
  171.         Store F to BRTHDAYS
  172.         Select primary
  173.       If !(INSSSC)<>'Q'
  174.         If MSEL='8'
  175.           Store actvname+'  New People in ' to actvname
  176.           Store "$(ss:sc:memb,5,1)='*' ,.or $(dates,1,4)<>inmo " to BNAME
  177.         else
  178.         if MSEL='5'
  179.           Store actvname+'  Address / Phone Changes in ' to actvname
  180.           Store "$(ss:sc:memb,5,1)='*' .or. $(dates,6,4)<>inmo " to BNAME
  181.         else
  182.         if MSEL='6'
  183.           Store T to BRTHDAYS
  184.           Store actvname+'  Birthdays in ' to actvname
  185.           Store "$(ss:sc:memb,5,1)='*' .or. $(birthdate,1,2)<>inmo" to BNAME
  186.         else
  187.         if MSEL='7'
  188.           Store actvname+'  Just Made Inactive, as of ' to actvname
  189.           Store " $(dates,6,4)<>inmo" to BNAME
  190.           Store $(insssc,1,3)+' '+'*' to ANAME1
  191.           endif
  192.           endif
  193.          endif
  194.         endif
  195.         ? 'Now printing a Changes List.'
  196.         Do MSPMINAC.CMD
  197.        endif
  198.       endif
  199.       Release BRTHDAYS,NOGOOD,INS
  200.     CASE MSEL = '9'
  201.       Accept 'Is the MSCROST file up-to-date from MEMBERS file? ' to X1
  202.       If !(X1)<>'Q'
  203.       If !(X1)<>'Y'
  204.         Do MGSCROST.CMD
  205.       endif
  206.       Store d+':MSCROST index '+d+':MSCROST' to SPFILE
  207.       If .not. file(SPFILE)
  208.         ? 'File ',SPFILE,' does not exist on "',d,'" disk.'
  209.       else
  210.         Accept 'Enter the Small Church code ' to ANAME1
  211.         If !(ANAME1)<>'Q'
  212.           STORE 'SS:SC:MEMB' TO ANAME
  213.           Store "$(membstatus,2,1)='*'" to BNAME
  214.           Do mspfmail.cmd
  215.         endif
  216.       endif
  217.       endif
  218.       Release SPFILE
  219.     CASE !(MSEL) = 'Q'
  220.       RETURN
  221.     OTHERWISE
  222.       Accept 'Illegal selection. Please enter again ' to MSEL
  223.       Store T to invalidd
  224.   ENDCASE
  225. ENDDO
  226. Set format to screen
  227. Accept 'Report is complete. Press <retn> ' to XY
  228. enddo
  229. RETURN