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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
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
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

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
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Operating Systems

From novice to tech pro — start learning today.