Is there an FTP option to specify that says "don't send the carriage
control" character?
Either in the PARM= or through the SYSFTPD DD statement?
I haven't seen such a thing mentioned in any of the manuals but thought I'd
check here before deciding what my work-around solution will be. :-)
Thanks for any suggestion, or confirming there is no such option.
Cheers
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
No. But remember that the carriage control is always the first character of the record. So you can do a simple post process such as:
perl -np -i.bak -e 's/^.(.*)/$1/' downloaded.file
to remove the first column. I like this because the result is the original file renamed to have a .bak on the end and the changed file back into the original name. An alternate might be:
cut -b 2- <downloaded.file >downloaded.file.new
mv downloaded.file downloaded.file.bak
mv downloaded.file.new downloaded.file
if you don't want the backup in the second example, just don't bother with the first mv command. The second mv will then removed the "downloaded.file" before renaming "downloaded.file.new" to "downloaded.file".
There is likely an equivalent way in other languages as well.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM
Unless, of course, you are a competitor :-)
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-...@bama.ua.edu] On Behalf Of Donald Russell
Sent: Monday, November 23, 2009 10:37 AM
To: IBM-...@bama.ua.edu
Subject: FTP PUT RECFM=FBM files
Cheers
NOTICE: This electronic mail message and any files transmitted with it are intended
exclusively for the individual or entity to which it is addressed. The message,
together with any attachment, may contain confidential and/or privileged information.
Any unauthorized review, use, printing, saving, copying, disclosure or distribution
is strictly prohibited. If you have received this message in error, please
immediately advise the sender by reply email and delete all copies.
What bug? ftp sends the data as it is in the file. Now, with RECFM=xxA, and the SITE ASA option, then ftp will translate the ASA control characters to "proper ASCII" printer control characters.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM
----------------------------------------------------------------------
I was just hoping that when IBM taught it to handle //DD: , they might have
added an option to not transmit the CC character when the file is
RECFM=..A|M
It's not a HUGE deal for me, I was just hoping to writ ethe file once
instead of having a secondary process on Linux ... Though I may do it on MVS
before the send... IEBGENER FBM to FB... I *think* that will strip the CCs
for me...
1) create a Perl script likeunto (put it in ~/bin/strip1.pl; chmod it to be executable )
#!/usr/bin/perl
use strict;
use warnings;
my $fh;
if (1 != scalar(@ARGV)) { exit(1);} #exactly 1 argument
my $ofile=pop(@ARGV);
open($fh,'>',$ofile) or exit(2); #file didn't open!
while(<>) {
chomp;
s/^.(.*)$/$1/; # remove first character
# $_=substr($_,1) if length > 0 # alternate to above regexp.
print $fh "$_\n";
}
close($fh);
in the Linux ftp client:
get remote.file |"~/bin/strip1.pl remote.file"
will read "remote.file" from the server and pipe it to ~/bin/strip1.pl. That will then write it to the file specified: "remote.file", removing the first character from each line.
Since you mentioned FTPS, which is encrypted during transmission, have you considered Co:Z? It can do file transfers over an SSH channel. And it has some pluses. In particular, you could run the following type code:
//STEP1 EXEC COZPROC,
// ARGS='us...@remote.linux'
//INFILE DD DISP=SHR,DSN=input.file
//STDIN DD *
fromdsn '//DD:INFILE' |\
cut -b 2- >file.on.linux
/*
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM
> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:IBM-...@bama.ua.edu] On Behalf Of Donald Russell
> Sent: Monday, November 23, 2009 2:49 PM
> To: IBM-...@bama.ua.edu
> Subject: Re: FTP PUT RECFM=FBM files
>
How's this for convoluted? ;-)
From MVS, I can FTP PUT a file with the name of the dataset I want the linux
machine to get...
Then, on Linux I use inotify to trigger the FTP GET from Linux... using the
pipe as you suggest to remove incoming CC chars as they arrive.
The down side? Sometimes that dataset is a tempooary file that does live
past the batch job execution time.
Or, from MVS I could IEBGENER it to SYSOUT,DEST=(zLinux VM machine) and read
the darn thing through the reader on linux... vmur seems to remove the CC
characters.
Well, I'll let this simmer... it's not urgent.
Thanks for the suggestions and confirmation that the IBM FTP client doesn't
have an option for this.
Cheers?
On Mon, Nov 23, 2009 at 13:39, McKown, John
<John....@healthmarkets.com>wrote:
Or, instead of inotify, use ProFTPD instead of vsftpd. ProFTPD gives you the ability to run a script(s) after the reception of a particular file or into a particular subdirectory.
--
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM
----------------------------------------------------------------------