How to move/copy files from one directory to other via ishell or OMVS
How to move/copy files from one directory to other via ishell or OMVS
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
What does "not working" mean i.e. what messages are displayed?
Regards
Nic
Nic
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: How to move/copy files from one directory to other via ishell or OMVS
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 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.
Code: Select all
cp usr/MyCompany/MyApp/parentFolder/innerFolder/* usr/MyCompany/MyApp/parentFolder/
Re: How to move/copy files from one directory to other via ishell or OMVS
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?
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?
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute