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: 12
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: 1674
Location: Tirupur

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: 2274
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: 1674
Location: Tirupur

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: 12
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 Executing Linux Shell Script from Mai... yuvan All Other Mainframe Topics 1 Fri Jan 17, 2020 4:24 pm
No new posts FTP to SFTP for JCL submission from M... yuvan All Other Mainframe Topics 1 Tue Dec 31, 2019 12:22 pm
This topic is locked: you cannot edit posts or make replies. SFTP Locsite - Co:Z SFTP yuvan All Other Mainframe Topics 5 Thu Dec 26, 2019 2:21 pm
No new posts Sharepoint to mainframe indransec DB2 5 Tue Dec 10, 2019 1:54 pm
No new posts Enabling Crosshair cursor in mainframe priya_t23 TSO/ISPF 2 Wed Nov 06, 2019 11:29 am

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