Converting Windows (DOS) script & FTP to WinSCP

Advertisement

BobM
Joined:
Posts:
3
Location:
Canada

Converting Windows (DOS) script & FTP to WinSCP

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Converting Windows (DOS) script & FTP to WinSCP

I'm sorry, but I do not know what these commands do.
_________________
Martin Prikryl

Reply with quote

BobM
Joined:
Posts:
3
Location:
Canada

Usage of Quote Site commands

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.

Reply with quote

BobM
Joined:
Posts:
3
Location:
Canada

FTP QUOTE & SITE command

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 https://tools.ietf.org/html/rfc959 on page 46 for command references for SITE (and others).

See https://tools.ietf.org/html/rfc1143 on page 46 for command references for QUOTE (and others).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Usage of Quote Site commands

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:
https://winscp.net/eng/docs/scriptcommand_call
Though it may not help in your case. But it's worth trying.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum