cozclient on Linux invoke FTP on z/os

Discussion of Dovetailed Technologies Dataset Pipes tools
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

cozclient on Linux invoke FTP on z/os

Post by tsdjim » Tue Mar 12, 2013 1:48 pm

I have a binary dataset on Linux already in a z/os codepage and I need to FTP this to a FTP server. I cannot use FTP on Linux as the file is not in the Linux locale.

Normally I would use todsn -b to send this to z/OS and then FTP it from there. I want to use cozclient on Linux to do this but I need the correct syntax to do this.

Something like cat linux.file | cozclient ftp......

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozclient on Linux invoke FTP on z/os

Post by dovetail » Wed Mar 13, 2013 9:04 am

If I understand it, you need to run the FTP client on z/OS, using a file that is on Linux.

Piping your data into the z/OS FTP client won't work - it won't accept a file that way.

One way would be to run a two-step jop on z/OS. The first would transfer the file from Linux to z/OS, maybe to a temporary data set. You could use Co:Z Launcher for this, targeting the Linux box. In the second step you could run z/OS FTP.

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: cozclient on Linux invoke FTP on z/os

Post by tsdjim » Sat Mar 23, 2013 6:17 am

Is there a way to use iconv on Linux to change from source codepage 420 to the Linux codepage and then pipe it to ftp on linux?

Something Like:
icon -s IBM-420 linuxfile.txt > ftp ......

dovetail
Site Admin
Posts: 1848
Joined: Thu Jul 29, 2004 12:12 pm

Re: cozclient on Linux invoke FTP on z/os

Post by dovetail » Mon Mar 25, 2013 10:30 am

The ftp command doesn't accept a file as input, but you might be able to use the cURL command which supports the FTP protocol. cURL is available on both linux and z/OS (under IBM Ported Tools)

I'm not really clear as to where you are starting from and where you want to run FTP.
If you started with a Co:Z Launcher script running on Linux, and wanted to call back into the z/OS version of cURL, it would be something like:

Code: Select all

cat somefile.bin |
cozclient -ib  /usr/lpp/ported/bin/curl --ftp-pasv -T- ftp://rhost.com/somedir/somefile.bin
On the other hand, if you started with a Co:Z Launcher script to a remote Linux system and wanted to run cURL (FTP) from the Linux box using a z/OS dataset as input:

Code: Select all

fromdsn -b //DD:MYDD |
curl --ftp-pasv -T- ftp://rhost.com/somedir/somefile.bin
If you are going to try this, please test first using the cURL command interactively, using local file input and make sure that you have that working first before you test with Co:Z Launcher.

Post Reply