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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script to bulk change Nortel telephones 1

Status
Not open for further replies.

SherWat

Technical User
Feb 12, 2016
216
CA
I just downloaded ZOC in order to create a script to change multiple telephones on a CS1000 at 7.6
I recorded a script with changing one phone to get the parameters:

Code:
/* REXX (RECORDED BY ZOC V7.18.3 2018/05/17 07:03:15) */

CALL ZocTimeout 60
CALL ZocWaitForSeq "on"

CALL ZocSend "ld 20^M"

CALL ZocWait "REQ:"
CALL ZocSend "chg^M"

CALL ZocWait "TYPE:"
CALL ZocSend "1230^M"

CALL ZocWait "TN"
CALL ZocSend "248 0 0 8^M"

CALL ZocWait "ECHG"
CALL ZocSend "yes^M"

CALL ZocWait "ITEM"
CALL ZocSend "fdn 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "hunt 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "key 16 mwk 7000^M"

CALL ZocWait "KEY"
CALL ZocSend "^M"

CALL ZocWait "ITEM"
CALL ZocSend "^M"

I know I will need to create a text file with the specific inputs. The items that will change are:
TYPE and TN
Everything else will remain the same.

Sample of text file might be:
TYPE TN
1230 248 0 0 8
1120 236 0 0 5
3903 4 0 8 10

Does anyone have a sample script to do something similar that they would be willing to share?

Thank you.
 
The problem with everyone elses' 'scripts' is that they are probably the property of their company and should/can not be shared. You should write your own.


Nic
 
Eaiest way is create a CSV file
1230,248 0 0 8
1120,236 0 0 5
3903,4 0 8 10

Going on what you are wanting you could do the following:

CALL ZocTimeout 60
CALL ZocWaitForSeq "on"

new= ZocGetFilename("Select file to upload", "c:\*.csv")
IF new="##CANCEL##" THEN CALL finish

CALL ZocSend "ld 20^M"
CALL ZocWait "REQ:"

DO FOREVER
fileid = linein(new)

PARSE VALUE fileid WITH v1","v2

IF v1 = "" THEN CALL finish

CALL ZocSend "chg^M"

CALL ZocWait "TYPE:"
CALL ZocSend v1"^M"

CALL ZocWait "TN"
CALL ZocSend v2"^M"

CALL ZocWait "ECHG"
CALL ZocSend "yes^M"

CALL ZocWait "ITEM"
CALL ZocSend "fdn 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "hunt 7000^M"

CALL ZocWait "ITEM"
CALL ZocSend "key 16 mwk 7000^M"

CALL ZocWait "KEY"
CALL ZocSend "^M"

CALL ZocWait "ITEM"
CALL ZocSend "^M"

CALL ZocWait "REQ:"
END

finish:
CALL ZocSend "****^M"
CALL ZocNotify "Finished"
EXIT
 
Thank you bignose21. Much appreciated you taking the time for someone trying to learn. Thank you.
 
You must remember that the zoc extensions are not part of rexx itself. People will be willing to help you improve your Rexx skills but most will know nothing about Zoc. In the code provided by bignose21 a routine provided by Zoc (zocgetfilename) is not documented in the ZocRexxReference.pdf documentation although it is mentioned. This sort of thing makes it even harder for non-Zoccers to help.


Nic
 
yep I am just a self taught ZOC user but also use it to work on the CS1000 so understood both sides of the question, lucky for SherWat really :)
 
I have this in Zoc Help files under ZOC-REXX Commands/Functions:

ZocGetFilename(<title> [, <default>])
Display a file selection window and return the filename. If the file requester is cancelled, the string ##CANCEL## is returned.

Example:

file= ZocGetFilename("Select file to upload", "*.ZIP")
IF file\="##CANCEL##" THEN DO
CALL ZocUpload "ZMODEM", file
END


 
In the document that I was looking at, The ZOC Rexx Reference (Using Regina Rexx in ZOC) Version 3.7, by Markus Schmidt in November 2016, I see an entry for ZOCFileList and it says "See also ZOCGetFilename" but that is the only reference to ZocGetFilename in the PDF. There may be a later version but I am not going to search high and low for it as i do not use Zoc. I am a Rexx programmer and I am converting from Regina Rexx to OORexx. The only external stuff to the basic language that I use is SQLite.


Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top