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!

Updating a bunch of stations at once 3

Status
Not open for further replies.

nerdo2

MIS
Apr 20, 2001
26
0
0
US
Hi,

I want to update the Abbreviated Dialing List 3 on a lot of stations and was wondering if there was a way to do this automated so I don't have to go into each one individually. Does anyone know of a way to do that? Kind of like when you do duplicate station to setup a bunch of stations.....

Thanks,

Carolyn
 
I normally use a Procomm script to do this kind of thing. I can show you how to create a fairly generic one to modify station settings if you are interested.
 
Hi there,

Yes I would be interested, I have to update about 50 stations and so far with the DSA, I haven't seen anyway to do this automatically. What is Procomm?

Thanks, Carolyn
 
If you go to Advanced/Import Data and choose station as the object type and check the "change" radio button, it will bring up a table. Just add the list of stations down the left and then go to the field where you want to make the change and type in the new value. You only need to fill these two fields and that field will be changed. All this is in DSA by the way! John
 
I don't have access to DSA, and since I had already committed myself, here is a simple Procomm script.

I tested on my lab system, but it only has 2500 and 8403 sets. It may have to modified for different sets.

I appologize for the disclaimer, but my lawyer has insisted that I put it on any scripts or programs that I disseminate.

The input file is simple, just a list of extensions, separated from the group number by a comma. One entry per line:

ext1, grp#
ext2, grp#
ext3, grp#

Good luck!

;
; Procomm Script to CHANGE STATION for list 3 to a group number specified
;
; DISCLAIMER. THE SOFTWARE IS PROVIDED "AS IS". PANSOPHIC MAKES NO
; WARRANTIES, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED
; TO, ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
; PARTICULAR PURPOSE, WITH RESPECT TO THE SOFTWARE, DOCUMENTATION, AND/OR
; ANY OTHER MATERIAL OR INFORMATION FURNISHED TO USER RELATED TO THE
; SOFTWARE. BY USING THE SOFTWARE USER ACKNOWLEDGES AND AGREES THAT IT IS
; DOING SO AT ITS OWN RISK, AND THAT PANSOPHIC HAS NO LIABILITY FOR ANY
; DAMAGES, INCLUDING DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, INDIRECT OR
; CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST SAVINGS, AND WHETHER IN
; CONTRACT, TORT OR OTHERWISE (INCLUDING NEGLIGENCE) ARISING OUT OF
; USERS'S USE OF THE SOFTWARE. ADDITIONALLY, USER SHALL HOLD PANSOPHIC
; HARMLESS FROM AND AGAINST LOSS AND LIABILITY OF ANY KIND OR NATURE
; ARISING OUT OF THE USE OR RELIANCE UPON DATA, RESULTS, SOLUTIONS OR
; CONCLUSIONS GENERATED BY USER OR THIRD PARTIES THROUGH USE OF THE
; SOFTWARE.
;
;
; This script adapted from:
; ISLUA 99
; Session BA 20 - "Capturing Data From Your Meridian 1 to Various PC Software Packages"
; Curt K.
;
; Available at ;


string chg_type = "ch sta " ; command to issue
string chg_file = "c:\temp\input.txt" ; file with stations and group numbers
; be sure to have a blank line at the
; end or the last line will not execute
string cap_file = "input.cap" ; capture file
string cap_path = "C:\temp\" ; path for the capture file

proc main
set terminal type ATT4410
set txpace 1 ;delay for keyboard

set capture recordmode raw ; capture data including escapes
set capture query off ; don't query for a name set capture overwrite off ; don't overwrite
set capture path cap_path ; set the path
set capture file cap_file ; set the filename

capture on ; start capturing

fopen 1 chg_file READ
; input.txt it in the format of
; ext, group number

if failure
usermsg "could not open the file."
else
fseek 1 0 0 ; Open file 1
while 1 ; While there are more lines in file 1
fgets 1 s0 ; Get a line from file 1 and store in s0
if FEOF 1 ; If you encounter an End Of File in file 1
exitwhile ; Exit the loop
endif
strtok s1 s0 "," 1 ; parse string s0 into s1 up to the ","
strtok s2 s0 "," 1 ; parse string s0 into s2 after the ","
DelStr (&s1) ; run DelStr procedure on s1
DelStr (&s2) ; run DelStr procedure on s2
DelLineFeed (&s2) ; remove the line feed (^J) from s2
;strfmt s4 "TN: %s" s1 ;uncomment these two for
;usermsg s4 ;troubleshooting the script
strlen s1 i0 ; assign the length of s1 to i0
if (i0 > 2) ; if i0 is longer than 2 characters
CHGSTA () ; call the change routine
else ; if the length of s1 is less than 2 characters
Transmit "^[OP" ; exit the command
halt ; stop the script
endif
endwhile

endif

transmit "logoff^M" ; logoff the system
waitfor "[n]"
transmit "y^M" ; confirm logoff

capture off ; stop capturing
endproc


proc CHGSTA

transmit chg_type ; send the command
transmit s1 ; send the station number
transmit "^M"

pause 1
transmit "^[OV" ; goto next page
transmit "^[OV" ; goto next page
for i0 = 1 upto 12
transmit "^I" ; tab
endfor
transmit "group^M" ; make it a group list
transmit s2 ; tell it which group
transmit "^[OR" ; Enter


Waitfor "Command:"
endproc


proc DelStr
param string szStr
integer Pos
while 1
if StrFind szStr "`"" Pos ; search szStr for whitespace and assign position to Pos
StrDelete szStr Pos 1 ; delete the characters to Pos
else
exitwhile
endif
endwhile
endproc

PROC DelLineFeed
param string szStr
integer Pos
strlen szStr Pos ; assing the length of szStr to
Pos
if (Pos > 2)
StrDelete szStr (Pos-1) 1 ; delete 1 character from szStr
beginning at one character
; from the end of the string
endif
endproc
 
Thanks scottyjohn, I have DSA and that was exactly was I was looking for! Thanks pansophic, I'm still interested in your script since I can't always rely on DSA, I'm going to experiment with that too. =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top