ftp: send variable length binary (VB) file to mainframe



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Re: ftp: send variable length binary (VB) file to mainframe

Postby bakinsoda » Thu Oct 02, 2008 10:16 am

transferring using ftp in unix, not sas. i know u could use the bin option in ftp, but what about rdw and bdw. i want to create those as well.
bakinsoda
 
Posts: 6
Joined: Fri Mar 21, 2008 10:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ftp: send variable length binary (VB) file to mainframe

Postby MSwanberg » Mon Dec 19, 2011 5:27 pm

This sort of thing is possible, but it takes a bit of programming. Nothing too in-depth, though.

Mainframe FTP servers have what's called Mode B. (Note, I'm doing this from memory, so my syntax might not be 100% accurate). Access Mode B with the QUOTE MODE B command.

Mode B files have each record started with a x'80' followed by 2 bytes describing, in binary, the length of the record. So, a quick Perl script or VBScript program could transform the file on the PC side into a Mode B file. Read each record, get the length, and then write the record starting with x'80' and the 2-byte length.

Next, when sending the file via FTP to the mainframe, be sure to do a QUOTE SITE command to set the VB and LRECL, then do BINARY and then QUOTE MODE B. Then, when you send the file, the mainframe FTP server will interrogate each record's x'80' and 2-byte length descriptor and use that for the length of that record.

If you have any questions about Mode B, a google search will bring up plenty of information. I use this format very frequently... but I have scripts to do the heavy lifting which is why I don't know the syntax perfectly.
MSwanberg
 
Posts: 1
Joined: Mon Dec 19, 2011 5:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ftp: send variable length binary (VB) file to mainframe

Postby dick scherrer » Tue Dec 20, 2011 1:47 am

Hello and welcome to the forum,

Please note that this topic has been dormant for more than 3 years :)

Usually it is best to reply to topics that are currently active (or have only been inactive for a few months).

Hope we have some things you find interesting ;)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Previous

Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post