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

  1. * Program MGIAROST - Generates MSKILLS file of people's Interests/Abilities
  2. *  OUTPUT:  [MSKILLS index MSKILLS] - has DELETED's in it
  3. Erase
  4. Set intensity off
  5. Set talk off
  6. @ 2,10 say 'Interests/Abilities file generation process'
  7. ?
  8. ? 'This program prints out data errors when found, so ready the printer.'
  9. @ 5,0 say  'Now scanning the MDIRFILE for SKILLS names.'
  10. Select primary
  11. USE MDIRFILE index MDIRFILE
  12. Store 'SKLS=' to spac
  13. Find &SPAC
  14. If # = 0
  15.   Accept 'No SKILLS in MDIRFILE. Press <retn> ' to XX
  16. else
  17. Select secondary
  18. USE MDIRFILX
  19. Copy structure to SPACFILE
  20. Use SPACFILE
  21. Select primary
  22. Store 1 to actcount
  23. Store ' ' to actlist
  24. Store 'SKILLS found are: ' to actlname
  25. Do while $(spact,1,4) = 'SKLS'
  26.   Select secondary
  27.   Append blank
  28.   replace SPACT with $(P.SPACT,6,4)
  29.   If actcount<85
  30.     Store actlist+$(spact,1,4) to actlist
  31.     Store actcount+1 to actcount
  32.   else
  33.     ? actlname,actlist
  34.     Store ' '+$(spact,1,4) to actlist
  35.   endif
  36.   Select primary
  37.   SKIP
  38. enddo
  39. Select secondary
  40. USE SPACFILE
  41. Index on SPACT to SPACFILE
  42. USE SPACFILE index SPACFILE
  43. ? actlname,actlist
  44. ? 'Now copying MEMBERS that have SKILLS to MSKILLS file.'
  45. Select primary
  46. Store d+':members' to MFILE
  47. USE &MFILE
  48. Store d+':MSKILLS' to M1FILE
  49. Set talk on
  50. COPY to &M1FILE for $(SKILLS,1,3) <> '   ' .and. $(membstatus,2,1) <> '*'
  51. Set talk off
  52. USE &M1FILE
  53. GOTO bottom
  54. Append blank
  55. Delete
  56. Store # to lastrec
  57. GOTO top
  58. Store 1 to reccount
  59. ? 'Now expanding MSKILLS file for multi-skills people.'
  60. Set format to print
  61. @ 1,10 say 'Interests/Abilities code errors in MEMBERS file  '+curdate
  62. Store 3 to curline
  63. Store 0 to recnum
  64. Store 0 to recc
  65. Do while # < lastrec
  66.     Store skills to skill
  67.     Store # to currec
  68.     Store 1 to fieldcnt
  69.     Do while fieldcnt < 31
  70.       Store $(skill,fieldcnt,2) to spactiv
  71.       If spactiv='  '
  72.         Store 31 to fieldcnt
  73.       else
  74.         Select secondary
  75.         Find &spactiv
  76.         If # = 0
  77.          Select primary
  78.          Store $(skill,fieldcnt,31-fieldcnt) to badspact
  79.          If fieldcnt=1
  80.            Delete
  81.          endif
  82.          Store 32 to fieldcnt
  83.         else
  84.          Select primary
  85.          Store $(SKILL,fieldcnt,2)+'.' to spactiv
  86.          If $(SKILL,fieldcnt+2,1)='"'
  87.            Store $(spactiv,1,2)+'"' to spactiv
  88.          endif
  89.          If fieldcnt>1
  90.          Store last:name to xlast
  91.          Store first:name to xfirst
  92.          Store membstatus to xmemb
  93.          Store home:phone to xhph
  94.          Store work:phone to xwph
  95.          Store address to xaddr
  96.          Store city:state to xcityst
  97.          Store zip to xzip
  98.          Store birthdate to xbirth
  99.          Store ss:sc:memb to xsssc
  100.          Store sp:activty to xspactiv
  101.          Store other to xother
  102.          Store dates to xdates
  103.          Append blank
  104.          Replace last:name with xlast
  105.          Replace first:name with xfirst
  106.          Replace membstatus with xmemb
  107.          Replace home:phone with xhph
  108.          Replace work:phone with xwph
  109.          Replace address with xaddr
  110.          Replace city:state with xcityst
  111.          Replace zip with xzip
  112.          Replace birthdate with xbirth
  113.          Replace ss:sc:memb with xsssc
  114.          Replace skills with spactiv
  115.          Replace other with xother
  116.          Replace sp:activty with xspactiv
  117.          Replace dates with xdates
  118.          GOTO currec
  119.          else
  120.            Replace skills with spactiv
  121.          endif
  122.         Store fieldcnt+3 to fieldcnt
  123.         endif
  124.       endif
  125.     enddo
  126.   If fieldcnt = 32
  127.     @ curline,1 say ss:sc:memb+last:name+first:name+home:phone+address+badspact
  128.     If *
  129.       Replace  SKILLS with '~~~'
  130.     endif
  131.     Store curline+1 to curline
  132.     If curline > 63
  133.       EJECT
  134.       Store 1 to curline
  135.     endif
  136.   endif
  137.   SKIP
  138.   Store recc+1 to recc
  139.   If recc = 10
  140.     Store 0 to recc
  141.     Store recnum+10 to recnum
  142.     Set format to screen
  143.     ? recnum,' records processed.'
  144.     Set format to print
  145.   endif
  146. enddo
  147. EJECT
  148. Set format to screen
  149. USE &M1FILE
  150. ? 'Expansion is complete. Now indexing MSKILLS file by SKILLS name.'
  151. Set talk on
  152. Index on skills+last:name+first:name to &M1FILE
  153. Set talk off
  154. USE
  155. ? 'MSKILLS file is complete.'
  156. Release spac,actcount,actlist,reccount,xlast,xfirst,xmemb,xhph,xwph,xaddr,xzip
  157. Release xcityst,xbirth,xsssc,spactiv,xspactiv,xother,xdates,curline,actlname
  158. Release skill
  159. Set console off
  160. Delete file('spacfile.dbf')
  161. Delete file('spacfile.ndx')
  162. Set console on
  163. endif
  164. RETURN
  165. ' to spac
  166. Find &SPAC
  167. If # = 0
  168.   Accept 'No SKILLS in MDIRFILE. Press <retn> ' to X÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷