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

  1. * Program MGFCROST - Generates file FCMEMBRS for full-church rosters, mailings
  2. Store d+':MEMBERS' to M1FILE
  3. Use &M1FILE
  4. ? 'Now indexing MEMBERS file to produce an index by family code.'
  5. Store d+':MEMBFCR' to M2FILE
  6. Set talk on
  7. Index on familycode to &M2FILE
  8. Set talk off
  9. ? 'MEMBERS file indexing complete. Now generating FCMEMBRS file.'
  10. Select secondary
  11. Use FCMEMBRX
  12. Store d+':FCMEMBRS'  to MFILE
  13. Copy to &MFILE
  14. Use &MFILE
  15. Select primary
  16. Use &M1FILE index &M2FILE
  17. Do while (* .or. $(MEMBSTATUS,2,1) = '*') .and. .not. EOF
  18.   SKIP
  19. ENDDO
  20. Store $(familycode,1,7) to prevfam
  21. Store 0 to recc
  22. Store 0 to recnumb
  23. Store ' ' to xbirthd
  24. Do while .not. EOF
  25.   If recc=20
  26.     Store recnumb+20 to recnumb
  27.     ? recnumb,' RECORDS PROCESSED'
  28.     Store 0 to recc
  29.   endif
  30.   Store T to FAMHEAD
  31.   Do while $(familycode,1,7) = prevfam .and. .not. EOF
  32.     If FAMHEAD
  33.        Store trim(last:name) to lastname
  34.        Store trim(first:name) to fnames
  35.        Store F to FAMHEAD
  36.        Store '  ' to KIDS
  37.        Store trim(ADDRESS) to XADDR
  38.        Store trim(city:state)+'  ' to citystate
  39.        Store zip to xzip
  40.        STORE ZONE TO XZONE
  41.        STORE $(birthdate,1,8) to xbirthd
  42.        Store membstatus to xmemb
  43.        Store ss:sc:memb to xsssc
  44.        Store home:phone to xhphone
  45.        Store work:phone to xwphone
  46.        Store spec:dates to xspd
  47.        Store 0 to childcnt
  48.      else
  49.       If $(familycode,8,1) = '2'
  50.         Store fnames+' and '+trim(first:name) to fnames
  51.  *Save the woman's work phone is there is no man's
  52.         Store xbirthd+' '+$(birthdate,1,8) to xbirthd
  53.         If xwphone = '  ' .and. work:phone <> '  '
  54.           Store work:phone to xwphone
  55.         endif
  56.  * If either husband or wife are members, make them members together.
  57.         If $(membstatus,1,1) <> $(xmemb,1,1)
  58.           If $(membstatus,1,1) = 'Y'
  59.             Store membstatus to xmemb
  60.           endif
  61.         endif
  62.       else
  63.         Store kids+trim(first:name)+', ' to kids
  64.       endif
  65.     endif
  66.     Store $(familycode,8,1) to xfam
  67.     SKIP
  68.     Store F to active
  69.     Do while (* .or. $(membstatus,2,1) = '*') .and. .not. EOF
  70.       SKIP
  71.     enddo
  72.   ENDDO
  73.   Store recc+1 to recc
  74.   Select secondary
  75.   Append blank
  76.   replace familycode with prevfam
  77.   replace last:name with lastname
  78.   replace first:name with fnames
  79.   replace home:phone with xhphone
  80.   replace work:phone with xwphone
  81.   If XFAM = '3' .or. XFAM = '4'
  82.     Store len(kids) to lenkids
  83.     Store $(kids,1,lenkids-2) to kids
  84.   endif
  85.   replace children with kids
  86.   replace address with xaddr
  87.   replace city:state with citystate
  88.   replace zip with xzip
  89.   replace zone with xzone
  90.   replace spec:dates with xspd
  91.   replace membstatus with XMEMB
  92.   replace ss:sc:memb with xsssc
  93.   replace birthdate with xbirthd
  94.   Select primary
  95.   Store $(familycode,1,7) to prevfam
  96.   Store '  ' to xwphone
  97. enddo
  98. Select secondary
  99. USE
  100. Store recnumb+recc to recnumb
  101. ? recnumb,' RECORDS PROCESSED'
  102. Select primary
  103. USE &MFILE
  104. Set talk on
  105. ? 'Now indexing FCMEMBRS file by last-name, first-name, creating FCMEMBRS.NDX'
  106. Index on last:name+first:name to &MFILE
  107. Set talk off
  108. ? 'FCMEMBRS index is complete.'
  109. ? 'Now indexing FCMEMBRS by SS:SC:MEMB, then last/first names,--> FCRSCNDX.NDX'
  110. USE &MFILE
  111. Store d+':fcrscndx' to M3FILE
  112. Set talk on
  113. Index on SS:SC:MEMB+last:name+first:name to &M3FILE
  114. Set talk off
  115. USE
  116. ? 'FCRSCNDX index is complete. Full Church file FCMEMBRS is now created.'
  117. RELEASE prevfam,lastname,fnames,xhphone,xwphone,famhead,xsssc,xbirthd,kids,;
  118. xaddr,citystate,xzip,xmemb,xfam,lenkids,recc,recnumb,M2FILE,M3FILE,childcnt,;
  119. active,M1FILE
  120. RETURN
  121. tore d+':MEMBERS' to M1FILE
  122. Use &M1FILE
  123. ? 'Now indexing MEMBERS file to produce an index by family code.'
  124. Store d+':MEMBFCR' to M2FILE
  125. Set talk on
  126. Index on familycode to &M2FILE
  127. Set talk off
  128. ? 'MEMBERS file indexing complete. Now generating FCMEMBRS file.'
  129. Select secondary
  130. Use FCMEMBRX
  131. Store d+':FCMEMBRS'  to MFILE
  132. Copy to &MFILE
  133. Use &MFILE
  134. Select primary
  135. Use &M1FILE index &M2FILE
  136. Do while (* .or. $(MEMBSTATUS,2,