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

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

See https://datatracker.ietf.org/doc/html/rfc1123 on page 46 for command references for QUOTE (and others).

Reply with quote

Advertisement

You can post new topics in this forum