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

  1. * Program SCATTD - Prints Attendance Check Lists for 1 or all S.S. classes
  2. ? 'Dates of the Sundays for next month are: ',CURDATES
  3. Accept 'Ok? ' to INS
  4. Store '_____ _____ _____ _____ _____' to UDATES
  5. Do while !(INS)<>'Y'
  6.   @ 18,0
  7.   @ 19,0
  8.   @ 20,0
  9.   @ 21,0
  10.   @ 22,0
  11.   @ 23,0
  12.   @ 24,0
  13.   @ 18,0 say '  Re-enter dates for Sundays of next month -'
  14.   @ 19,0 say '   '+UDATES
  15.   @ 20,2 GET CURDATES
  16.   READ
  17.   ?
  18.   Accept 'Ok? ' to INS
  19. ENDDO
  20. STORE TRIM(CURDATES) TO curdates
  21. If len(curdates) < 28
  22.   Store '      '+$(udates,1,23) to Udates
  23.   Store '      '+curdates to curdates
  24. endif
  25. Store '_________________________________________________' to ULINE
  26. Select primary
  27. Store d+':MSCROST' to mfile
  28. Use &MFILE index &MFILE
  29. Select secondary
  30. Store T to invalid
  31. Store ANAME1 to INS
  32. If INS ='ALL'
  33.     Store 'SSSC=' to titltype
  34.     Store ins to insssc
  35.     Find &titltype
  36. else
  37.     Store ins to insssc
  38.     Store 'SSSC='+INSSSC to titltype
  39.     Find &titltype
  40.     Store $(spact,6,4) to spactiv
  41.     SKIP
  42.     Store F to invalid
  43. endif
  44. If INS='ALL'
  45.   Do while $(spact,1,4)='SSSC' .and. .not. EOF
  46.     Store SPACTIV+$(SPACT,6,4) TO SPACTIV
  47.     SKIP
  48.   enddo
  49.   ? 'ALL SSSC = ',spactiv
  50. endif
  51. Store len(spactiv)/4 to ssscleng
  52. Store 0 to sssccntr
  53. Store '$(ss:sc:memb,1,3)' to bname
  54. Store ' Attendance Check List  --  '+curmonth+', 19'+$(date(),7,2) to fline
  55. Do while sssccntr<ssscleng
  56.   Select secondary
  57.   Store sssccntr*4+1 to SC1
  58.   Store $(spactiv,SC1,3) to INSSSC
  59.   Store 'SSSC='+INSSSC to titltype
  60.   Store INSSSC to bname1
  61.   Find &titltype
  62.   If #=0
  63.     Store 'No title for '+insssc+' in MDIRFILE' to schdr
  64.   else
  65.     Store trim($(spact,10,20))+fline to schdr
  66.   endif
  67.   Select primary
  68.   Set format to print
  69. * Program SSATTD1 - Prints 1 S.S. Attendance Check List
  70. Store 0 to PAGENUM
  71. Store 61 to currline
  72. Store INSSSC to SS:SC
  73. Store len(INSSSC) to scleng
  74. Store 0 to RECCOUNT
  75. Store T to BADSC
  76. Store T to BEGINNG
  77. Find &INSSSC
  78. If #=0
  79.   ? 'No match for Small Church code = ',INSSSC,' in MEMBERS file. '
  80. else
  81. Set format to print
  82. Store "$(SS:SC:MEMB,5,1)='*' .or. $(membstatus,2,1)='*'" to XSEL
  83. Do while .not. EOF .and. ss:sc:memb = INSSSC
  84.   If .not. BEGINNG
  85.    IF CURRLINE > 60
  86.     If pagenum<>0
  87.       EJECT
  88.     ENDIF
  89.     @ 1,12 SAY SCHDR
  90.     STORE PAGENUM+1 TO PAGENUM
  91.     IF PAGENUM=1
  92. @ 3,6 SAY "Please check the column under today's date and beside your name. "
  93. @ 3,71 say 'Also, '
  94. @ 4,6 say  'mark any recent change of address or phone number underneath your '
  95. @ 4,72 say 'name.'
  96. @ 5,6 say  'New people, please record your attendance on the last page.'
  97. @ 8,0 say CURDATES
  98.       Store 10 to currline
  99.     else
  100.       @ 2,70 say 'PAGE'+STR(pagenum,3)
  101.       @ 4,1 say curdates
  102.       Store 6 to currline
  103.     endif
  104.    endif
  105.     Store trim(last:name)+', '+trim(first:name) to pname
  106.     If len(pname)>24
  107.       Store $(pname,1,24) to pname
  108.     endif
  109.     If $(ss:sc:memb,4,1)=chr(31)
  110.       @ curline,29 say '"'
  111.     endif
  112.     @ currline,30 say pname
  113.     @ currline,55 say 'H: '+home:phone
  114.     If work:phone<>'         '
  115.       @ currline,68 say 'W: '+work:phone
  116.     endif
  117.     Store trim(address)+', '+trim(city:state)+'  '+zip to xaddress
  118.     If len(xaddress)>48
  119.       Store $(xaddress,1,48) to xaddress
  120.     endif
  121.     @ currline+1,0 say udates
  122.     @ currline+1,30 say xaddress
  123.     @ currline+3,30 say uline
  124.     Store currline+4 to currline
  125.     SKIP
  126.     Do while .not. EOF .and. (* .or. &XSEL)
  127.       SKIP
  128.     enddo
  129.   endif
  130.   Store F to BEGINNG
  131. enddo
  132. EJECT
  133. Set format to screen
  134. * End of SSATTD1 program
  135.   Store SSSCCNTR+1 to SSSCCNTR
  136. endif
  137. enddo
  138. Release udates,uline,invalid,insssc,titltype,spactiv,ssscleng,sssccntr,fline
  139. Release sc1,bname1,schdr,pagenum,currline,ss:sc,scleng,reccount,badsc,beginng
  140. Release xsel,pname,xaddress
  141. Accept 'Report is complete. Press <RETURN> ' to XX
  142. RETURN
  143.