is there a DOS batch file guru in the house?

jtexas

Fleet Admiral
Joined
Oct 13, 2003
Messages
8,646
accountant needs a little programming guidance...

I'm using an excel visual basic program to open a dos window to upload and/or download mainframe files using the FTP command. I want to capture the mainframe response, completion codes, error codes, that sort of thing.

this is the batch file:

m:
cd m:\
FTP -s:FTPLIST.FTP xxx.xxx.com
ren wait.ftp done.ftp
exit

Where xxx.xxx.com is our host mainframe, FTPLIST.FTP is a text file with the logon script & file info, and "done.ftp" is just to signal the vbasic program that FTP is done. That part works fine, but the dos session goes by too fast to read the codes if an error occurs. I can tell If a download is unsuccessful by the fact that the downloaded file has size = 0, but no indication of what caused the failure.

If I could log the dos session to a file I could get 'em that way - is there a dos command for that?

thanks!
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: is there a DOS batch file guru in the house?

Well, i'm not sure but try something along the lines of:

FTP -s:FTPLIST.FTP xxx.xxx.com > log.txt

And if that works you can use: >> log.txt to append to the log file instead of overwrite it each time.

> file.txt = redirect output to a txt file
>> file.txt = redirect out to a txt file and append
 

jtexas

Fleet Admiral
Joined
Oct 13, 2003
Messages
8,646
Re: is there a DOS batch file guru in the house?

works perfectly.

been thinking about that for a year - just now occurred to me to ask on the boating forum.

thnaks again!!
 

JustMrWill

Master Chief Petty Officer
Joined
Aug 12, 2003
Messages
877
Re: is there a DOS batch file guru in the house?

If you just want to see whats on the screen...you can add PAUSE before the EXIT

the drawback is that you will HAVE to hit a key for it to finish.

-JMW
 

rwise

Captain
Joined
Jul 5, 2001
Messages
3,205
Re: is there a DOS batch file guru in the house?

Best darn boating forum in town I tell you what,,,d:)
 
Joined
Jun 23, 2006
Messages
17
Re: is there a DOS batch file guru in the house?

You can also pause the batch file for a number of seconds by using the sleep command. It comes in the resource kit.
 

Plainsman

Rear Admiral
Joined
Apr 2, 2006
Messages
4,062
Re: is there a DOS batch file guru in the house?

Can you pipe it | to pause it?
 

i386

Captain
Joined
Aug 24, 2004
Messages
3,548
Re: is there a DOS batch file guru in the house?

No problem, so easy a caveman could do it. 8)
 

tomatolord

Chief Petty Officer
Joined
Oct 1, 2004
Messages
548
Re: is there a DOS batch file guru in the house?

I use a program called autohotkey you can download it for free and is fantastic windows / dos batch file utility

tomatolord
 
Top