Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Trying to run FTP script from a FEX

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Trying to run FTP script from a FEX
 Login/Join
 
Member
posted
Hi, first of all, sorry for the n00b question.

I am trying to use -DOS to run a *.BAT file that contains a small FTP script. The .bat file will run by itself, so that is OK. The FEX has just this:

-DOS C:\SCRIPTS\HCM864CLR.BAT

When I run it, I get a No HTML Output with the following details:

C:\ibi\srv76\wfs\edatemp\ts000016>ftp -s:HCM864CLR.bat
Error opening script file HCM864CLR.bat.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:buffer size Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
C:\ibi\srv76\wfs\edatemp\ts000016>OPEN SALES
'OPEN' is not recognized as an internal or external command,
operable program or batch file.
...

At this point, it reads through the .bat file and says each command in the FTP script is not recognized as an internal or external command, so it is finding and reading the file. Do I have to specify that this is an FTP script somehow before the -DOS command? Any help will be greatly appreciated. Thanks,

Brian

This message has been edited. Last edited by: Kerry,


We are on WebFocus 8.0.0.8M running on Win server 2008, and retrieving most data from our AS/400.
 
Posts: 3 | Location: Southfield, MI | Registered: October 26, 2010Report This Post
Platinum Member
posted Hide Post
Hi Brian,

Here's an example of what I use. This builds the ftp script in the fex and then runs the script.

-*
-** CREATE FTP SCRIPT - xyz_ftpscr.txt
-*
FILEDEF FTPSCR DISK xyz_ftpscr.txt
-RUN
-WRITE FTPSCR open xyz_box
-WRITE FTPSCR xyz_userid
-WRITE FTPSCR xyz_pswd
-WRITE FTPSCR put xyz_file.txt
-WRITE FTPSCR quit
-CLOSE
-*
-** RUN FTP SCRIPT - xyz_ftpscr.txt
-*
DOS ftp -i -s:xyz_ftpscr.txt
-RUN

Hope this helps.
Jim


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Expert
posted Hide Post
Brian,

It wold appear that you have a circular reference to the HCM864CLR.bat file.

The command ftp -s:HCM864CLR.bat would mean run the ftp command using the file HCM864CLR.bat as the input to ftp. which would just try and feed "ftp -s:HCM864CLR.bat" to the ftp command processor.

In reality what you should be doing is have two files, the HCM864CLR.bat file containing the command -

ftp -s:HCM864CLR.ftp

And a file HCM864CLR.ftp containing your FTP commands -

open domain.com
userid
password
cd [directory that you want at the ftp location]
lcd [directory that you want at the local location] ----> bear in mind that this will be running on the reporting server and NOT your local PC
get filename.extn
put filename.extn
quit

That should give you an idea of what you need to do. If you have trouble then just enter into FTP via a DOS prompt and make a note of what comands you have to enter to achieve the result that you require. Then place those commands (taking account of the note above) into the HCM864CLR.ftp file.

Also check out the use of SYSTEM instead of just using DOS or CMD or !. SYSTEM will allow you to capture the return code from your DOS command and test it for redirecting processing to error traps etc. It will also wait for the command to return control to the WF process. The normal CMD will just execute the command and not wait around for the response.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Trying to run FTP script from a FEX

Copyright © 1996-2020 Information Builders