IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SFTP from Linux to Mainframe


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
yuvan

New User


Joined: 10 Jan 2006
Posts: 23
Location: India

PostPosted: Fri Jan 10, 2020 4:44 pm
Reply with quote

HI Team ,

We need to SFTP a file from Linux to mainframe , We are able to SFTP a file from Linux to mainframe , but the file craeted in mainframe has Lrecl = 0 and RECFM as U .
Code:
 Data class . . . . . : DCNULL   
  Organization  . . . : PS       
  Record format . . . : U       
  Record length . . . : 0       
  Block size  . . . . : 6144     


Linux Script
Code:
#params
#parm01 mvshostname
#parm02 username
#parm03 password
#parm04 jclstream
#par05 jobname
#par06 TRN name

FILENAME=$1
SFTPHOST=$2
SFTPUSERID=$3
SFTPPASSWORD=$4
aliasname=$5

#jobname=$5

# Calculate RecordLength, Record Count and Cylinders for the file
#RECORDLEN=`head -1 $LOCALPATH/$FILENAME | wc -c`
#RECORDLEN=`expr $RECORDLEN - 1`
#RECORDCOUNT=`wc -l $LOCALPATH/$FILENAME | cut -d" " -f1`
#$FPCBIN/figspace $RECORDLEN $RECORDCOUNT > figspace_response.$$
#pri=`cat figspace_response.$$ | cut -d" " -f1`
#sec=`cat figspace_response.$$ | cut -d" " -f2`
#rm figspace_response.$$ > /dev/null 2> /dev/null


dttm=`/usr/bin/date '+ %m/%d/%Y|%H:%M:%S|'`
#echo $SFTPHOST
#echo $SFTPUSERID
#echo $SFTPPASSWORD
#echo $FILENAME
#echo $jobname
/usr/bin/expect << EOF > sftpput.$aliasname.log
set timeout -1
spawn /usr/bin/sftp $SFTPUSERID@$SFTPHOST
expect "password:"
send -- "$SFTPPASSWORD\r"
expect "sftp> "
send -- "put $FILENAME //$FILENAME\r"
#expect "sftp> "
#send -- "ls -al\r"
expect "sftp> "
send -- "quit\r"
EOF

Could you plase lt us know how to pass the LRECL and RECFM in the above script.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Fri Jan 10, 2020 10:57 pm
Reply with quote

Hello,
Do you know what SFTP product is being used on the Mainframe end?
Is it something like VFTP or Co:Z SFTP?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2453
Location: Hampshire, UK

PostPosted: Sat Jan 11, 2020 5:24 am
Reply with quote

As per his previous posts it is Co:Z SFTP
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Sat Jan 11, 2020 6:28 am
Reply with quote

Thanks Nic.

Try something like this
Code:
ls /+lrecl=80,recfm=fb,space=trk.3.2


To see the current settings in effect for SFTP, you could use the below steps,
Code:
ls /+showall
cd /+
ls
Back to top
View user's profile Send private message
yuvan

New User


Joined: 10 Jan 2006
Posts: 23
Location: India

PostPosted: Mon Jan 13, 2020 12:08 pm
Reply with quote

Thanks a lot , this works fine .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts SFTP replacement for LOCSITE ASA in FTP All Other Mainframe Topics 7
No new posts Looking for mainframe system programmers Mainframe Jobs 0
No new posts Proc print in Mainframe All Other Mainframe Topics 4
No new posts Need opinion on mainframe to cloud mi... General Talk & Fun Stuff 6
No new posts Looking for Mainframe Project Manager Mainframe Jobs 0
Search our Forums:

Back to Top