home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MCNAMES.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
7KB
|
237 lines
* Program MCNAMES - Enables operator to change items in the Names Directory
Select primary
Use MDIRFILE index MDIRFILE
Store T to LEVEL2
Do while LEVEL2
Erase
@ 1,20 say 'Names Directory File Maintenance 8-5-/MCNAMES/'
@ 3,10 say 'This section allows adding and deleting codes and their'
@ 4,10 say 'corresponding names to the Names Directory file.'
@ 6,10 say '1) Display / Print the current Names Directory (MDIRFILE)'
@ 7,10 say '2) Add a Small Church name'
@ 8,10 say '3) Delete an existing Small Church name'
@ 9,10 say '4) Add a SP:ACTIVTY name'
@ 10,10 say '5) Delete an existing SP:ACTIVTY name'
@ 11,10 say '6T) Add an OTHER category, with new title'
@ 12,10 say '6) Add an OTHER name to an existing category'
@ 13,10 say '7) Delete an existing OTHER name/category'
@ 14,10 say '8) Add an INTEREST/ABILITY code'
@ 15,10 say '9) Delete an existing INTEREST/ABILITY code'
@ 16,10 say 'P) Purge inactive names out of the Names Directory file.'
@ 17,10 say 'Q) QUIT'
?
Accept ' Enter selection ' to MSEL
?
Store F to validd
Do while .NOT. validd
Store T to VALIDD
Do CASE
CASE MSEL = '2'
Do MCNAMES1.CMD
CASE MSEL = '4'
Store T to invalid
Store 'SPAC=' to acttype
Do while invalid
Store F to invalid
Accept 'Enter SPAC code to be added (example: ACH for Adult Choir) ' to FSEL
If !(FSEL) <> 'Q'
Store acttype+$(FSEL,1,3) to FSEL
Find &FSEL
If # <> 0
? 'Duplicate SP:ACTIVTY code found - ",spact,'". Not entered.'
Store T to invalid
else
APPEND BLANK
Accept 'Enter name for the above code (example: Adult Choir) ' to XNAME
Store FSEL+' '+$(XNAME,1,20) to XNAME
Replace spact with XNAME
? spact,'- ADDED'
endif
endif
ENDDO
CASE !(MSEL) = '6T'
Store T to invalid
Do while invalid
Store F to invalid
Accept 'Enter a new OTHER category code (example: SCH=school) ' to XSEL
If !(XSEL) <> 'Q'
Store $(XSEL,1,3)+': ' to XSEL
Find &XSEL
If # = 0
APPEND BLANK
Accept 'Enter OTHER category name, up to 20 characters ' to XNAME
Store XSEL+XNAME to XNAME
Replace SPACT with XNAME
? SPACT,'- ADDED'
else
Accept 'Duplicate OTHER category found. Enter again ' to XSEL
Store T to invalid
endif
endif
ENDDO
CASE MSEL = '6'
Do MCNAMES2.CMD
CASE MSEL = '8'
Store ' ' to IC
Store 'SKLS=' to acttype
Do while !(IC)<>'Q'
Store T to invalid
Do while invalid
Store F to invalid
Accept 'Enter a 2-character SKILLS code (example: SS for Sound System) ' to IC
If !(IC) <> 'Q'
Store acttype+$(IC,1,2) to IC
Find &IC
If # <> 0
? 'Duplicate SKILLS code found - "',spact,'" Not entered.'
Store T to invalid
else
APPEND BLANK
Accept 'Enter name for the above code (example: Sound System) ' to XNAME
Store IC+' '+$(XNAME,1,20) to XNAME
Replace spact with XNAME
? spact,' - ADDED'
endif
endif
ENDDO
ENDDO
CASE MSEL = '3'
Accept 'Enter a Small Church code to be deleted ' to FSEL
Store T to invalid
Do while invalid
Store F to invalid
If !(FSEL) <> 'Q'
Store 'SSSC='+$(FSEL,1,3) to FSEL
Find &FSEL
If # = 0
Accept 'No Small Church found by this code. Enter again ' to FSEL
Store T to invalid
else
? spact,'- DELETED '
Replace SPACT with '~ '
Delete
endif
endif
enddo
CASE MSEL = '5'
Accept 'Enter SP:ACTIVTY function code to be deleted ' to FSEL
Store T to invalid
Do while invalid
Store F to invalid
If !(FSEL) <> 'Q'
Store 'SPAC='+$(FSEL,1,3) to FSEL
Find &FSEL
If # = 0
Accept 'No SP:ACTIVTY code found by this name. Enter again ' to FSEL
else
? spact,'- DELETED'
Replace SPACT with '~ '
Delete
endif
endif
enddo
CASE MSEL = '7'
Store T to invalid
Do while invalid
Store F to invalid
? 'Enter OTHER category and designator to be deleted.'
Accept 'For example, SCH=032 is the SCHOOL category with code 032 ' to XSEL
If !(XSEL) <> 'Q'
Find &XSEL
If # = 0
? 'OTHER category, designator - "',XSEL,'" not located in Names Directory.'
? ' '
Store T to invalid
else
? spact,'- DELETED'
Replace spact with '~ '
Delete
endif
endif
enddo
CASE !(MSEL) = '9'
Store ' ' to FSEL
Do while !(FSEL)<>'Q'
Accept 'Enter SKILLS function code to be deleted ' to FSEL
Store T to invalid
Do while invalid
Store F to invalid
If !(FSEL) <> 'Q'
Store 'SKLS='+$(FSEL,1,3) to FSEL
Find &FSEL
If # = 0
Accept 'No SKILLS code found by this name. Enter again ' to FSEL
Store T to invalid
else
? spact,'- DELETED'
Replace SPACT with '~ '
Delete
endif
endif
enddo
ENDDO
CASE !(MSEL) = '1'
Accept 'Do you want a print-out [P] or Display [D] of the MDIRFILE? ' to FSEL
If !(FSEL)<>'Q'
If !(FSEL)<>'P' .and. !(FSEL)<>'D'
Store 'D' to FSEL
endif
Use MDIRFILE index MDIRFILE
If !(FSEL) = 'P'
? 'Ready the printer.'
Set format to print
Store 66 to curline
Store T to BEGINNG
Store 0 to pagenum
Do while .not. EOF
If curline > 62
If .not. BEGINNG
EJECT
endif
Store pagenum+1 to pagenum
@ 0,10 say 'Names Directory file '+date()+' Page'+str(pagenum,2)
Store 3 to curline
endif
If .not. BEGINNG
@ curline,10 say spact
SKIP
endif
Store F to BEGINNG
Do while * .and. .not. EOF
SKIP
enddo
Store curline+1 to curline
enddo
EJECT
Set format to screen
else
ERASE
@ 2,1 say 'Names Directory file '+date()
?
Do while .not. EOF
? ' ',spact
SKIP
Do while * .and. .not. EOF
SKIP
enddo
enddo
?
endif
Accept 'MDIRFILE is complete. Press <retn> ' to XX
endif
CASE !(MSEL) = 'Q'
Store F to LEVEL2
OTHERWISE
Accept 'Illegal selection. Please enter again ' to MSEL
Store F to validd
ENDCASE
ENDDO
ENDDO
USE
QUIT
haracter SKILLS code (example: SS for Sound System) ' to IC
If !(IC) <> 'Q'
Store acttype+$(IC,1,2) to IC
Find &IC
If # <> 0
? 'Duplicate SKILLS code found - "',sp