Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Procomm Scripts for the Masses (No I'm not calling you fat)

Status
Not open for further replies.

sci72

Technical User
May 29, 2004
28
0
0
US
Ok, time to give back. I'll start you off with three scripts I use regularly when building systems...

BARS_NPA
**********************************************************

proc main

;**********************************************
;* *
;* BARS_NPA Programmer *
;* *
;* v1.0 By Steven McMillen, TSR *
;* *
;* This program will pull NPA info from *
;* an excel spreadsheet to program NPA *
;* RLI information for a Meridian PBX. *
;* *
;* Excel file can be called anything but *
;* worksheet needs to be named 'NPA'. *
;* and must be open during script running *
;* Column A - NPA numbers 1201 - 1999 *
;* Restricted numbers should not *
;* be included. *
;* Column B - RLI number *
;* *
;* Log into PBX and run from "carrot prompt" *
;**********************************************


string npa,rli,sRowCol
integer col1,col2,row
long DDEChan
row = 2
col1 = 1
col2 = 2

thetop:

Transmit "LD 90^m"
Waitfor "REQ"
Transmit "NEW^m"
Waitfor "CUST"
Transmit "0^m"
Waitfor "FEAT"
Transmit "NET^m"
Waitfor "TRAN"
Transmit "AC1^m"
Waitfor "TYPE"
Transmit "NPA^m"
Waitfor "NPA"

excelrip:

ddeinit DDEChan "excel" "NPA" ;Creates link with Excel Spreadsheet
if FAILURE ;Error if cannot link
usermsg "`a Unable to establish link `rwith Excel Spreadsheet"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col1 ;Pulling data in column A
dderequest DDEChan sRowCol npa ;Assinging value to variable npa
if stricmp npa "end`r`n" ;Testing if end of data
Transmit "^m"
Waitfor "REQ"
Transmit "****^m"
usermsg "The end is here!`rThere is no more Data to input"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col2 ;Pulling data in column B
dderequest DDEChan sRowCol rli
strreplace npa "`n" "" ;Pulling line feed from string value
strreplace rli "`n" "" ;Pulling line feed from string value
row = row + 1 ;Increment row value

meridian:

Transmit npa
Waitfor "RLI"
Transmit rli
Waitfor "SDRR"
Transmit "^m"
Waitfor "ITEI"
Transmit "^m"
Waitfor "NPA"
goto excelrip

theend:


endproc

******************************************************

Set up an excel document MAKE SURE THE WORKSHEET IS NAMED 'NPA'. Have two colums, Column A is for your NPA's, Column B is for your RLI. Be sure to have a column header as the script will start pulling from the 2nd row first. See example of Excel..

NPA RLI
1200 2
1201 2
1202 3
1203 2

Make a template with your standard setup and remove all your Caribean codes or blocked number, modify to suit the customer. Easy using features in excel to make the sheet quickly and once it's done, it's done. When the script is ran it will start from the carrot prompt after login, it will enter ld 90 and program all NPA's on the excel sheet (keep sheet open during build). Sit back and watch.




BARS_NXX
*******************************************************
proc main

;**********************************************
;* *
;* BARS_NXX Programmer *
;* *
;* v1.0 By Steven McMillen, TSR *
;* *
;* This program will pull NXX info from *
;* an excel spreadsheet to program NXX *
;* RLI information for a Meridian PBX. *
;* *
;* Excel file can be called anything but *
;* worksheet needs to be named 'NXX'. *
;* and must be open during script running *
;* Column A - NXX numbers 201 - 999 *
;* Column B - RLI number *
;* *
;* Log into PBX and run from "carrot prompt" *
;**********************************************

string nxx,rli,sRowCol
integer col1,col2,row
long DDEChan
row = 2
col1 = 1
col2 = 2

thetop:

Transmit "LD 90^m"
Waitfor "REQ"
Transmit "NEW^m"
Waitfor "CUST"
Transmit "0^m"
Waitfor "FEAT"
Transmit "NET^m"
Waitfor "TRAN"
Transmit "AC1^m"
Waitfor "TYPE"
Transmit "NXX^m"
Waitfor "NXX"

excelrip:

ddeinit DDEChan "excel" "NXX" ;Creates link with Excel Spreadsheet
if FAILURE ;Error if cannot link
usermsg "`a Unable to establish link `rwith Excel Spreadsheet"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col1 ;Pulling data in column A
dderequest DDEChan sRowCol nxx ;Assinging value to variable dn
if stricmp nxx "end`r`n" ;Testing if end of data
Transmit "^m"
Waitfor "REQ"
Transmit "****^m"
usermsg "The end is here!`rThere is no more Data to input"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col2 ;Pulling data in column B
dderequest DDEChan sRowCol rli
strreplace nxx "`n" "" ;Removing line feed from string
strreplace nxx "`r" ""
strreplace rli "`n" "" ;Removing line feed from string
strreplace rli "`r" ""
row = row + 1 ;Incrementing row counter

meridian:

Transmit nxx
mspause 50
transmit "^m"
Waitfor "RLI"
Transmit rli
mspause 50
transmit "^m"
Waitfor "SDRR"
mspause 50
Transmit "^m"
Waitfor "ITEI"
mspause 50
Transmit "^m"
Waitfor "NXX"
goto excelrip

theend:


endproc
******************************************************

Set up an excel document MAKE SURE THE WORKSHEET IS NAMED 'NXX'. Have two colums, Column A is for your NXX's, Column B is for your RLI. Be sure to have a column header as the script will start pulling from the 2nd row first. See example of Excel..

NXX RLI
200 2
201 2
202 3
203 2

Make a template with your standard setup, modify to suit the customer. Easy using features in excel to make the sheet quickly and once it's done, it's done. When the script is ran it will start from the carrot prompt after login, it will enter ld 90 and program all NPA's on the excel sheet (keep sheet open during build). Sit back and watch.


MULTICHANGE
*****************************************************
proc main

;**********************************************
;* *
;* Multi-Change Programmer *
;* *
;* v1.0 By Steven McMillen, TSR *
;* *
;* This program will perform set changes *
;* based on information entered on an *
;* excel spread sheet. Thus providing *
;* the benefit of cut and paste. *
;* *
;* At this point script will only make *
;* one change per set, if multiple changes *
;* needed enter extra row entries. *
;* *
;* Excel file can be called anything but *
;* worksheet needs to be named 'Change'. *
;* and must be open during script running *
;* Column A - Set type *
;* Column B - Set TN *
;* Column C - Change value(enter as if *
;* you where to key it manually *
;* *
;* Log into PBX and run from "carrot prompt" *
;**********************************************

string typ,tn,chg,sRowCol
integer col1,col2,col3,row
long DDEChan
row = 2
col1 = 1
col2 = 2
col3 = 3

thetop:

Transmit "LD 20^m"
Waitfor "REQ"
excelrip:

Transmit "CHG^m"
Waitfor "TYPE"


ddeinit DDEChan "excel" "CHG"
if FAILURE
usermsg "`a Unable to establish link `rwith Excel Spreadsheet"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col1
dderequest DDEChan sRowCol typ
if stricmp typ "end`r`n"
Transmit "****^m"
usermsg "The end is here!`rThere is no more Data to input"
goto theend
endif
strfmt sRowCol "R%dC%d" Row Col2
dderequest DDEChan sRowCol tn
strfmt sRowCol "R%dC%d" Row Col3
dderequest DDEChan sRowCol chg
strreplace typ "`n" ""
strreplace tn "`n" ""
strreplace chg "`n" ""
strreplace tn "-" " "
row = row + 1

meridian:

Transmit typ
Waitfor "TN"
Transmit tn
Waitfor "ECHG"
Transmit "YES^m"
Waitfor "ITEM"
mspause 250
Transmit chg
When Target 0 "MARP ON" call Marpreact
if strfind chg "FDN"
goto StepA
endif
if strfind chg "SCR"
call NameChange
endif
if strfind chg "SCN"
call NameChange
endif
if strfind chg "MCR"
call NameChange
endif
if strfind chg "DN"
call NameChange
endif
when target 0 "FTR" call handle
mspause 250
Transmit "^m"
;usermsg "here"
StepA:
mspause 250
Transmit "^m"
;Waitfor "ITEM"
Transmit "^m"

Waitfor "REQ"
goto excelrip

theend:




endproc

proc handle

mspause 250
Transmit "^m"

endproc



proc NameChange


Transmit "^m"
Waitfor "CPND"
Transmit "^m"
Waitfor "VMB"

Transmit "^m"


endproc



proc marpreact
Transmit "^m"

endproc
*******************************************************

Ok, this one is a favorite in my office. Ever program a system and then realize you forgot to program CLS HTA and HUNT 7000 or something on all 500 of your phones, well MultiChange to the rescue. Have an excel sheet template, have THE WORKSHEET NAMED 'CHANGE'. Have three columns, A is 'Type', B is 'TN', and C is 'Change'. Enter the change as you would key it, see example below...

TYPE TN CHANGE
500 23-0-4-3 CLS PUA
500 23-0-4-4 CLS PUA
2008 23-0-5-1 CLS HTA
2008 23-0-5-1 HUNT 7000
3904 23-0-5-3 CLS MWA
3904 23-0-5-3 KEY 16 MWK 7000

etc. etc.
Again with the whole copy paste thing going in excel this can really help you out especially if you have documentation already that has some of this info (type,tn) in excel format, just copy and past it into the template, type your change out once, then copy that through to the other sets. Sit back and enjoy, I've used this program to make thousands of changes!!

If you have questions please email me at

steven.mcmillen 'at' morefield.com

I got more goodies but not quite ready to go public with some of them.
 
When copying the script pay attention to the formatting of it, things are not showing up as I have them wrote, I assume it has to due with the width of the forum cells. for example the blocks at the beginning of each script came out horribly and the asterisk's are actully suppose to form a block around my comments, Oh well, I tried.
 
Funny, when you copy from the post above and then paste it into aspect editor or notepad all the formatting comes back.
 
you can save the format of this type of code with tgml code. for that post, if you put the word code in braclets then end it with a ring bracket forward slash code left bracket, all formating with remain. do you find that script better then a wud file? i usually just use a txt file as a data source, less places for a simple mistake, which i am very good at.. i have a simple one paragraph script posted here that enters all possible npa's, then i use a delete npa to strip the ones i don't need.. the list of the unused are getting smaller every day.. that type of a file would work for my to add large groups of stations from an excel.. either way it's a great script..

john poole
bellsouth business
columbia,sc
 
John, you'll have to enlighten me, what is a wud file? is there anyway to post files to these forum posts as some of my other scripts are to big to simply copy and paste in a post?
 
no on the secondary way to share scripts, copy and paste is about it. we are not allowed to share emails, for a good reason. i have seen post over 1000 lines long. a wud is just a txt file that procomm uses, i build longer files in excel, then save as a csv file, that puts a comma between the columns. but in procomm editor that is not a file type. the wud file is as close as it comes.. the main diff in that, is the script finds the col without having to define the columns

Code:
strfmt sRowCol "R%dC%d" Row Col2             
    dderequest DDEChan sRowCol tn
    strfmt sRowCol "R%dC%d" Row Col3             
    dderequest DDEChan sRowCol chg
    strreplace typ "`n" ""

those lines would not be needed. i can paste a script file of that type as soon as i get back to my pc at work.. i have some posted here but don't really love the search engine here..

john poole
bellsouth business
columbia,sc
 
btw, isn't fat, spelled "phat", cool these days? not that i wouldn't know, my great-grand kids seem to use it.. beside that i'm 5'8" around 160 so neither spelling scares me real bad

john poole
bellsouth business
columbia,sc
 
guess i've been on vacation to long, i posted you script over in the ascept forum, some one is looking for a npa script that prints an npa then does a get target to add new npa's matching an npa in ld 90.. seems like a waste of time, i've never worked on a switch with more then one or two rlb's for ld calls..why query the switch for data that matches for almost all npa's

john poole
bellsouth business
columbia,sc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top