home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
SAREPORT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
6KB
|
192 lines
* Program SAREPORT - Prints various reports of members, by Special Activity
Store T to LEVEL2
Do while LEVEL2
Erase
@ 1,1 say chname
@ 1,62 say curdate
@ 2,1 say 'DATA DISK = '+D
@ 3,20 say ' Special Activity Reports 4-/SAREPORT/'
@ 5,10 say '0) One-line display'
@ 6,10 say '1) Print standard report of a specified SPECIAL-ACTIVITY [OL]'
@ 7,10 say '2) Print two-line report of a SPECIAL-ACTIVITY, with OTHER [TL]'
@ 8,10 say '3) Print 2-column roster of selected SPECIAL-ACTIVITY [2C]'
@ 9,10 say '4) Print a new-people list from this month [CL]'
@ 10,10 say '5) Print a new-changes list from this month [CL]'
@ 11,10 say '6) Print a list of birthdays from this month [CL]'
@ 12,10 say '7) Mailing labels [ML]'
?
Accept ' Enter selection ' to MSEL
?
Do while @(MSEL,'01234567Qq')=0
Accept 'Invalid entry. Please enter again ' to MSEL
enddo
Store T to validd
Do CASE
CASE MSEL = '0' .or. MSEL = '1' .OR. MSEL = '2' .or. MSEL='3'
Accept 'Does the MACTIVTY file have the latest updates from MEMBERS? ' to XY
If !(XY)<>'Y'
Do MGSAROST.CMD
endif
Store d+':MACTIVTY index '+d+':MACTIVTY' to MFILE
If .not. file(MFILE)
? 'File ',MFILE,' does not exist on "',d,'" disk.'
else
Select secondary
USE MDIRFILE index MDIRFILE
STORE T TO MORNAMES
Store ' ' to CNAME
Do while MORNAMES
Accept 'Enter Special Activity code ' to ANAME1
If !(ANAME1)='Q'
Store F to MORNAMES
Store 'Q' to CNAME
else
Store 'SPAC='+ANAME1 to infind
Find &infind
If #=0
? 'Special Activity code not found in MDIRFILE'
else
Store F to mornames
Store trim($(SPACT,10,20)) to CNAME
Store "$(sp:activty,1,3)" to ANAME
Store "$(MEMBSTATUS,2,1)='*'" to BNAME
endif
endif
ENDDO
Select primary
If CNAME<>'Q'
USE &MFILE
If MSEL='1'
Store CNAME to actvname
Store ' ' to fcolhdr
Store 'fcolhdr' to fcolumn
DO MONELINE.CMD
ELSE
If MSEL='2'
Store '$(birthdate,1,8)' to fcolumn
Store 'Birthday' to fcolhdr
Store 'ACTIV: ' to othheadr
Store '$(sp:activty,1,8)' to othnam1
Do MTWOLINE.CMD
else
If MSEL='3'
Do M2COLROS.CMD
else
Accept 'Enter selection criteria (<retn> = all)' to xsel
Select primary
Find &ANAME1
If xsel=' '
Store 'LEVEL2' to xsel
endif
?
? ' ',cname,'Membership Report ',curdate
?
Store T to beginng
Do while sp:activty=ANAME1 .and. .not. EOF
If .not. Beginng
Store trim(first:name)+' '+trim(last:name)+' ' to xx
Store $(xx,1,20) to xx
? $(ss:sc:memb,1,3),xx,home:phone,address,$(city:state,1,17)
SKIP
endif
Store F to beginng
Do while .not. (&XSEL).and..not.EOF
SKIP
enddo
enddo
?
Accept 'End of report. Press <RETN> ' to xx
endif
endif
ENDIF
SELECT SECONDARY
USE
SELECT PRIMARY
endif
endif
CASE MSEL = '6' .or. MSEL='4' .or. MSEL='5'
Accept 'Does MACTIVTY file have the latest updates from MEMBERS? ' to XX
If !(XX)<>'Y'
Do MGSAROST.CMD
endif
Store d+':mactivty index '+d+':mactivty' to MFILE
If .not. file(MFILE)
? 'File ',MFILE,' does not exist.'
else
USE &MFILE
Accept 'Enter Special Activity code ' to INSSSC
Select secondary
Use MDIRFILE index MDIRFILE
Store T to NOGOOD
Do while NOGOOD
If !(INSSSC)='ALL'
Store 'ALL' to ANAME1
Store F to NOGOOD
else
If !(INSSSC)<>'Q'
Store 'SPAC='+INSSSC to INS
Find &INS
If #=0
Accept 'Special Activity code not found. Enter again ' to INSSSC
else
Store F to NOGOOD
Store INSSSC to ANAME1
Store trim($(spact,10,20)) to actvname
endif
endif
endif
enddo
Store F to BRTHDAYS
Select primary
If !(INSSSC)<>'Q'
If MSEL='4'
Store actvname+', New People in ' to actvname
Store "$(membstatus,2,1)='*' .or. $(dates,1,4)<>inmo) " to BNAME
else
if MSEL='5'
Store actvname+', Address / Phone Changes in ' to actvname
Store "$(membstatus,2,1)='*' .or. $(dates,6,4)<>inmo) " to BNAME
else
if MSEL='6'
Store T to BRTHDAYS
Store actvname+', Birthdays in ' to actvname
Store "$(membstatus,2,1)='*' .or. $(birthdate,1,2)<>inbmo)" to BNAME
endif
endif
endif
Do MSPMINAC.CMD
endif
endif
CASE MSEL = '7'
Accept 'Does the MACTIVTY file have the latest MEMBERS file changes? ' to XX
If !(XX)<>'Q'
If !(XX)<>'Y'
Do MGSAROST.CMD
endif
Store d+':MACTIVTY index '+d+':MACTIVTY' to SPFILE
If .not. file(SPFILE)
? 'File ',SPFILE,' does not exist on "',d,'" disk.'
else
Accept 'Enter Special Activity code ' to ANAME1
If !(ANAME1)<>'Q'
Store '$(SP:ACTIVTY,1,3)' to ANAME
Store "$(membstatus,2,1)='*'" to BNAME
Do MSPFMAIL.CMD
endif
endif
endif
CASE !(MSEL) = 'Q'
Store F to LEVEL2
Store T to validd
ENDCASE
enddo
If !(MSEL)<>'Q'
Accept 'Report is complete. Press <retn> ' to MSEL
Set format to screen
endif
enddo
RETURNdary
USE MDIRFILE index MDIRFILE
STORE T TO MORNAMES
Store ' ' to CNAME
Do while MO