home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MUPADD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
5KB
|
175 lines
* Program MUPADD - Allows adding a record to MEMBERS file, checking validity.
Store ' ' to INHH
Do while !(INHH)<>'Q'
Erase
@ 2,10 say 'Adding a new person to MEMBERS file.'
@ 4,0 say "Enter person's place in family: "
@ 5,3 say '[H]ead-of-household, [M]ember-of-family, [S]ingle person, '
@ 6,3 say 'followed by sex designator - 1=Man, 2=Woman, 3=Boy, 4=Girl'
@ 7,3 say 'Examples: h1 = Man, head-of-household '
@ 8,3 say ' m4 = Girl, member of preceeding family'
Accept 'Enter 2-character code ' to INHH
Store F to VALID1
Store T to invalcc
Do while invalcc
Store !($(INHH,1,1)) to INHHC
If INHHC = 'Q'
Store F to invalcc
Return
else
If len(INHH) = 2
Store val($(INHH,2,1)) to C2INHH
Store F to VALID1
If INHHC = 'H' .or. INHHC = 'M' .or. INHHC = 'S'
Store T to VALID1
endif
If C2INHH > 0 .and. C2INHH < 5
If Valid1
Store F to INVALCC
endif
endif
endif
If INVALCC
Accept 'Invalid entry. (2 characters, H/M/S 1/2/3/4) Please re-enter ' to INHH
endif
endif
enddo
Store !($(INHH,2,1)) to INH2
Store !($(INHH,1,1)) to INH1
Store ' ' to FCODE9
If INH1='H' .or. (INH1='M' .and. INH2='2')
Store 'M' to FCODE9
endif
Store 'N' to XX
If INH1 = 'M' .and. len(lastname) > 1
Store T to MATCHING
Do while MATCHING
? LASTNAME,HOMEPHONE
Accept ' FIRST NAME ' to firstname
Accept ' Ok? ' to XX
If !(XX) = 'Y' .or. !(XX) = 'Q' .or. xx=' '
Store F to MATCHING
endif
enddo
endif
If !($(XX,1,1)) = 'N'
Store T to MATCHING
Do while MATCHING
Store ' ' to lastname
Store ' ' to firstname
Store ' ' to homephone
Accept ' LAST NAME ' to lastname
Accept ' FIRST NAME ' to firstname
Accept ' HOME PHONE ' to homephone
Accept ' Ok? ' to XX
If !($(XX,1,1)) = 'Q' .or. !($(XX,1,1)) = 'Y' .or. xx=' '
Store F to MATCHING
endif
enddo
endif
If !($(XX,1,1)) <> 'Q'
Store F to MATCH
Store T to MATCHING
Find &lastname
If # = 0
Store F to MATCHING
else
Do while MATCHING .and. last:name=lastname .and. .not. EOF
If first:name = firstname
If len(trim(homephone)) = 1 .or. home:phone = homephone
Store T to MATCH
Store F to MATCHING
endif
endif
If .not. MATCH
SKIP
endif
enddo
endif
If MATCH
Store T to INVALCC
Accept ' Duplicate name found. Do you want to edit it? [Y/N/D] ' to INNF
Do while INVALCC
Store F to invalcc
Do case
CASE !(INNF) = 'Q'
Store F to MATCHING
CASE !(INNF) = 'Y'
Store # to recnumb
Store 'A' to ESEL
Store 'y' to XSELECT
Do MUPEDIT.CMD
If INH1 = 'H'
Store Address to xaddress
Store CITY:STATE to xcityst
Store ZIP to XZIP
Store HOME:PHONE to homephone
Store LAST:NAME to lastname
Store FAMILYCODE to XFAMCODE
endif
CASE !(INNF) = 'N' .or. !(INNF) = 'D'
Store F to MATCHING
OTHERWISE
Accept 'Enter [Y/N/D] only ' to INNF
ENDCASE
enddo
endif
If .not. MATCH
If !(INH1) <> 'M' .or. len(xaddress)=1
* First determine the FAMILYCODE, if not family member
Store !($(lastname,1,3)) to lastcode
Store !($(firstname,1,1)) to firstcode
Store 0 to curfnum
Store $(lastname,1,3) to lastnam
Find &lastnam
If # = 0
Store F to MATCHING
else
Store F to LOCATING
Store T to MATCHING
Do while MATCHING .and. .not. EOF
If FAMILYCODE=lastcode
If $(FAMILYCODE,4,1) = firstcode .and. val($(familycode,5,3)) > curfnum
Store val($(familycode,5,3)) to curfnum
endif
else
Store F to MATCHING
endif
SKIp
enddo
endif
STORE CURFNUM+1 TO CURFNUM
If curfnum > 999
Store !($(lastcode,1,1))+'... '+$(lastcode,2,2)+'... '+firstcode+'...' to FC
? 'Family code values have run out for ',FC
? 'Operator must perform family-code re-numbering for this code only.'
Accept 'Press <retn> for next update.' to XX
RETURN
endif
endif
Do MUPADD1.CMD
endif
endif
enddo
RETURN
queries in starting this report.
The report uses the SP:ACTIVTY field for the variable item in the
report.
3) [OL]: One-line report, by offering envelope number MEMBERS /OFFERNDX
This report is good for keeping track of your assigned envelope
numbers. It shows each number in order, then the name of the
person(s) that have that envelope set. Unassigned numbers are
printed with the space left blank after them. You can ore val($(INHH,2,1)) to C2INHH
Store F to VALID1
If INHHC = 'H' .or. INHHC = 'M' .or. INHHC = 'S'
Store T to VALID1
endif
If C2INHH > 0 .and. C2INHH < 5
If Valid1
Store F to INVALCC
endif
endif
endif
If INVALCC
Accept 'Invalid entry. (2 characters, H/M/S 1/