SFTP how to question

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

SFTP how to question

Post by usaajrm »

Hi,
This may not be the best approach. So, you are welcome to poke holes into. :-) What I need is an xml file on one distributed server to be copied to a second distributed server. Right now, I have a coz step running on the mainframe to execute the script that creates the xml. I'm thinking to stay within the same job, that I have a second step to execute a coz sftp process to copy the xml file from one machine to the other. I would like to know how to do that using a coz sftp step. I have given a little thought to add an sftp within the executing script but that involves sftp setup between the two distributed machines and I already have coz running against both machines and wanted to leverage it if possible. Any insight is appreciated, especially on eve of the New Year. Happy New Year to you. :-)
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP how to question

Post by dovetail »

Are you using Co:Z Launcher to execute the script on the first server that creates the XML?

If so, then in that same Co:Z Launcher shell script, you can copy the xml file back to a z/OS temporary data set (or file) using todsn.

Then, you can have a second Co:Z SFTP step that sends the file to the second server.

(Also, since you are an Enterprise Support customer, please consider opening a ticket).
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Re: SFTP how to question

Post by usaajrm »

Thanks for the response. How would I deal with the unknown record length of an xml file?

I'm not part of the support group that owns the Coz support information (including ids). And I find it takes much longer to work through them. I've asked for an id but have been denied because the support is based on a finite number of tickets allowed per year. Essentially, they guard them closely. lol
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP how to question

Post by dovetail »

If you are putting XML into a data set, then you have two choices:

- use newline characters in the XML to break logical records in the data set. Use RECFM=VB with LRECL >= than the longest that you expect.
You could use the "overflow=wrap" rule so that lines that are two long are broken onto multiple records, but this might cause problems if the break occurred in the middle of a tag name etc.

- use linerule=none so that the records are just filled up and record boundaries are ignored. The program that processes the XML would also have to ignore record terminators.


PS> We do not have any limit on the number of tickets that can be opened by a support customer.
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Re: SFTP how to question

Post by usaajrm »

Say, does todsn support writing to an OMVS file? Would this help guard against potentially long records?

ps. I have asked to talk with the primary contact for the coz software.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP how to question

Post by dovetail »

No, todsn does not support writing to Unix files
Post Reply