Topic "Converting Windows (DOS) script & FTP to WinSCP"

Author Message
BobM
[View user's profile]

Joined: 2011-11-03
Posts: 3
Location: Canada
Objective:

Want to move script (See figure 1) to WinSCP so we can trap for errors when connection to mainframe fails

Environment: Windows 2003 Server, WinSCP 4.3.5

Context:

AS2 EDI application, receiving data from trading partner and FTP's to mainframe for processing. Presence of received files in AS2 triggers a Windows (DOS) script to run that;

- Consolidates multiple inbound files, date & time stamps the file
- Builds a "job card" containing (among other things)the name of the date/time stamped data file
- Build the FTP script to contain the date/time stamped files name

The current process has a "Quote Site" command in the FTP script that sets up how the file is handled on the mainframe. The date/time stamped file is then uploaded via FTP. Another "Quote Site" command sets up for the following "job card" file to be handled differently prior to it being FTP uploaded to the mainframe.

Question:

How to handle the "Quote Site" commands in WinSCP script?

Figure 1: Existing FTP Script ** "X" is replaced by DOS script with current system time and date

open mainframe
username
userpwd
quote site lrecl=2000 recfm=fb pri=50 sec=50 cylinder
put PDBKS.PRODEDI.DXXXXXX.TXXXXXX 'PDBKS.PRODEDI.DXXXXXX.TXXXXXX'
quote site filetype=jes lrecl=80
put edijcl.txt
quit
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
I'm sorry, but I do not know what these commands do.
_________________
Martin Prikryl
BobM
[View user's profile]

Joined: 2011-11-03
Posts: 3
Location: Canada
These are actual mainframe environment commands.Basically tells the Z/os how to handle the files to be delivered by FTP.

For example;

quote site
lrecl=2000 --> logical record length=2000 bytes

recfm=fb --> Record formats are Fixed Block

pri=50 --> Primary storage allocation 50 cylinders

sec=50 cylinder --> Secondary (overflow storage allocation 50 cylinders.

To be more clear... Is there a way in WinSCP to have a native OS command for the target system be executed within the script.
BobM
[View user's profile]

Joined: 2011-11-03
Posts: 3
Location: Canada
The SITE command is part of RFC959 FTP standards. By preceding with the "QUOTE" command the "SITE" command is sent to the host unedited.

The QUOTE command is part of RFC1123 FTP Standards, page 40.

See http://www.ietf.org/rfc/rfc959.txt on page 46 for command references for SITE (and others).

See http://www.ietf.org/rfc/rfc1143.txt on page 46 for command references for QUOTE (and others).
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
BobM wrote:
To be more clear... Is there a way in WinSCP to have a native OS command for the target system be executed within the script.

Yes, there's "call" command:
http://winscp.net/eng/docs/scriptcommand_call
Though it may not help in your case. But it's worth trying.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License