Problems with SFTP from Bitvize client

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
PaulB42
Posts: 27
Joined: Fri Aug 21, 2009 5:32 am

Problems with SFTP from Bitvize client

Post by PaulB42 »

We are having problems using Co:Z SFTP from a Bitvise Tunnelier client. Basically I can see that Co:Z SFTP is being invoked but it is not treating MVS datasets correctly.

The client is invoked as follows:

Code: Select all

sftpc -profile=TSGSFTP.tlp -cmdfile=TSGSFTP_parms.dat
TSGSFTP_parms.dat contains the following:

Code: Select all

lcd \Interfaces\AbbeyLife\LandingZone
cd //TSGSFTP
ls /+mode=text,lrecl=80,recfm=fb
put hello.txt //TSGSFTP.SFTP.CNTL.HELLO2 -fg -o
The customer sees this in the client window:

Code: Select all

sftp> lcd lcd \Interfaces\AbbeyLife\LandingZone
Local working directory: E:\Interfaces\AbbeyLife\LandingZone
sftp> cd //TSGSFTP
Remote working directory: //TSGSFTP
sftp> ls
listing remote directory /
sftp> ls /+mode=text,lrecl=80,recfm=fb
listing remote directory  /+mode=text,lrecl=80,recfm=fb
<<snip>>
sftp> put hello.txt //TSGSFTP.SFTP.CNTL.HELLO2 -fg -o
local:  E:\Interfaces\AbbeyLife\LandingZone
remote: /TSGSFTP.SFTP.CNTL.HELLO2
ERROR: Opening remote file failed: No such file. No such file.
In the log file for TSGSFTP I can see the following (with much debugging removed):

Code: Select all

Ý12.401¨ session opened for local user TSGSFTP from Ý10.xx.xxx.xxx¨    
Ý12.798¨ received client version 4              
Ý12.808¨ debug3: request 0: realpath            
Ý12.809¨ realpath "."                           
Ý12.811¨ debug1: request 0: sent names count 1  
Ý12.817¨ debug3: request 1: realpath            
Ý12.817¨ realpath "//TSGSFTP"                   
Ý12.856¨ debug1: request 1: sent names count 1  
Ý12.861¨ debug3: request 2: opendir             
Ý12.861¨ opendir "//TSGSFTP"                    
ZosDirÝT¨: -> open(TSGSFTP) 
ZosDirÝT¨: <- open(true)                             
Ý12.970¨ debug1: request 2: sent handle handle 0     
Ý12.976¨ debug3: request 3: close handle 0           
Ý12.976¨ closedir "//TSGSFTP"                        
Ý12.976¨ debug3: request 3: sent status 0            
Ý12.976¨ sent status Success                         
Ý12.977¨ debug3: request 4: opendir                  
Ý12.978¨ opendir "/TSGSFTP"                          
Ý12.979¨ debug3: request 4: sent status 2     
Ý12.979¨ sent status No such file             
Ý12.983¨ debug3: request 5: opendir           
Ý12.984¨ opendir "/"                          
Ý13.921¨ opendir "/+mode=text,lrecl=80,recfm=fb"   
Ý13.943¨ opendir "/TSGSFTP/TSGSFTP.SFTP.CNTL.HELLO2"    
Unfortunately the only access to the mainframe that I have myself is the mainframe itself. I have run a COZBATCH job that invokes Co:Z SFTP and connects to the mainfame, from the mainframe, using the TSGSFTP userid and can successfully send a z/OS file and create anothe z/OS file so I know Co:Z| is set up and working OK.

What are we doing wrong here?
lisa
Posts: 5
Joined: Tue Jan 08, 2013 1:39 pm

Re: Problems with SFTP from Bitvize client

Post by lisa »

The Bitvise sftpc client does not support //; however, the alternate method of using /-/ does work. Try changing your parms.dat file to the following:

lcd \Interfaces\AbbeyLife\LandingZone
cd /-/TSGSFTP
ls /+mode=text,lrecl=80,recfm=fb
put hello.txt /-/TSGSFTP.SFTP.CNTL.HELLO2 -fg -o

Note that our latest version, 2.3.0, has some fixes and new features to address client compatibility. We have also updated our documentation. Please see http://www.dovetail.com/docs/cozinstall/changes.html for a summary of changes.
PaulB42
Posts: 27
Joined: Fri Aug 21, 2009 5:32 am

Re: Problems with SFTP from Bitvize client

Post by PaulB42 »

Hello Lisa

Thanks for the advice. This has sort of worked, but not completely as I expected.

put hello.txt /-/TSGSFTP.SFTP.CNTL.HELLO2 has resulted in the creation of a dataset called TSGSFTP.SFTP.CNTL.HELLO2.HELLO.TXT. Is this what you would expect? We were expecting just TSGSFTP.SFTP.CNTL.HELLO2. It appears to have appended the Windows file name to the end of the dataset.

ls /+mode=text,lrecl=80,recfm=fb seems to have worked (the new dataset was created as fb/80 and the file was transferred as text), but it then goes on to try and list the string as if it was a directory as per my first post.

Code: Select all

listing remote directory /+mode=text,lrecl=80,recfm=fb
-r--r--r--    1  no-user     no-group                 mode=text
-r--r--r--    1  no-user     no-group                 lrecl=80
-r--r--r--    1  no-user     no-group                 recfm=fb
lisa
Posts: 5
Joined: Tue Jan 08, 2013 1:39 pm

Re: Problems with SFTP from Bitvize client

Post by lisa »

It is possible that you need to use our full qualified data set name. See http://www.dovetail.com/docs/sftp/dsn-d ... ation.html.

Please try the following: put hello.txt /-/!TSGSFTP.SFTP.CNTL.HELLO2

Note that the ls /+ listing is as expected. The listing is showing the options set. If there is an error with an option being set, the bad option will be preceded with a question mark.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: Problems with SFTP from Bitvize client

Post by dovetail »

Also, check the Bitvise SFTP client documentation - does the "put" command expect that the second argument is the file name or the "directory"?
PaulB42
Posts: 27
Joined: Fri Aug 21, 2009 5:32 am

Re: Problems with SFTP from Bitvize client

Post by PaulB42 »

Thanks very much for your help! Adding a ! before the dataset name did indeed resolve this :D
Post Reply