home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MSPFILES.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
9KB
|
280 lines
* Program MSPFILES- Performs special functions on MEMBERS or related files.
Store T to LEVEL3
Do while LEVEL3
Erase
@ 1,1 say chname
@ 1,62 say curdate
@ 2,1 say 'DATA DISK = '+D
@ 3,20 say ' Special File Creation, Reports '
@ 3,66 SAY '6-/MSPFILES/'
@ 5,10 say '1) Display people from a selected file, group'
@ 6,10 say '2) Print Full-Information Report of a selected file, group [FI]'
@ 7,10 say '3) Print One-Line Report of a selected file, group [OL]'
@ 8,10 say '4) Print Mailing Labels of a selected file, group [ML]'
@ 9,10 say '5) Create a new Special File from selected file, criteria'
@ 10,10 say '6) Generate FCMEMBRS file (families), with index'
@ 11,10 say '7) Generate MSCROST file (Small Churches), with index'
@ 12,10 say '8) Generate MACTIVTY file (Special Activities), with index'
@ 13,10 say '9) Generate MSKILLS file (Interests/Abilities), with index'
@ 14,10 SAY 'A) Generate SCMEMBRS index file to MEMBERS file.'
@ 15,10 say 'B) Generate OFFERNDX index file to MEMBERS file.'
?
Accept ' Enter selection ' to FSEL
?
Store F to valid1
Do while .not. valid1
Store T to valid1
Do CASE
CASE FSEL = '6'
Do MGFCROST.CMD
Store F to SFMORE
CASE FSEL = '7'
Do MGSCROST.CMD
Store F to SFMORE
CASE FSEL = '8'
Do MGSAROST.CMD
Store F to SFMORE
CASE FSEL = '9'
Do MGIAROST.CMD
Store F to SFMORE
CASE !(FSEL)='A'
Store F to SFMORE
Store d+':MEMBERS' to mfile
STORE D+':SCMEMBRS' TO MFILENDX
IF FILE(MFILENDX)
? 'Now deleting old SCMEMBRS file index.'
DELETE file &MFILENDX
endif
USE &MFILE
? 'Now indexing MEMBERS file by SS:SC:MEMB, creating file index SCMEMBRS.'
Set talk on
Index on ss:sc:memb+last:name+first:name to &MFILENDX
Set talk off
Accept 'Indexing is complete. Press <RETURN> ' to XX
CASE !(FSEL)='B'
Store F to SFMORE
Store d+':MEMBERS' to MFILE
Store d+':OFFERNDX.NDX' to MFILENDX
If file(MFILENDX)
? 'Now deleting old OFFERNDX file index.'
DELETE file &MFILENDX
endif
Use &MFILE
? 'Now indexing MEMBERS file by OFFERINGEN, creating file index OFFERNDX.'
Set talk on
Index on offeringen to &MFILENDX
SET TALK off
Accept 'Indexing is complete. Press <RETURN> ' to XX
CASE FSEL='1' .or. FSEL='2' .or. FSEL='3' .or. FSEL='4' .or. FSEL='5'
Store T to SFMORE
CASE !(FSEL)='Q'
RETURN
OTHERWISE
Accept 'Invalid entry. Please enter again ' to FSEL
ENDCASE
ENDDO
If SFMORE
Store 'ANAME1' to ANAME
Store 'ALL' to ANAME1
Store "$(MEMBSTATUS,2,1)='*'" to BNAME
? ' Select Input File -'
? ' 1. Full-Church [MEMBERS]'
? ' 2. Full-Church, Families [FCMEMBRS--FCMEMBRS]'
? ' 3. Small Church - children, singles [MSCROST]'
? ' 4. Small Church - marrieds [FCMEMBRS--FCRSCNDX]'
? ' 5. Special Activities [MACTIVTY]'
? ' 6. Interests / Abilities [MSKILLS]'
? ' 7. Special File [-- ? --]'
?
Accept 'Enter selection ' to XSEL
Store F to valid1
Do while .not. valid1
Store T to valid1
Do CASE
CASE XSEL='1'
Store d+':MEMBERS index '+d+':MEMBERS' to INFILE
If .not. file(INFILE)
Accept 'MEMBERS file is missing. Press <retn> to exit.' to XX
RETURN
endif
CASE XSEL='2' .or. XSEL='4'
Store 0 to offeringen
Store ' ' to sp:activty
Store ' ' to ss:sc:memb
Store ' ' to skills
Store ' ' to teach:sssc
Store ' ' to other
Store ' ' to comments
Store d+':FCMEMBRS' to infile
If XSEL='2'
Store d+':FCMEMBRS.NDX' to OUTFILE
else
Store d+':FCRSCNDX.NDX' to OUTFILE
Store 'ss:sc:memb' to ANAME
endif
If (.not. file(INFILE)) .or. (.not. file(OUTFILE))
? 'File',INFILE,'must be created.'
Do MGFCROST.CMD
endif
Store infile+' index '+outfile to infile
Use &INFILE
CASE XSEL='3'
Store d+':MSCROST index '+d+':MSCROST' to INFILE
If .not. file(INFILE)
? 'File',INFILE,'must be created.'
Do MGSCROST.CMD
endif
Use &INFILE
Store 'SS:SC:MEMB' to ANAME
CASE XSEL='5'
Store d+':MACTIVTY index '+d+':MACTIVTY' to INFILE
If .not. file(INFILE)
? 'File',infile,'must be created.'
Do MGSAROST.CMD
endif
USE &INFILE
Store 'SP:ACTIVTY' to ANAME
CASE XSEL='6'
Store d+':MSKILLS index '+d+':MSKILLS' to INFILE
If .not. file(INFILE)
? 'File',INFILE,'must be created.'
Do MGSAROST.CMD
endif
Use &INFILE
Store 'SKILLS' to ANAME
CASE XSEL='7'
Accept 'Enter desired source file name ' to XX
Store d+':&XX' to INFILE
Do while .not. file(INFILE) .and. SFMORE
If !(XX)='Q'
Store F to SFMORE
else
Accept 'This file does not exist on the data disk. Enter again ' to XX
Store d+':&XX' to INFILE
endif
enddo
CASE !(XSEL)='Q'
Store F to SFMORE
OTHERWISE
Accept 'Invalid entry. Please enter again ' to XSEL
Store F to valid1
ENDCASE
If .not. file(INFILE) .and. SFMORE
? 'Source file',INFILE,'not found.'
Store F to valid1
endif
ENDDO
If SFMORE
If FSEL='5'
Accept 'Enter your new Special File name ' to OUTFILE
If !(OUTFILE)='Q'
Store F to SFMORE
else
Store d+':&OUTFILE' to OUTFILE
Store 'Y' to XX
If file(OUTFILE)
? ' File',OUTFILE,'already exists.'
Accept ' Do you want it written over? ' to XX
endif
If !(XX)='Y'
Accept 'Enter selection criteria ' to SELCRI
USE &INFILE
? 'Now copying selected records from',INFILE,'to',OUTFILE
Set talk on
Copy to &OUTFILE for &SELCRI
Set talk off
Use &outfile
USE
endif
Store F to SFMORE
endif
else
If XSEL='3' .or. XSEL='4' .or. XSEL='5' .or. XSEL='6'
USE &INFILE
Accept 'Enter group code (press <retn> for "all") ' to YSEL
Store F to valid2
Do while .not. valid2
Store T to valid2
If YSEL<>' '
If !(YSEL)='Q'
Store F to valid2
Store F to SFMORE
else
Find &YSEL
If #=0
Accept 'Group code not found. Please enter again ' to YSEL
Store F to valid2
else
Store YSEL to ANAME1
endif
endif
endif
enddo
endif
If SFMORE
Accept 'Enter selection criteria ' to SELCRI
If SELCRI=' '
Store '*' to BNAME
else
Store '.not. ('+SELCRI+')' to BNAME
endif
Store 'Sm. Church' to fcolhdr
Store 'ss:sc:memb' to FCOLUMN
Do CASE
CASE FSEL='1'
Use &INFILE
?
? 'Report for ',INFILE,' file, with selection criteria: ',SELCRI
Store T to beginng
Store ' ' to spaces
Do while &ANAME=ANAME1 .and. .not. EOF
If .not. beginng
Store trim(first:name)+' '+trim(last:name) to names
If len(names) > 17
Store $(names,1,18) to names
else
Store 18-len(names) to lenn
Store names+$(spaces,1,lenn) to names
endif
Store $(membstatus,1,2)+$(sp:activty,1,8) to xfields
? $(ss:sc:memb,1,3),xfields,names,home:phone,address,$(city:state,1,8)
SKIP
endif
Store F to beginng
Do while .not. EOF .and (* .or. &BNAME)
SKIP
enddo
enddo
CASE FSEL='2'
Accept 'Enter first line title ' to CNAME
Store INFILE to MFILE
Do FCREPT1.CMD
CASE FSEL='3'
Accept 'Enter first line title ' to ACTVNAME
If ANAME1='ALL'
Use &INFILE
endif
Do MONELINE.CMD
CASE FSEL='4'
Store INFILE to SPFILE
Do MSPFMAIL.CMD
ENDCASE
endif
endif
endif
Accept 'Special file operation is complete. Press <retn> ' to XX
ENDDO
Use
RETURN.CMD
endif
Use &INFILE
Store 'SS:SC:MEMB' to ANAME
CASE XSEL='5'
Store d+':MACTIVTY index '+d+':MACTIVTY' to INFILE
If .not. file(INFILE)
? 'File',infile,'must be created.'
Do MGSAROST.CMD
endif
USE &INFILE
Store 'SP:ACTIVTY' to ANAME
CAS