System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

SFTPG3 rename command - issue

dhuk
Occasional Visitor

SFTPG3 rename command - issue

Hi, I am facing an issue with sftpg3 rename cmd. RENAME cmd is working fine if you don´t use any reference related to directories.

Example: rename filename.tmp fileother.dat (this works fine)

But, if you use rename /home2/filename.tmp /home1/fileother.dat/ it does not working anymore.

do anyone knows how this cmd works?

trying to send file from mainframe to seebeyond server (batch)

Thanks for any clue.
7 REPLIES
Steven Schweda
Honored Contributor

Re: SFTPG3 rename command - issue

> [...] from mainframe to seebeyond server
> (batch)

That tells me very little about the systems
involved. You're asking this in an HP-UX
forum. Is any of these systems running
HP-UX?

> But, if you use rename /home2/filename.tmp
> /home1/fileother.dat/ it does not working
> anymore.

"not working" is not a useful problem
description. Did you get an error message?

Are "/home1" and "/home2" different file
systems? On many systems, a rename operation
("mv", ...) is valid only within a file
system, not between file systems.

What happens if you try to rename between,
say, "/home2/filename.tmp" and
"/home2/filename.xxx", or
"/home2/dir1/filename.tmp" and
"/home2/dir2/filename.xxx", that is,
including "reference related to directories",
but _not_ trying to move off "/home2"?
dhuk
Occasional Visitor

Re: SFTPG3 rename command - issue

Thanks for the comments.

I have more information, see below:

These are the parameters used in SFTPG3 execution test.

cd /dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy/tmp/
ascii
sput //'FILE.APLIC.DATA1A' TSTDATA1A_20101104135500001.tmp

ren TSTDATA1A_20101104135500001.tmp +
/sbapp01/me11/proj/GMLDROPZ/MAINFR/MMI0250/OutBound/legacy +
/TSTDATA1A_20101104135500001.dat
quit

Result of the SFTPG3 execution:

Mainframe Job was interrupted by return code = R0256

Sysout of PROUT.STDOUTPR:

sftp> cd /sbapp01/me11/proj/GMLDROPZ/MAINFR/MMI0250/OutBound/legacy/tmp/
sftp> ascii
sftp> sput //'FILE.APLIC.DATA1A' TSTDATA1A_20101104135500001.tmp
'FILE.APLIC.DATA1A' | 370kB | 158.6kiB/s | TOC: 00:00:02
sftp> ren TSTDATA1A_20101104135500001.tmp +
sftp> /sbapp01/me11/proj/GMLDROPZ/MAINFR/MMI0250/OutBound/legacy +
sftp> /TSTDATA1A_20101104135500001.dat

Message:

Error: File with new name already exists
Error: Unknown command `/sbapp01/me11/proj/GMLDROPZ/MAINFR/MMI0250/OutBound/legacy´.
Error: Unknown command `/TSTDATA1A_20101104135500001.dat'.


Issue:

It seems that RENAME command is not understading the other two lines.
Rename command was split in 3 lines due to our solution and limitation of the environment.
So, do you know what is the right character or way that means the continuation of a command in other line for sftp?

The process needs to rename and move the file from /tmp/ to /legacy/.
dhuk
Occasional Visitor

Re: SFTPG3 rename command - issue

Please, consider these information. Thanks!

These are the parameters used in SFTPG3 execution test.

cd /dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy/tmp/
ascii

sput //'FILE.APLIC.DATA1A' TSTDATA1A_20101104135500001.tmp

ren TSTDATA1A_20101104135500001.tmp +
/dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy/tmp/ +
/TSTDATA1A_20101104135500001.dat

quit



Result of the SFTPG3 execution:

Mainframe Job was interrupted by return code = R0256

Sysout of PROUT.STDOUTPR:

sftp> cd /dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy/tmp/
sftp> ascii
sftp> sput //'FILE.APLIC.DATA1A' TSTDATA1A_20101104135500001.tmp
'FILE.APLIC.DATA1A' | 370kB | 158.6kiB/s | TOC: 00:00:02
sftp> ren TSTDATA1A_20101104135500001.tmp +
sftp> /dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy +
sftp> /TSTDATA1A_20101104135500001.dat


Message:

Error: File with new name already exists
Error: Unknown command `/dir001/ab11/proj/client/mainfr/intf250/OutBound/legacy´.
Error: Unknown command `/TSTDATA1A_20101104135500001.dat'.


Issue:

It seems that RENAME command is not understading the other two lines.
Rename command was split in 3 lines due to our solution and limitation of the environment.
So, do you know what is the right character or way that means the continuation of a command in other line for sftp?
Steven Schweda
Honored Contributor

Re: SFTPG3 rename command - issue

> It seems that RENAME command is not
> understading the other two lines.
> Rename command was split in 3 lines due to
> our solution and limitation of the
> environment.

My psychic powers are too weak to tell me
what "our solution" and "the environment"
might be. Or, for that matter, what "sftpg3"
is (or, if there's more than one version of
it, which version you might be using). I can
guess that it's an SFTP client program, but
that's only a guess.

> So, do you know what is the right character
> or way that means the continuation of a
> command in other line for sftp?

Knowing exactly nothing about what you're
doing where how with what, I'd guess "\".

Do you really expect to get useful (free)
advice if you answer no questions, and supply
almost no useful information about your
environment?

> The process needs to rename and move the
> file from /tmp/ to /legacy/.

As I tried to explain earlier, this may not
be possible, but, with no useful information,
it's hard to do more than guess.
dhuk
Occasional Visitor

Re: SFTPG3 rename command - issue

Okay!

my psychic powers are telling me that you are a really "nice" person that really "wants" to help.

so, thank you for your time, I have already solved the problem and for your information SFTPG3 is a native transaction of TECTIA 6.1.0.
Patrick Wallek
Honored Contributor

Re: SFTPG3 rename command - issue

>>I have already solved the problem

Can you please post what the solution was? In case anyone should come across this thread in the future knowing what the solution was could be helpful for them.
Steven Schweda
Honored Contributor

Re: SFTPG3 rename command - issue

> my psychic powers are telling me that you
> are a really "nice" person that really
> "wants" to help.

I could be the nicest person on the planet,
but there are limits to how helpful I can be
when given a problem description like "Using
an unidentified program which might be an
SFTP client, on an unidentified system,
connected to another unidentified system,
when I use some undisclosed command, I get
some kind of error, but I won't share the
details of the command or the message."

And then you don't answer simple questions.

What, exactly, did you expect?