Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SFTP from Linux to Mainframe

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
yuvan

New User


Joined: 10 Jan 2006
Posts: 20
Location: India

PostPosted: Fri Jan 10, 2020 4:44 pm    Post subject: SFTP from Linux to Mainframe
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: 1686
Location: Tiruppur, India

PostPosted: Fri Jan 10, 2020 10:57 pm    Post subject:
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: 2312
Location: Hampshire, UK

PostPosted: Sat Jan 11, 2020 5:24 am    Post subject: Reply to: SFTP from Linux to Mainframe
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: 1686
Location: Tiruppur, India

PostPosted: Sat Jan 11, 2020 6:28 am    Post subject:
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: 20
Location: India

PostPosted: Mon Jan 13, 2020 12:08 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Need help on DB2 load in Mainframe subratarec DB2 5 Tue Mar 24, 2020 2:08 am
No new posts Mainframe Storage HSM upendrasri IBM Tools 5 Thu Feb 20, 2020 5:51 pm
No new posts mainframe ps file to unix box alpit All Other Mainframe Topics 4 Fri Feb 07, 2020 11:19 am
No new posts Issue in SFTP a file yuvan All Other Mainframe Topics 1 Tue Feb 04, 2020 6:08 pm
No new posts SFTP to a Unix Pipe file yuvan All Other Mainframe Topics 4 Tue Jan 28, 2020 9:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us