View previous topic :: View next topic
|
Author |
Message |
yuvan
New User
Joined: 10 Jan 2006 Posts: 23 Location: India
|
|
|
|
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 |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
As per his previous posts it is Co:Z SFTP |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
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 |
|
|
yuvan
New User
Joined: 10 Jan 2006 Posts: 23 Location: India
|
|
|
|
Thanks a lot , this works fine . |
|
Back to top |
|
|
|