zOS to zOS sfttp allocating output on lfile not rfile

Discussion about community tools that we make available for z/OS without support
Post Reply
mklandrum
Posts: 3
Joined: Thu Nov 05, 2020 9:26 am

zOS to zOS sfttp allocating output on lfile not rfile

Post by mklandrum » Thu Jan 21, 2021 6:09 pm

Running the following job as first attempt using CoZ zOS to zOS. Using CERT authentication which is successful. Attempting to transfer a sequential file between LPAR's. Procedure opens the input lfile(MYDD) on source LPAR but then tries to open rfile(RMTDD) on same LPAR rather than target. Task fails with an open error. Obviously I'm doing something wrong. Running out of ideas, could use some help. Thanks
//SFTPGET EXEC PROC=SFTPPROC
//SFTPIN DD *
export COZ_LOG=T
cert="A009_COZ_KEYRING:CoZ-sftp-tplex-rsa"
user=A009
host=192.168.9.9
lzopts="mode=text"
lfile=//DD:MYDD
rfile=//DD:RMTDD
. $script_dir/sftp_put.sh

//RMTDD DD DSN=A009.SFTPPUT.DATA,DISP=(NEW,KEEP),
// DCB=(LRECL=80,RECFM=FB),SPACE=(CYL,(3,1))
//MYDD DD DSN=A009.TPLEX.MOVEDSN,DISP=SHR
//
Connect via saf-ssh-agent using SAF Certificate "A009_COZ_KEYRING:CoZ-sftp-tplex-rsa"...
Executing: /products/CoZ/bin/cozsftp -k A009_COZ_KEYRING:CoZ-sftp-tplex-rsa -v -oConnectTimeout=60 -oServerAliveInterval=60 -oNumbe
rOfPasswordPrompts=1 -oStrictHostKeyChecking=no -oPasswordAuthentication=no -oPubkeyAuthentication=yes -b- 'A009@192.168.9.9'
SpawnSafSshAgentÝT¨: -> spawnSafSshAgent()
SpawnSafSshAgentÝD¨: /MVST/products/CoZ/bin/saf-ssh-agent started, pid=33620107, sockpath=/tmp/sshauth.A009.16842880.EGefxQ
SpawnSafSshAgentÝD¨: SSH_AUTH_SOCK was created
SpawnSafSshAgentÝT¨: <- spawnSafSshAgent()
Co:Z SFTP version: 5.6.0 (6.4p1) 2019-08-20
Copyright (C) Dovetailed Technologies, LLC. 2008-2019. All rights reserved.
ZosUtilÝT¨: -> zos_log_region_size()
ZosUtilÝD¨: region size requested = 0K, Actual below/above limit = 9704K / 1442816K
ZosUtilÝT¨: <- zos_log_region_size()
Connecting to 192.168.9.9...
OpenSSH_6.4, OpenSSL 1.0.2h 3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Reading configuration data /etc/ssh/zos_ssh_config
debug1: zsshSmfSetConnSmfStatus: SMF status is 0
debug1: Connecting to 192.168.9.9 Ý192.168.9.9¨ port 22.
debug1: fd 3 clearing O_NONBLOCK
debug1: Connection established.
debug1: cipher_init: none from source OpenSSL, used in non-FIPS mode
debug1: cipher_init: none from source OpenSSL, used in non-FIPS mode
debug1: permanently_set_uid: 0/10
debug1: identity file /tmp/A009/.ssh/id_rsa type -1
debug1: identity file /tmp/A009/.ssh/id_rsa-cert type -1
debug1: identity file /tmp/A009/.ssh/id_dsa type -1

debug1: identity file /tmp/A009/.ssh/id_dsa-cert type -1
debug1: identity file /tmp/A009/.ssh/id_ecdsa type -1
debug1: identity file /tmp/A009/.ssh/id_ecdsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.4
debug1: match: OpenSSH_6.4 pat OpenSSH*
debug1: zsshGetKeyFromKeyRing: key retrieval from key ring 'SSHDAEM/SSH_Known_Hosts' label 'PenFed.ssh.DPLEX.server' succeeded, key
type is 'RSA'
debug1: zsshGetKeyFromKeyRing: key retrieval from key ring 'A009/A009_COZ_KEYRING' label 'CoZ-sftp-tplex-rsa' succeeded, key type i
s 'RSA'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: mac_setup_by_alg: hmac-sha1-etm@openssh.com from source CPACF, used in non-FIPS mode
debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none
debug1: mac_setup_by_alg: hmac-sha1-etm@openssh.com from source CPACF, used in non-FIPS mode
debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none
debug1: choose_kex: ecdh-sha2-nistp256 from source OpenSSL, used in non-FIPS mode
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA MD5 fp 37:af:b3:b6:91:f2:fb:ef:a6:9e:b1:e3:04:f6:35:96
debug1: zsshGetKeyFromKeyRing: key retrieval from key ring 'SSHDAEM/SSH_Known_Hosts' label 'PenFed.ssh.DPLEX.server' succeeded, key
type is 'RSA'
debug1: zsshGetKeyFromKeyRing: key retrieval from key ring 'A009/A009_COZ_KEYRING' label 'CoZ-sftp-tplex-rsa' succeeded, key type i
s 'RSA'
debug1: Host '192.168.9.9' is known and matches the RSA host key.
debug1: Found key in /etc/ssh/ssh_known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: cipher_init: aes128-ctr from source CPACF, used in non-FIPS mode
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: cipher_init: aes128-ctr from source CPACF, used in non-FIPS mode
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: A009_COZ_KEYRING CoZ-sftp-tplex-rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.9.9 (Ý192.168.9.9¨:22).
debug1: channel 0: new Ýclient-session¨
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending subsystem: sftp
Connected to 192.168.9.9.
Connection established, local_addr=10.43.102.15 local_port=1241 remote_addr=192.168.9.9 remote_port=22
ZosDatasetÝT¨: -> open("//DD:MYDD", 0x0002, 0x0000, , )
ZosSettingsÝI¨: Transfer options: clientcp=IBM-1047,mode=text,servercp=IBM-1047,trim
DatasetHandlerÝT¨: -> setDSN(DD:MYDD)
DatasetHandlerÝT¨: <- setDSN(effectiveDSN=DD:MYDD)
ZosDatasetÝI¨: Opening dataset DD:MYDD for read
DatasetHandlerÝT¨: -> open()
DatasetHandlerÝT¨: <- open()
ZosDatasetÝT¨: <- open()
Ý61.548¨ remote open("//DD:RMTDD"): Failure
ZosDatasetÝT¨: -> close(forced=0 writeError=0)
ZosDatasetÝI¨: Closing dataset //A009.TPLEX.MOVEDSN - 0 records read, 0 bytes sent
DatasetHandlerÝT¨: -> close()
DatasetHandlerÝT¨: <- close()
ZosDatasetÝT¨: <- close(rc=0)
ZosSmf119RecordÝI¨: User not authorized to BPX.SMF or BPX.SMF.119.3; SMF recording disabled
DatasetHandlerÝT¨: -> close()
DatasetHandlerÝT¨: <- close()
ZosUtilÝD¨: SSH process times: elapsed=1 secs, user cpu=0.110000 secs, sys cpu=0.040000 secs
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK

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

Re: zOS to zOS sfttp allocating output on lfile not rfile

Post by dovetail » Tue Jan 26, 2021 3:01 pm

You can not reference a DD in the client job step from the remote server. If the remote server is CO:Z, you will have to references the dataset by dsname.

mklandrum
Posts: 3
Joined: Thu Nov 05, 2020 9:26 am

Re: zOS to zOS sfttp allocating output on lfile not rfile

Post by mklandrum » Wed Jan 27, 2021 3:29 pm

Is there a JCL example I can reference for transferring files between z/OS systems using a keyring. I've read the doc several times and just can't seem to get a successful run.

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

Re: zOS to zOS sfttp allocating output on lfile not rfile

Post by dovetail » Thu Jan 28, 2021 11:52 am

Please see:

https://dovetail.com/docs/sftp/client.html#client-batch

specifically, the second example JCL which uses a keyring CERT.
Also, Appendix F has more details.

Post Reply