Portal | 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: 1690
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: 2419
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: 1690
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 Mainframe jcl job with href links not... steven bynum All Other Mainframe Topics 3 Fri Aug 28, 2020 10:02 pm
No new posts A very ingenious mainframe automation... hefiproject.de CA Products 1 Thu Aug 13, 2020 2:59 pm
No new posts How to remove remote file older than ... ssuthagar All Other Mainframe Topics 4 Thu Jun 04, 2020 6:26 am
No new posts How to Assign a Function key to Mainf... upendrasri TSO/ISPF 4 Sat May 30, 2020 9:03 pm
No new posts Mainframe ISPREDIT Macro query upendrasri TSO/ISPF 3 Wed May 27, 2020 1:12 pm

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