Differences

This shows you the differences between the selected revisions of the page.

2019-10-09 2019-11-19
created (martin) remote file parameters (martin)
Line 1: Line 1:
====== Can I connect to a mainframe server? (e.g. VMS, MVS, AS/400) ====== ====== Can I connect to a mainframe server? (e.g. VMS, MVS, AS/400) ======
 +Mainframe systems have some specifics. Some of those are addressed below.
 +
 +===== Path Format =====
WinSCP in general requires the server to follow *nix path semantics -- hierarchical paths starting with a slash, with individual path components separated by slashes. WinSCP in general requires the server to follow *nix path semantics -- hierarchical paths starting with a slash, with individual path components separated by slashes.
-===== SFTP =====+==== SFTP ====
This is not a problem, if your server supports [[sftp|SFTP protocol]], as the SFTP protocol itself mandates *unix-like path format. So even if the server itself uses a different native path format, it has to emulate the *nix format for SFTP. This is not a problem, if your server supports [[sftp|SFTP protocol]], as the SFTP protocol itself mandates *unix-like path format. So even if the server itself uses a different native path format, it has to emulate the *nix format for SFTP.
-===== FTP =====+==== FTP ====
On the contrary, [[ftp|FTP protocol]] does not have such requirement. It allows the server to keep its native path format. WinSCP has limited support for working with such paths. In some cases it can work, but not always. On the contrary, [[ftp|FTP protocol]] does not have such requirement. It allows the server to keep its native path format. WinSCP has limited support for working with such paths. In some cases it can work, but not always.
Line 19: Line 22:
Refer to [[https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzaiq/rzaiqsitet.htm|IBM documentation for these commands]]. See also [[&forum_post(57336)|topic on connecting to IBM Power Systems server with WinSCP]]. Refer to [[https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzaiq/rzaiqsitet.htm|IBM documentation for these commands]]. See also [[&forum_post(57336)|topic on connecting to IBM Power Systems server with WinSCP]].
-~~NOTOC~~+===== Record Length and Other Remote File Parameters===== 
 + 
 +To set record length or other parameters for files that are about to be uploaded, use the methods described below. 
 + 
 +==== FTP ==== 
 + 
 +Execute a similar command from [[ui_console|Console window]]: 
 + 
 +<code> 
 +SITE FIXrecfm 128 Lrecl=128 Recfm=FB BlockSize=6144 
 +</code> 
 + 
 +In [[scripting]], use [[scriptcommand_call|''call'' command]]: 
 +<code winscp> 
 +call SITE FIXrecfm 128 Lrecl=128 Recfm=FB BlockSize=6144 
 +</code> 
 + 
 +In [[library|.NET assembly]], use [[library_session_executecommand|''Session.ExecuteCommand'' method]]: 
 + 
 +<code powershell> 
 +$session.ExecuteCommand("SITE FIXrecfm 128 Lrecl=128 Recfm=FB BlockSize=6144") 
 +</code> 
 + 
 +==== SFTP ==== 
 + 
 +SFTP protocol does not have a generic way to execute server-specific commands, like %%FTP%% does with its ''SITE'' command. For this reason, mainframe SFTP servers allow passing parameters using a special syntax of a path provided to a directory listing request. 
 + 
 +For example in [[scripting]], you can use the following format of [[scriptcommand_ls|''ls'' command]] to set the parameters: 
 + 
 +<code winscp> 
 +ls /+recfm=fb,lrecl=2214,blksize=0,replace/ 
 +</code> 
 + 
 +In [[library|.NET assembly]], use [[library_session_listdirectory|''Session.ListDirectory'' method]]: 
 + 
 +<code powershell> 
 +$session.ListDirectory("/+recfm=fb,lrecl=2214,blksize=0,replace/") 
 +</code> 
 + 

Last modified: by martin