IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to rename a datset using tso rename from mvs uss?


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Thu Jun 14, 2007 5:12 am
Reply with quote

I have a mainframe dataset @XXXX.YYY.ZZZ and I want to rename this dataset from the mvs uss unix shell using the tso rename command to @XXXX.YYY.WWW. How can I achieve this? Thanks in advance.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 14, 2007 6:33 am
Reply with quote

Hello,

How familiar are you with standard UNIX (i.e. HP-UX, AIX, Sun, etc) commands?

It has been a while, but i believe you can issue the UNIX mv command to rename files in USS. I'd create a test file and test with that before trying to do anything with your "real" file. "mv" is for "move, but it was how we renamed files on UNIX boxes i supported.

Assuming that you have sufficient permissions, you would issue
mv '@XXXX.YYY.ZZZ' '@XXXX.YYY.WWW'
at the unix prompt.

To repeat, i'd surely try it on some file created just for this test before trying the actual file.
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Thu Jun 14, 2007 8:25 am
Reply with quote

No. You cannot rename them like that. In fact you will not be able to list the MVS datasets using the ls command either. You need to use tso listcat command to view cataloged MVS datasets. The only way you can view contents of MVS datasets using cat commands is like this:

cat "//'<dataset>'"

But this notation does not work with ls or mv commands.
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Thu Jun 14, 2007 8:28 am
Reply with quote

I tried
mv "<dataset>" "<datasetnew>"

and

mv '<dataset>' '<datasetnew>'

but it did not work. Also I tried the same with tso rename command. That did not work too.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 14, 2007 8:51 am
Reply with quote

Hello,

Please clarify "did not work". Was any error information provided?

I seem to recall actually having done this
Quote:
you will not be able to list the MVS datasets using the ls command
at a prior location. If i've not complete lost track, listing "directories" and changing "directories worked as it had on real UNIX boxes. What kind of error info did you get using ls? Keep in mind that there may be permission issues. I had all of "the keys to the kingdom" on that system.

Might there be differences in the USS implementation from place to place?
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Thu Jun 14, 2007 11:40 am
Reply with quote

Hello and sorry.

Actually this thing worked:

mv "//'<dataset>'" "//'<dataset_new>'"

Thanks a lot. Could not have got it w/o your help.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 14, 2007 6:01 pm
Reply with quote

You're welcome icon_smile.gif
Back to top
View user's profile Send private message
kc.karthik

New User


Joined: 15 Apr 2007
Posts: 8
Location: Foster City, CA

PostPosted: Sun Jun 17, 2007 12:59 am
Reply with quote

Hi,

The previous mv command that I used works but the problem is it creates the new dataset with max record length whereas the original dataset that I am renaming is just 450 bytes.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jun 17, 2007 8:04 am
Reply with quote

Hello,

I have seen something similar when i ftp data from "real" unix or a win-based system to a mainframe. Often, the generated dcb info does not match the data. In those cases, i've found that having the dataset pre-allocated on the mainframe with the desired dcb info gets around the mis-match. There may be a way to set this in the ftp session, but i've not spent time looking for it - mostly my data transfers are from the mainframe, not to it.

How often will you need to rename/mv a uss file for use in mvs?

You might talk with your system support people who deal with uss and ask if there is/are some uss variable(s) that you can assign value(s)s to prior to exdecuting the mv that would control the data length generated.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts what is the DSORG(Datset orgnisation)... JCL & VSAM 8
No new posts Rename dasd IBM Tools 11
No new posts Error during restore rename All Other Mainframe Topics 2
No new posts Generic rename by pattern‏ CLIST & REXX 6
No new posts IEHPROGM - HOW TO RENAME A PDS ? IBM Tools 7
Search our Forums:

Back to Top