home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
PCALLING.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
7KB
|
263 lines
* Program PCALLING -Searches ,prints names from 1 year old to calling month gap
* MGAP - number of months allowed between calls. (Entered by operator)
* MGAPP - Adjusted MGAP, running end-of-year CXMONTH - current month
* CXM - running month CXYEAR - current year CXYEARX - running year
* CYCALL - This year's oldest calling month, if found
Store T to LEVEL2
Erase
@ 2,30 say 'PASTORAL CALLING '+curdate
@ 4,0 say ;
'This routine assists in recording and reporting back information about your'
? 'past congregational calling. The first step is to establish a calling'
?? 'record.'
? 'Mark congregation MEMBER records with the date that you made a pastoral'
?? ' call'
? 'to them: with the computer date set to the date of some calls, go into the'
? 'MPROFILE-Update process and select "P" for Pastoral call. The program will'
?? 'ask'
? "for a name, then will record the system date into CALLING of that member's"
? "record. (Always mark only the head-of-household's record). After this has"
?? 'been'
? 'done for several months, you are ready to query your calling history. This'
? 'routine asks for the number of months that you allow between calls, then'
?? 'dis-'
? 'plays all names that have been called and have a last-called data farther'
?? 'back'
? 'than the number of months you allow between calls.'
?
? 'Now indexing the MEMBERS file by CALLING date.'
Store d+':MEMBERS' to MFILE
Store d+':MCALLING' to MFILEX
Use &MFILE
Set talk on
Index on calling+familycode to &MFILEX
Set talk off
Use &MFILE index &MFILEX
Store val($(indate,1,2)) to CXMONTH
Store val($(indate,3,2)) to CXYEAR
Do while LEVEL2
?
? ' Select one of the following functions.'
?
? ' 1) Display calls that are due'
? ' 2) Display a history of all calls'
? ' Q) Quit'
?
Accept ' Enter selection' to XSEL
Store T to invalid1
Do while invalid1
If !(XSEL)='Q'
USE
RETURN
endif
If XSEL<>'1' .and. XSEL<>'2'
Accept 'Invalid entry. Please enter again ' to XSEL
else
Store F to invalid1
endif
enddo
If XSEL='1'
Accept ' Enter length of calling period, in months ' to MGAPX
IF !(MGAPX)='Q'
Store '0' to XSEL
else
Store val(mgapx) to mgap
Do while mgap<1 .or. mgap>12
Accept 'Invalid calling period. Must be between 1 and 12. Enter again' to MGAPX
Store val(mgapx) to mgap
enddo
?
? ' Membership Calls-Due Report ',curdate
endif
else
?
? ' Membership Pastoral Calls Report ',curdate
Store '1' to mgapx
Store 1 to mgap
endif
If XSEL<>'0'
?
Store str(cxyear,2) to CXYEARX
Set exact off
Store ' ' to spaces
* Find a first call date within the past year.
* Start with the current year, save the oldest found record number.
Find &CXYEARX
Store str(#,4) to cycall
*Find the oldest call date last year within 12 months of current month.
Store str(cxyear-1,2) to cxyearx
Store cxmonth-1 to CXM
Store T to NOFIND
Do while CXM < 12 .and. NOFIND
Store CXM+1 to CXM
If cxm<10
Store cxyearx+'\0'+str(cxm,1) to CXDATE
else
Store cxyearx+'\'+str(cxm,2) to CXDATE
endif
Find &CXDATE
If #<>0
Store F to NOFIND
endif
enddo
* Go back to this year's find, if nothing in last year.
Store CXMONTH-MGAP+13 to MGAPP
If MGAPP>12
* This year
Store MGAPP-12 to MGAPN
else
Store 1 to MGAPN
endif
If #=0 .and. CYCALL<>' 0'
GOTO &CYCALL
endif
If #=0
? 'No members found with call dates within the last year. '
else
If XSEL='2'
Store 13 to MGAPP
endif
* First display all call-due dates from last year; falls thru, if none.
Do while calling=CXDATE .and. .not. EOF .and. #<>0 .and. CXM < mgapp
Store ' ' to XM
Store CXDATE to XX
If !($(membstatus,1,1))='Y'
Store '-' to XM
endif
Store trim(first:name)+' '+trim(last:name) to names
Store len(names) to ln
If ln>19
Store $(names,1,20) to names
else
Store names+$(spaces,1,20-ln) to names
endif
If $(familycode,9,1)='M'
Store '='+xm+names to names
else
Store ' '+xm+names to names
endif
Store trim(address)+', '+trim(city:state) to taddr
If len(taddr)>31
Store $(taddr,1,31) to taddr
endif
Store $(calling,4,3)+$(calling,1,2) to XX
? XX,' ',ss:sc:memb,home:phone,names,taddr
SKIP
Do while (calling<>cxdate .and. CXM < mgapp)
Store CXM+1 to CXM
If CXM<mgapp
If CXM<10
Store cxyearx+'\0'+str(cxm,1) to CXDATE
else
Store cxyearx+'\'+str(cxm,2) to CXDATE
endif
Find &CXDATE
endif
enddo
If cxdate<>XX
?
endif
enddo
Store 1 to CXM
Store MGAPN to mgapp
If XSEL='2'
Store CXMONTH to mgapp
endif
Store str(cxyear,2) to cxyearx
If CXM<10
Store cxyearx+'\0'+str(cxm,1) to cxdate
else
Store cxyearx+'\'+str(cxm,2) to cxdate
endif
If CYCALL<>' 0'
GOTO &CYCALL
endif
Do while calling=CXDATE .and. .not. EOF .and. #<>0 .and. CXM < mgapp
Store ' ' to XM
Store CXDATE to XX
If !($(membstatus,1,1))='Y'
Store '-' to XM
endif
Store trim(first:name)+' '+trim(last:name) to names
Store len(names) to ln
If ln>19
Store $(names,1,20) to names
else
Store names+$(spaces,1,20-ln) to names
endif
If $(familycode,9,1)='M'
Store '='+xm+names to names
else
Store ' '+xm+names to names
endif
Store trim(address)+', '+trim(city:state) to taddr
If len(taddr)>31
Store $(taddr,1,31) to taddr
endif
? $(calling,1,5),' ',ss:sc:memb,home:phone,names,taddr
SKIP
Do while (calling<>cxdate .and. CXM < mgapp);.and. #<>0
Store CXM+1 to CXM
If CXM<mgapp
Store cxyearx+'\'+str(cxm,2) to CXDATE
Find &CXDATE
endif
enddo
If CXDATE<> XX
?
endif
enddo
endif
?
Accept 'End of report. Press <RETURN>' to XX
endif
ERASE
@ 1,20 say 'PASTORAL CALLING'
?
enddo
USE
Delete file mcalling.ndx
RETURN
endif
ERASE
@ 1,20 say 'PASTORAL CALLING'
?
?
enddo
USE
Delete file mcalling.ndx
RETURN
Store 1 to CXM
Store MGAPN to mgapp
If XSEL='2'
Store $(spact,3,29) to MD3E
SKIP
Store $(spact,3,29) to MD3F
SKIP
Store $(spact,3,29) to MD3G
SKIP
STORE $(SPACT,3,29) TO MD3H
SKIP
STORE $(SPACT,3,29) TO MD3I
SKIP
STORE $(SPACT,3,29) TO MD3J
SKIP
STORE $(SPACT,3,29) TO MD3K
SKIP
STORE $(SPACT,3,29) TO MD3L
GOTO 18
Store $(spact,13,18) to MD8
SKIP
Store $(spact,28,2) to MD4
SKIP
STORE $(SPACT,28,2) TO MD5
SKIP
Store $(spact,28,2) to MD6
SKIP
Store $(spact,29,2) to MD7
SKIP
STORE $(SPACT,16,2) TO MD9
SKIP
STORE $(SPACT,26,3) TO