Rocket Software Homepage
Forum Home Forum Home > AccuTerm Knowledge Base (read only) > Scripting & Automation
  New Posts New Posts RSS Feed - Scripts to connect mvbase servers
  FAQ FAQ  Forum Search   Register Register  Login Login

The AccuTerm forum has moved. Go to community.rocketsoftware.com to register for the new Rocket forum.

Forum LockedScripts to connect mvbase servers

 Post Reply Post Reply
Author
Message
buzzbob View Drop Down
Newbie
Newbie


Joined: January 05 2005
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote buzzbob Quote  Post ReplyReply Direct Link To This Post Topic: Scripts to connect mvbase servers
    Posted: January 05 2005 at 8:23am
I would like to run a script at my corporate site that would RUN FTBP FTPICK in receive mode, then open a telnet session to one of our other sites (using VPN), run a BASIC program that would run FTPICK multiple times to send data back to the corporate site. When completed the script would then connect to the next site .... until all sites have been processes. I just need some inital guidance on getting started.
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: January 12 2005 at 10:32am
Hi Bob -

This is a fairly complex problem. Here is how I would approach it. First, create a session file that you can use for each of the remote sites and save it. Then, on each remote machine, create a special user ID for this function. Use a logon PROC to run the FTPICK send function, using STON or DATA statements to feed the FTPICK prompts. The logon PROC can automatically log off when FTPICK is done. On the local site, create the connection script in a BASIC program and execute it using the escape sequence for running scripts. See one of the sample programs in ...\Atwin\Samples\Pickbp for an example. The program would be something like:

EQU ESC TO CHAR(27), STX TO CHAR(2), EM TO CHAR(25), CR TO CHAR(13)

...
SCR = 'dim i as integer'
SCR := EM : 'dim s as session'
SCR := EM : 'set s = sessions.add("store1.atcf")'
SCR := EM : 'for i = 1 to 10'
SCR := EM : 'if s.connected then exit for'
SCR := EM : 'pause 5'
SCR := EM : 'next i'
SCR := EM : 'if not s.connected then'
SCR := EM : 'initsession.output "fail connect" & vbcr'
SCR := EM : 's.terminate'
SCR := EM : 'exit sub'
SCR := EM : 'end if'
SCR := EM : 's.output "special-account-for-ftpick" & vbcr'
SCR := EM : 'if not s.waitfor(1,15,"pick-to-pick") then'
SCR := EM : 'initsession.output "fail login" & vbcr
SCR := EM : 's.terminate'
SCR := EM : 'exit sub'
SCR := EM : 'end if'
SCR := EM : 'set common("remotesession") = s'
SCR := EM : 'initsession.output "success" & vbcr'
PRINT ESC : STX : 'P' : SCR : CR :


You will need to customize the login sequence, but you should get the idea from the sample code. Next, EXECUTE "FTPICK" and use DATA statements to initiate the receive function on the local machine. When done, use another script to close the remote session:

SCR = 'dim s as session'

SCR := EM : 'on error resume next'
SCR := EM : 'set s = common("remotesession")'
SCR := EM : 'if not s is nothing then'
SCR := EM : 's.terminate'
SCR := EM : 'set common("remotesession") = nothing'
SCR := EM : 'end if'
PRINT ESC : STX : 'P' : SCR : CR :


When you get this working, could you post the results?

Thanks,

Pete

Back to Top
buzzbob View Drop Down
Newbie
Newbie


Joined: January 05 2005
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote buzzbob Quote  Post ReplyReply Direct Link To This Post Posted: January 28 2005 at 2:02am
Pete,
So far this is progressing well. However, I cannot get FTPICK in receive mode to terminate after the file has been transferred without my intervention.
All the calls to FTKERMIT pass a '0' to inhibit this. I guess what I'm asking is if the latest version passes the 'ONESHOT' variable to allow for control.
Back to Top
PSchellenbach View Drop Down
Admin Group
Admin Group

Moderator

Joined: December 15 2003
Location: United States
Status: Offline
Points: 2150
Post Options Post Options   Thanks (0) Thanks(0)   Quote PSchellenbach Quote  Post ReplyReply Direct Link To This Post Posted: February 15 2005 at 5:01am
Hi Bob -

The sending machine can use a small script to terminate the FTPICK receive mode. Use:

PRINT ESC : STX : 'P Common("PXMode") = 0' : CR :



Thanks,

Pete
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.