Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Net::FTP to Mainframe Z/OS

by jazzycat (Initiate)
on Jun 10, 2008 at 18:03 UTC ( #691290=note: print w/ replies, xml ) Need Help??


in reply to Re: Net::FTP to Mainframe Z/OS
in thread Net::FTP to Mainframe Z/OS

The LRECL is 80 - it is a member in a PDS. I think it has to do with incorrect CR LF translation. It truncates apparently randomly. For example a Line that is 3 char long and says RUN become RU after transfer.


Comment on Re^2: Net::FTP to Mainframe Z/OS
Re^3: Net::FTP to Mainframe Z/OS
by nimdokk (Vicar) on Jun 11, 2008 at 12:46 UTC
    LRECL may not be the only thing, you might want to check the Block size and record format (may not make a difference). I'm assuming you are issuing a SITE command to set the Record Length, Block Size, Record Format as well as Unit (not quite sure what this is or does). Also you might need to issue another SITE command for "trail" (not sure what this does exactly. This is based on some code I have to send files to a mainframe (not sure if it is a Z/OS or what - the code is based on something the mainframe guys gave me so I could FTP to them without having data being truncated).
      Thanks for this info it was helpful. No I am not issuing a SITE command and I cannot find any info on the format of such command, other than that it exists as a method in Net::FTP as site(ARGS) but I cannot find what should be in ARGS. Could you give me the examples of your code that you mentioned?
        What I've got is baed on a code snippet that I was given by someone working on the mainframe. I translated it to use in Perl. There are a few things I'm not quite sure about namely PRI and SEC (I think this has to do with disk allocation on the mainframe).
        $ftp->site("PRI=<some number>","SEC=<some number>", "TRacks", "RECfm=<record format - either Fixed Block or Variable Bloc +k", "LRecl=<record length number>", "BLocksize=<block size number>", "Unit=<not sure about this one>") or die "Cannot set SITE c +ommand. $!"; $ftp->site("trail") or die "Cannot issue SITE 'trail' command. $!"; $ftp->put("<file-name>","\'Data.Set.Name(+1)\'") or die "Cannot put <f +ile-name> to Data.Set.Name. $!";
        Note, the (+1) after the dataset name indicates that the data set is a plus one generation (the generation number is incremented by one each time a file is sent. Block size, record Length, Record Format and whether it is a generational dataset is determined by the mainframe and they would have to tell you (assuming it matters). Also, I have found that the transfer works when surrounded by the single quotes - even if I were doing this on the command-line FTP client. This may not all be necessary for the mainframe Z/OS, but might get you going in the right direction. Good luck.
      TRAIL indicates to keep trailing blanks on fixed length records. SBSENDEOL can be CRLF, CR, LF, or NONE This SITE command sets the Single Byte end-of-line character sequence; if it is CRLF and you're not sending both then the lines would be truncated by a byte. If you can ftp to the mainframe, QUOTE HELP SITE should give you the SITE parameters you can use.
        Thanks for the info.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://691290]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-08-23 08:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (173 votes), past polls