[comp.dcom.telecom] DCL Procedure for London Area Code Split

covert@covert.enet.dec.com (John R. Covert 21-Feb-1990 0950) (02/21/90)

 $!
 $! London.com -- determine new area code for London numbers
 $!
 $! usage is @london exchange, e.g. @london 264
 $!
 $ on error then goto usage
 $ on warning then goto usage
 $ exch = 0'p1'
 $ if exch .lt. 200 .or. exch .gt. 999 then goto usage
 $!
 $ l2 =	"8-888888887-7777-777777777777777777777777777777777" +-
	"77777777777777-77777777777777777-77-777788-8-8-888"
 $ l3 =	"88888878888888878888777777777787877888788888-88888" +-
	"777777777788-888888-77777777777777777777888888-888"
 $ l4 =	"77777777777777777778888887888877777777778888888888" +-
	"88887887888888878888888778778877777777777777777777"
 $ l5 =	"8888888888777787788888788788-888888887788888888878" +-
	"8888888888888888888888888888887777777777888888-888"
 $ l6 =	"77777777777777-7--7777777777777777777777888888888-" +-
	"88-888888888-8888888888888888888888888888888887888"
 $ l7 =	"77777-77777777777-77777777777777777777778888888888" +-
	"888788878888-88-8888887877888788888888887777777-77"
 $ l8 =	"8888888888-8------7777777-7777-7777777778888888888" +-
	"888888888888888887888877888888-888888-8888888--888"
 $ l9 =	"8788888888-77887777-777777-777777777777788888-8888" +-
	"8888877788887888-888-7778-787888-8888788-88888-88-"
 $!
 $ exchhi = exch/100
 $ digit = F$extract(exch-(exchhi*100),1,l'exchhi')
 $ if digit .eqs. "-"
 $then
 $ write sys$output "Exchange ",exch," is invalid."
 $else
 $ write sys$output "0",digit,"1-",exch
 $endif
 $ exit
 $usage:                                                    
 $ write sys$output "Usage of this procedure is as follows:"
 $ write sys$output ""
 $ write sys$output "  @london exchange"
 $ write sys$output ""
 $ write sys$output "  Where exchange is the first three digits of a valid"+-
	 		" London number."
 $ write sys$output "  Exchanges range from 2xx through 9xx."
 $ exit


[Moderator's Note: See also issue 117 for a perl script doing the same thing
if you prefer that instead.  PT]