SFPT BYTE SIZE

Hi Experts,

How to accept the file 99 byte record lenght instead of 1020 byte long. I tried with this before PUT command, but in vain.
          echo "site recfm=fb lrecl=99 blocksi=0"

echo "FILE NAME :" ${FILE} >>${LOG_FILE}

         (
          echo "put ${FILE} //'DBGL.LYS.DAILY(+1)'"
          echo  "quit"
          ) | sftp ${FTP_USER}@${FTP_SERVER} >>  ${LOG_FILE}
          retcode=$?
          if test $retcode -ne 0
            then
             retcode=1
             echo "FTP FAILED" >> ${LOG_FILE}
             exit $retcode
          fi

Open in new window

victory_inAsked:
Who is Participating?
 
victory_inAuthor Commented:
Hi,

Finally it worked. I gave the code as below:::

echo "put ${FILE} /FTADV:P=WIN,O=FB,R=99/__'DBCOGLKP.XCELYS.MONTHLY(+1)'"
echo "FILE NAME :" ${FILE} >>${LOG_FILE}   
   
         (   
 echo "put ${FILE} /FTADV:P=WIN,O=FB,R=99/__'DBCOGLKP.XCELYS.MONTHLY(+1)'"          echo  "quit"   
          ) | sftp ${FTP_USER}@${FTP_SERVER} >>  ${LOG_FILE}   
          retcode=$?   
          if test $retcode -ne 0   
            then   
             retcode=1   
             echo "FTP FAILED" >> ${LOG_FILE}   
             exit $retcode   
          fi

Open in new window

0
 
giltjrCommented:
If this is truly sftp then there is no site command, that is only for ftp.  Since you appear to be doing sftp using MVS file attributes I am going to assume that the z/OS system you are going to has Dovetailed technologies Co:Z SFTP installed.

If that is true then you want to try:

ls /+lrecl=99,recfm=fb,blksize=0

You can go here for the user's guide for Dovetailed Technologies Co: Z SFTP product.

     http://dovetail.com/docs/sftp/sftp-doc.pdf
0
 
victory_inAuthor Commented:
Hi giltjr:,

It gave the following error. Please see the code below

Return code =  0
ls: /+lrecl=99,recfm=fb,blksize=0: No such file or directory
Connecting to mvsd10b.kpscal.org...
/home/xlsjob@wzxddb5$

echo "FILE NAME :" ${FILE} >>${LOG_FILE} 
 
         ( 
          ls /+lrecl=99,recfm=fb,blksize=0
          echo "put ${FILE} //'DBGL.LYS.DAILY(+1)'" 
          echo  "quit" 
          ) | sftp ${FTP_USER}@${FTP_SERVER} >>  ${LOG_FILE} 
          retcode=$? 
          if test $retcode -ne 0 
            then 
             retcode=1 
             echo "FTP FAILED" >> ${LOG_FILE} 
             exit $retcode 
          fi

Open in new window

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
victory_inAuthor Commented:
Hi,

I tried adding echo also before ls as below, but in vain. Please help me ASAP
echo "FILE NAME :" ${FILE} >>${LOG_FILE}  
  
         (  
          echo ls /+lrecl=99,recfm=fb,blksize=0 
          echo "put ${FILE} //'DBGL.LYS.DAILY(+1)'"  
          echo  "quit"  
          ) | sftp ${FTP_USER}@${FTP_SERVER} >>  ${LOG_FILE}  
          retcode=$?  
          if test $retcode -ne 0  
            then  
             retcode=1  
             echo "FTP FAILED" >> ${LOG_FILE}  
             exit $retcode  
          fi

Open in new window

0
 
giltjrCommented:
Is this a sftp server or a ftp server?

I know I have helped you in the past and sometimes you are going to a FTP server and sometimes a sftp server.

If this is a sftp server running on z/OS then it has to have Dovetailed Tech. Co:Z SFTP installed.

If this is a FTP server then you will want to do:

     quote site lrecl=99 blksize=0 recfm=FB

Can you logon to the server and post the results from the command:

     remotehelp

It is all one word "remotehelp"


0
 
victory_inAuthor Commented:
Hi giltjr:,

Yeah!!! I was testing first FTP. then they wanted Secured FTP.

Now I need SFTP to work, not FTP. Yes this sftp server

I logged onto the server and gave the command::

sftp> remotehelp
Invalid command.
sftp>
0
 
victory_inAuthor Commented:
it's FTPing the file, but records length 1020 and Variable BYTE. But they want 99 record length and FB (Fixed Byte). That's why my efforts are now.
0
 
giltjrCommented:
You will need to ask them how to do that.  What I gave you would work if they had the product I mentioned installed.

If they have something else, I have no clue how to get  it done.
0
 
tliottaCommented:
SFTP is technically unrelated to FTP. They use different servers and clients, different protocols and different communications ports. It is unfortunate that they both use the letters "FTP" in their abbreviated names.

That's not an attempted answer by any means, but it might begin to clear some confusion for the OP.

Since this is tagged with "AS400", there might be particular client-side facilities for specifying record/block lengths. I'm not strongly familiar with the AS/400 SSH implementations.

Tom
0
 
giltjrCommented:
O.K, not sure what version but they are running Tectia's SFTP for z/OS:

https://www.ssh.com/support/documentation/online/ssh/manual-zos/61/index.html

So for future reference you can go to that site to see what commands and options you can use.
0
 
victory_inAuthor Commented:
Thanks everybody on the loop
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.