Page 1 of 1

How to move/copy files from one directory to other via ishell or OMVS

Posted: Fri Sep 18, 2015 3:16 am
by demecarv
As a very beginner in Mainframe, I have to move certain files from usr/MyCompany/MyApp/parentFolder/innerFolder to usr/MyCompany/MyApp/parentFolder/, just move files to one level up in the directory tree. Firstly, I though it was going to be quite easy, just by chosing "ISPF Primary Option Menu", 6 Commands (Enter TSO or Workstation commands), open either a shell via ish command or MVS prompt via OMVS command and type cp usr/MyCompany/MyApp/parentFolder/innerFolder usr/MyCompany/MyApp/parentFolder/. Unfortunately, although the command from Unix/Linux perspective is correct it is not working probably because I missed some steps related to mainframe. Other tentative I tried was by browsing the directory and type c on left side. I could see the message copied but I don't know how paste it in other directory. I am sure I am close to do it but I probably miss one extra step. Could someone point me that?

Re: How to move/copy files from one directory to other via ishell or OMVS

Posted: Fri Sep 18, 2015 4:04 am
by nicc
What does "not working" mean i.e. what messages are displayed?

Re: How to move/copy files from one directory to other via ishell or OMVS

Posted: Fri Sep 18, 2015 6:21 am
by Robert Sample
Have you looked up the cp command in the Unix System Services Command Reference manual? When I did, I found a statement that Unix directory to Unix directory copies (such as what you attempted) are NOT allowed unless the -R or -r option is specified. If there are sub-directories involved, use the -R option. Otherwise, I would use

Code: Select all

cp usr/MyCompany/MyApp/parentFolder/innerFolder/* usr/MyCompany/MyApp/parentFolder/
since the asterisk indicates you are not copying directory to directory, but files to a directory. I have not tested this to verify it works, but I've done hundreds of Unix copies (files to files, files to directories, wildcarded files to directories and so forth) and IIRC that's the way I usually copy files.

Re: How to move/copy files from one directory to other via ishell or OMVS

Posted: Sat Sep 19, 2015 2:40 am
by demecarv
I understand that there are several ways to copy/rename/delete/move files in mainframe.
By opening either (1) ishel or (2) omvs console will accept Unix/Linux commands. By using omvs, after Robert commented above, I am able to copy it (I was missing -R). But I am still unable to do the same via ishel. In ISPF Command Shell, I type ish. Then, in Unix System Services ISPF Shell, I write the exact same command used succesfuly in omvs but I get this answer "Errno=81x No such file or directory exists; Reason=0594003D...". Only as a try, I type cd /usr and same answer. Wouldn't ishel allow me the same unix command?