Dovetailed Technologies Solutions Support Contact Us

4. Using the Co:Z sftp client

An enhanced sftp client (cozsftp) for z/OS is also included in the Co:Z toolkit. This client can be used to initiate transfers with a remote host and supports the same set of file transfer options as the Co:Z sftp server. The cozsftp command is installed in the $COZ_HOME/bin directory.

4.1 Starting the Co:Z sftp client on z/OS

$ export PATH=/opt/dovetail/coz/bin:$PATH 1
$ cozsftp user@host
Co:Z sftp version: 1.1.0 (5.0p1) 2008-10-20
Copyright (C) Dovetailed Technologies, LLC. 2008. All rights reserved.
Connecting to host...
user@host's password: ***** 
cozsftp>
1

Add the Co:Z binaries directory to your PATH. This is not necessary if symbolic links from /bin were created during installation.

4.2 Setting, displaying and clearing file transfer options

The enhanced client introduces two new commands:

lzopts [-a] [option=value,...]

The lzopts command is used to set local (client) file transfer options. These options are set prior to initiating file/dataset transfers from z/OS to a remote host.

zopts [-a] [option=value,...]

The zopts command is used to set server file transfer options -- if the server is a Co:Z sftp server. The zopts command is functionally equivalent to the ls /+<option_list> command used by existing clients to set Co:Z sftp-server file transfer options.

Multiple options can be set by separating the option=value pairs with commas. An error is returned if one or more of the options was incorrectly specified, but the remaining options are set as requested.

The active options and their settings can be displayed by issuing the commands without arguments. The -a option can be specified to list all available options, even those that are not active.

[Note]Note

For compatibility with IBM Ported Tools SFTP, the cozsftp command recognizes the following additional subcommands: ascii and binary. these subcommands are treated as synonyms for lzopts mode=text and lzopts mode=binary respectively.

Client session options are determined in the following priority order:

  1. The fixed: section of /etc/ssh/cozsftp_config (highest priority and non-modifiable)

  2. The first matching pattern (if any) from $HOME/.ssh/cozsftp_config

  3. The first matching pattern (if any) from /etc/ssh/cozsftp_config

  4. Previous interactive commands: lzopts (described below) in the same session

  5. The environment variable SFTP_ZOS_OPTIONS

  6. The default: section of /etc/ssh/cozsftp_config (lowest priority)

For a list of available options, see Appendix A, Co:Z SFTP options.

For a description of the cozsftp_config file format, including how to specify file name patterns, see Appendix B, Session config files.

Example: Setting and displaying local (client) transfer options

cozsftp> lzopts mode=text     1
 mode=text
cozsftp> lzopts     2
clientcp=IBM-1047    loglevel=I           mode=text     
servercp=IBM-1047
1

The local option command lzopts mode=text is used to set the transfer mode to text. mode=binary is the default.

2

The local option list command lzopts shows the options currently in effect. In this case, the codepages clientcp and servercp are set to the defaults.

Example: Setting multiple local options

sftp> lzopts lrecl=80,recfm=fb,space=trk.3.2     1
 lrecl=80,recfm=fb,space=trk.3.2
1

Multiple options can be specified, separated by commas. Note that the SPACE parameter uses periods for commas to avoid ambiguity.

Example: Showing all local options

cozsftp> lzopts -a      1
clientcp=IBM-1047  linerule=flexible  loglevel=I        lrecl=80            
mode=text          overflow=wrap      recfm=fb          servercp=IBM-1047   
space=trk.3.2      NOallowmount       NOblksize         NObufno             
NOcopies           NOdataclas         NOdest            NOdir               
NOdisp             NOdsorg            NOforms           NOgdgnt             
NOhold             NOlabel            NOlike            NOmaxvol            
NOmgmtclas         NOnorecall         NOoutdes          NOrelease           
NOretpd            NOsequence         NOshowall         NOspin              
NOstorclas         NOsysout           NOtrim            NOtrtch             
NOucount           NOunit             NOvol             NOwriter
1

The option command lzopts -a is used to show all of the available options, even those that are not currently active.

4.3 Coordinating Transfer Options with a Co:Z SFTP Server

The enhanced Co:Z sftp client can connect to any sftp server, including a Co:Z SFTP server. In this case, there are two sets of transfer options in effect; the enhanced client's and the server's. Client side (local) options are controlled via the lzopts command. Server side (remote) options are controlled via the zopts command.

When transferring POSIX files between a z/OS server and z/OS client, using the default mode=binary transfer option both locally and remotely will usually yield the desired results. If codepage translations need to take place, the desired clientcp, servercp and mode=text can be set either locally (via lzopts command) or remotely (via the zopts command). The other side can be left in mode=binary.

When transferring datasets between a z/OS server and z/OS client, it is generally recommended that linerule=rdw be used for binary transfers so that record mode boundaries are preserved.

When converting from dataset to POSIX file between a z/OS server and z/OS client, the transfer options should be set where the dataset resides.

4.4 Working with Datasets

The Co:Z implementation of sftp accepts two prefix strings to identify MVS datasets as absolute paths. The first (//) is consistent with IBM's common usage. A secondary form (/-/) is also available.

Navigating Datasets

The sftp lcd command can be used to navigate around the z/OS dataset space. Using the dataset prefix // or /-/, the dataset space can be entered. Once there, traversal up and down various dataset levels can be performed similarly to hierarchical file systems.

Partitioned datasets are treated as directories as well. Once a PDS is made the current working directory, its members can be listed and retrieved like normal files.

Just as listing the entire catalog from the root is not allowed, it is not possible to make the catalog root the current working directory. As such, the command lcd // will fail.

Example: Navigating the dataset space

sftp> lcd //user     1
sftp> lpwd     2
Local working directory: //USER
sftp> lcd coz.testjcl     3
sftp> lpwd
Local working directory: //USER.COZ.TESTJCL
sftp> lcd ..     4
sftp> lpwd
Local working directory: //USER.COZ
1

Using the dataset prefix //, the high level qualifier user is specified. For lcd commands, the dataset name is case insensitive.

2

The lpwd command will list the current working dataset level. Note that the name is properly displayed in uppercase

3

Multiple levels can be traversed at a time. Instead of using the normal separator (.), a slash can be used: lcd coz/testjcl.

4

The lcd .. command will move up a level, as expected.

Transferring Datasets

The get and put commands are used to transfer datasets and PDS members.

Any options previously set via the lzopts are in effect for any given transfer.

Example: Get a file to a text sequential dataset

$ sftp user@linux.com     1
Connecting to linux.com...
user@linux.com's password:
sftp> lzopts mode=text     2
 mode=text
sftp> lzopts    
clientcp=IBM-1047    loglevel=I           mode=text            
servercp=ISO8859-1
sftp> get /tmp/GPGDSN //USER.GPGDSN     3
Fetching /tmp/GPGDSN to //USER.GPGDSN
ZosDataset[I]: Opening dataset USER.GPGDSN for write with options: new catalog
/tmp/GPGDSN                              100% 1215     1.2KB/s   00:00    
ZosDataset[I]: Closing dataset //USER.GPGDSN - 1215 bytes received, 15 records written
ZosSmf119Record[I]: SMF Type119 recording not enabled; SMF recording disabled
1

This example shows the full connection process, using keyboard-interactive password authentication to a remote linux system.

2

The default transfer mode of binary is overridden and set to text.

3

The get command uses the dataset path prefix // (or, optionally /-/) to specify that a dataset is to be written. At the default log level of I (INFO), information is emitted about the transfer process. Note also that in this case, SMF recording is disabled because the FTP SMF records (type 119) are not currently configured for recording.

Example: Get a text file to a PDS member

sftp> lzopts     1
clientcp=IBM-1047     loglevel=I     mode=text     
servercp=ISO8859-1
sftp> lcd //user.coz.testjcl 
sftp> lpwd
Local working directory: //USER.COZ.TESTJCL
sftp> get /tmp/GPGDSN     2
Fetching /tmp/GPGDSN to //USER.COZ.TESTJCL/GPGDSN
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(GPGDSN) for write with options: old
/tmp/GPGDSN                                             100% 1215     1.2KB/s   00:00    
ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(GPGDSN) - 1215 bytes received, 15 records written
1

If this transfer is performed after the prior example, the transfer mode will still be text. Using the lzopts command quickly confirms the active options.

2

The get command uses the dataset path prefix // and pds member name in parentheses to identify the member to create.

Example: Put PDS members

sftp> lpwd
Local working directory: //USER.COZ.TESTJCL
sftp> put ONETEST /tmp/ONETEST     1
Uploading ////USER.COZ.TESTJCL(ONETEST) to /tmp/ONETEST
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(ONETEST) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(ONETEST) - 38 records read, 3078 bytes sent

sftp> put //USER.coz.testjcl     2
Uploading //USER.COZ.TESTJCL(@@README) to /tmp/@@README
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(@@README) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(@@README) - 34 records read, 2754 bytes sent
Uploading //USER.COZ.TESTJCL(ALLOCDS) to /tmp/ALLOCDS
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(ALLOCDS) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(ALLOCDS) - 6 records read, 486 bytes sent
Uploading //USER.COZ.TESTJCL(CHKENVD) to /tmp/CHKENVD
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(CHKENVD) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(CHKENVD) - 1 records read, 81 bytes sent
Uploading //USER.COZ.TESTJCL(CHKPOST) to /tmp/CHKPOST
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(CHKPOST) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(CHKPOST) - 6 records read, 486 bytes sent
Uploading //USER.COZ.TESTJCL(CHKPRE) to /tmp/CHKPRE
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(CHKPRE) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(CHKPRE) - 72 records read, 5832 bytes sent
Uploading //USER.COZ.TESTJCL(COZCFGO) to /tmp/COZCFGO
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(COZCFGO) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(COZCFGO) - 1 records read, 81 bytes sent
Uploading //USER.COZ.TESTJCL(GPGDSN) to /tmp/GPGDSN
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(GPGDSN) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(GPGDSN) - 15 records read, 1215 bytes sent
Uploading //USER.COZ.TESTJCL(ONETEST) to /tmp/ONETEST
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(ONETEST) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(ONETEST) - 38 records read, 3078 bytes sent
Uploading //USER.COZ.TESTJCL(TESTPROC) to /tmp/TESTPROC
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(TESTPROC) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(TESTPROC) - 111 records read, 8991 bytes sent
Uploading //USER.COZ.TESTJCL(USERTEST) to /tmp/USERTEST
ZosDataset[I]: Opening dataset USER.COZ.TESTJCL(USERTEST) for read with options: shr

ZosDataset[I]: Closing dataset //USER.COZ.TESTJCL(USERTEST) - 187 records read, 15147 bytes sent
1

The put command can be used to transfer a member from a fully qualified dataset.

2

When the put command is used on a PDS, all of the members are uploaded.

Listing datasets and PDS directories

MVS datasets can be listed using the sftp lls command. Partitioned datasets are treated as directories with their members as entries.

When listing z/OS datasets locally with the lls command, catalog search filter keys are in effect for any wildcard requests. The catalog search wildcards *, **, and % used in the examples below are described in the IBM manual DFSMS: Managing Catalogs - SC26-7409. Note that this is different behavior from sftp clients that connect to the Co:Z sftp-server and list datasets with the ls. In that case, regular file globbing rules are in effect.

Example: Listing datasets

sftp> lcd //USER
sftp> lls -al     1
Volume  Referred  Ext  Tracks    Used Recfm Lrecl BlkSz Dsorg  Dsname
WORK84 2008/09/05   1       1       1  FB      80 27920  PS    USER.AFILE.TXT                              
WORK81 2008/09/08   1      30       ?  U        0  6144  PO-E  USER.COZ.LOADLIB                            
WORK81 2008/09/11   1      15       4  FB      80 27920  PO    USER.COZ.SAMPJCL                            
WORK84 2008/09/11   1       1       1  U        0  6144  PS    USER.COZ.TEST.SEQ                           
WORK81 2008/09/09   1      15       3  FB      80 27920  PO    USER.COZ.TESTJCL

sftp> lls -al //user.coz.t*     2
Volume  Referred  Ext  Tracks    Used Recfm Lrecl BlkSz Dsorg  Dsname
WORK81 2008/10/20   1      15       4  FB      80 27920  PO    USER.COZ.TESTJCL 

sftp> lls -al //user.c*.**     3
Volume  Referred  Ext  Tracks    Used Recfm Lrecl BlkSz Dsorg  Dsname
WORK81 2008/10/20   1      30       ?  U        0  6144  PO-E  USER.COZ.LOADLIB                            
WORK81 2008/10/20   1      15       4  FB      80 27920  PO    USER.COZ.SAMPJCL                            
WORK84 2008/09/25   1       1       1  U        0  6144  PS    USER.COZ.TEST.SEQ                           
WORK81 2008/10/20   1      15       4  FB      80 27920  PO    USER.COZ.TESTJCL
1

The long form of the list command ls -al will list detailed information from the catalog about each dataset.

2

Using the catalog search filter key syntax, a single asterisk can be used to as a wildcard for a single dataset level.

3

Using the catalog search filter key syntax, a double asterisk can be used to perform a deep listing. In this example, the single and double asterisk syntax is combined to list all of the datasets beginning with the prefix USER.C.

Example: Listing a PDS directory

...
sftp> lcd //user.coz.sampjcl     1
sftp> lls -al     2
Name           Size  Created         Changed          ID
@@README 
BPXBATCH         13 2008/04/04 2008/04/04 17:18:09  USER   
BPXBATSL         16 2008/04/03 2008/04/03 10:36:52  USER   
COZCFGD          65 2008/03/27 2008/05/12 14:28:54  USER   
COZPROC          30 2008/03/27 2008/03/27 11:54:48  USER   
DTLSPAWN         40 2008/05/05 2008/05/05 09:31:08  USER   
GPGDSN           15 2008/05/05 2008/05/05 10:40:05  USER   
GREPDSN  
GREPSED          12 2008/05/05 2008/05/05 09:30:51  USER   
OFFLDSMF 
RUNCOZ           20 2008/03/27 2008/05/12 14:08:02  USER   
RUNCOZ2          15 2008/05/05 2008/05/05 10:02:51  USER   
RUNCOZ3           8 2008/05/05 2008/05/06 08:50:37  USER   
RUNSPAWN         54 2008/05/12 2008/05/12 14:25:37  USER   
RUNSPWN2         20 2008/05/12 2008/05/12 13:19:05  USER   
TDIRK            18 2008/04/03 2008/04/03 10:19:20  USER   
WGET2DSN
1

The lcd command is used to make a PDS the current working local "directory".

2

The lls -al command (long list form) is used to display the members of the PDS, including available statistics.

4.5 Working with POSIX files

This section describes how to use the enhanced client with POSIX files (HFS, zFS) on z/OS. Standard sftp implementations (including IBM's ported tools version) support only binary mode file transfers. The Co:Z implementation provides binary transfer mode by default, but also supports text mode transfers. Text mode transfers are controlled via the following options:

  • mode: when set to text causes file transfers to be text based.

  • clientcp and servercp: When text mode is active, these settings determine the codepage translation that will take place. The default client code page is ISO8859-1. The default server code page is the current z/OS locale.

  • linerule: When text mode is active, this setting determines how line separators are converted between the client and server.

Transferring Files

The get and put commands are used to transfer POSIX files (either on HFS or zFS filesystems).

The options (listed above) that have been previously set via the lzopts are in effect for any given transfer. All other options (used for dataset support) are ignored for POSIX file transfers.

Example: Get a text POSIX file

$ sftp user@linux.com     1
Connecting to linux.com...
user@linux.com's password: *****
sftp> lzopts mode=text,servercp=UTF-8     2
 mode=text         servercp=UTF-8  
sftp> lzopts     3
clientcp=IBM-1047    loglevel=I           mode=text            
servercp=UTF-8
sftp> pwd
Remote working directory: /tmp
sftp> get msgs.txt     4
Fetching /tmp/msgs.txt to msgs.txt
/tmp/msgs.txt                                        100%   19KB  19.0KB/s   00:00    
ZosPosixFile[I]: Closing file msgs.txt - 19488 bytes received, 19488 bytes written5    
sftp>
1

This example shows the full connection process, using keyboard-interactive password authentication to a remote linux system.

2

The default transfer mode of binary is overridden and set to text. Additionally, the server (linux) code page is explicitly set to UTF-8.

3

Displays the active options. Note that the client code page, if not explicitly set, defaults to the current z/OS locale.

4

The get command requests the transfer of the POSIX file using the options in effect.

5

Upon completion, an informational message is written that describes the number of bytes received from the server and the number of bytes written to the local file. These counts are commonly the same, but changes in line separators and codepages can result in different counts.

Example: Put a text POSIX file

sftp> put sftp-server.log /tmp     1
Uploading sftp-server.log to /tmp/sftp-server.log
sftp-server.log                                  100%  127     0.1KB/s   00:00    
ZosPosixFile[I]: Closing file sftp-server.log - 127 bytes read, 127 bytes sent
ZosSmf119Record[I]: SMF Type119 recording not enabled; SMF recording disabled
1

The client text file sftp-server.log is put to the remote directory /tmp. The active file transfer options are used.

4.6 Using the Co:Z sftp client in batch

The cozsftp client command can be conveniently used in a z/OS batch job without user interaction. The COZBATCH batch utility, also installed as part of the Co:Z toolkit, makes it easy to run cozsftp (or other Unix shell scripts) directly as z/OS batch jobs.

The authentication with the remote system must be set up so as not to require any user interaction. There are three ways to do this with OpenSSH:

  • Use the SSH_ASKPASS environment variable to point to a program that will read a password.

  • Use an OpenSSH public/private keypair.

  • Use a RACF Digital Certificate.

For details on these three authentication options, see Appendix E, Client Authentication Mechanisms. Note that instructions in this appendix must be followed in order to run the examples described below.

Example: Co:Z sftp client batch job with a password

The RUNSFTP sample JCL distributed with the Co:Z toolkit can be used as a tailorable model for running the sftp client in a batch job.

//RUNSFTP EXEC PGM=COZBATCH  1
//STDIN DD *   2
                                                                            
# Customize these ... 3
coz_bin="/opt/dovetail/coz/bin" 
ruser="uid" 
server="remote.host.name" 
servercp="ISO8859-1" 
rfile="/path/to/file" 
                                                                            
# These can be used to read the ssh password from a (secured) dataset 
# if you don't want to setup public/private keypairs  4 
export PASSWD_DSN='//HLQ.PASSWD(SITE1)' 
export SSH_ASKPASS=$coz_bin/read_passwd_dsn.sh 
export DISPLAY=none 
                                                                            
ssh_opts="-oBatchMode=no"      # allows ssh to use SSH_ASKPASS program 
ssh_opts="$ssh_opts -oConnectTimeout=60" 
ssh_opts="$ssh_opts -oServerAliveInterval=60" 
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no" # accept initial host keys 
                                                                            
# Invoke the Co:Z sftp client with an in-line batch of commands 
# that downloads a remote file to a local DD.   
# Note that "-oBatchMode=no" must be specified before "-b" 
#      since ssh opts are first-sticky 
                                                                            
$coz_bin/cozsftp  $ssh_opts -b- $ruser@$server <<EOB  5 
lzopts mode=text,servercp=$servercp 
get $rfile //DD:DOWNLOAD  6 
EOB                                
//DOWNLOAD DD DSN=&&DOWNLOAD,DISP=(NEW,DELETE), 
//           DCB=(...),SPACE=(...)
// 
1

The COZBATCH utility is similar to IBM's BPXBATCH, but runs a Unix login shell in the original address space.

2

The STDIN DD is used to read a shell script as input to the z/OS Unix shell. This script will contain the setup and execution of Co:Z sftp in batch.

3

Customize these variables for your needs.

4

The following variables are set so that the ssh password is read from a z/OS dataset. Alternatively, an OpenSSH keypair can be used.

5

The Co:Z sftp client is invoked with the -b- option, which indicates that a "batch" of commands should be read from stdin. The shell "here" document redirection is used to read stdin from the shell script itself.

6

The sftp get command is used to get a remote file and write it to DD DOWNLOAD. Alternatively, the syntax //HLQ.MY.DATASET could have been used to download to a dynamically allocated dataset.

Example: Co:Z sftp client batch job with a RACF Digital Certificate

The RUNSFTPK sample JCL distributed with the Co:Z toolkit can be used as a tailorable model for running the sftp client in a batch job with certificates.

Note: A RACF Digital Certificate must be setup for the user prior to running this example. See the Co:Z customization section of the Co:Z Toolkit User's Guide for details.

//RUNSFTP EXEC PGM=COZBATCH
//STDIN DD *
                                                                            
# Customize these ...
coz_bin="/opt/dovetail/coz/bin" 
ruser="uid" 
server="remote.host.name" 
servercp="ISO8859-1" 
rfile="/path/to/file" 
                                                                            
ssh_opts="-oConnectTimeout=60" 
ssh_opts="$ssh_opts -oServerAliveInterval=60" 
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no" # accept initial host keys 
                                                                            
# Invoke the Co:Z sftp client with an in-line batch of commands 
# that downloads a remote file to a local DD.   
# Note that "-k MY-RING" will cause cozsftp to use the Co:Z
# saf-ssh-agent to authenticate the ssh client using the user's
# RACF Digital Certificate in MY-RING 
                                                                            
$coz_bin/cozsftp $ssh_opts -k MY-RING -b- $ruser@$server <<EOB   1
lzopts mode=text,servercp=$servercp 
get $rfile //DD:DOWNLOAD 
EOB 

//DOWNLOAD DD DSN=&&DOWNLOAD,DISP=(NEW,DELETE), 
//           DCB=(...),SPACE=(...)
// 
1

The -k MY-RING option is used to specify the RACF keyring to use for certificate authentication.

Example: Using saf-ssh-agent to run remote SSH commands

The RUNSFTPS is similar to the previous example, but performs a put rather than a get. After the result of the put is checked, the saf-ssh-agent command is used to invoke ssh to process the new remote file.

Note: A RACF Digital Certificate must be setup for the user prior to running this example. See the Co:Z customization section of the Co:Z Toolkit User's Guide for details.

//RUNSFTP EXEC PGM=COZBATCH
//STDIN DD *
                                                                            
# Customize these ...
coz_bin="/opt/dovetail/coz/bin" 
ruser="uid" 
server="remote.host.name" 
servercp="ISO8859-1" 
rfile="/path/to/file" 
                                                                            
ssh_opts="-oConnectTimeout=60" 
ssh_opts="$ssh_opts -oServerAliveInterval=60" 
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no" # accept initial host keys 
                                                                            
# Invoke the Co:Z sftp client with an in-line batch of commands 
# that uploads a local dataset to a remote file and then runs
# ssh to invoke a remote command to process the uploaded file   
# Note that "-k MY-RING" will cause cozsftp to use the Co:Z
# saf-ssh-agent to authenticate the ssh client using the user's
# RACF Digital Certificate in MY-RING 
                                                                            
$coz_bin/cozsftp $ssh_opts -k MY-RING -b- $ruser@$server <<EOB 1
lzopts mode=text,servercp=$servercp 
put //DD:UPLOAD $rfile
EOB 

if [ $? -eq 0 ]; then
    $coz_bin/saf-ssh-agent -c MY-RING ssh $ruser@$server /bin/chk $rfile 2
fi

//UPLOAD DD DSN=HLQ.UPLOAD.DATA,DISP=SHR 
// 
1

The -k MY-RING option is used to specify the RACF keyring to use for certificate authentication.

2

After checking for a successful upload, the saf-ssh-agent command is used to invoke the ssh client to perform some action /bin/chk on the remote file.

Copyright 2009 Dovetailed Technologies, LLC. All rights reserved.