Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mailrus!accuvax.nwu.edu!nucsrl!telecom-request From: covert@covert.enet.dec.com (John R. Covert 21-Feb-1990 0950) Newsgroups: comp.dcom.telecom Subject: DCL Procedure for London Area Code Split Message-ID: <4250@accuvax.nwu.edu> Date: 21 Feb 90 15:10:35 GMT Sender: news@accuvax.nwu.edu Organization: TELECOM Digest Lines: 50 Approved: Telecom@eecs.nwu.edu X-Submissions-To: telecom@eecs.nwu.edu X-Administrivia-To: telecom-request@eecs.nwu.edu X-Telecom-Digest: Volume 10, Issue 122, message 1 of 11 $! $! 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]