×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Script to bulk change Nortel telephones

Script to bulk change Nortel telephones

Script to bulk change Nortel telephones

(OP)
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.

RE: Script to bulk change Nortel telephones

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

RE: Script to bulk change Nortel telephones

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

RE: Script to bulk change Nortel telephones

(OP)
Thank you bignose21. Much appreciated you taking the time for someone trying to learn. Thank you.

RE: Script to bulk change Nortel telephones

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

RE: Script to bulk change Nortel telephones

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 smile

RE: Script to bulk change Nortel telephones

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


RE: Script to bulk change Nortel telephones

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

RE: Script to bulk change Nortel telephones

If its of any interest I'm on ZOC 5.11

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close