MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Rename a PS file in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Oct 25, 2007 5:35 am    Post subject: Rename a PS file in JCL Reply with quote

Hi,

Anyone..could you please let me know the jcl to rename a file in job, .i.e., through job.

Cheers!!!
Nadh
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Thu Oct 25, 2007 5:40 am    Post subject: Reply with quote

nadh,

How about this:

Code:


//STEP0100  EXEC  PGM=SORT                       
//SYSOUT    DD SYSOUT=*                           
//SORTIN    DD DSN=your file
//             DISP=(OLD,DELETE,KEEP)
//SORTOUT   DD DSN=your new file
//             DISP=(NEW,CATLG,DELETE),DCB=*.SORTIN,
//             SPACE=(CYL,(10,10),RLSE),               
//             UNIT=DISK                             
//SYSIN     DD *
   SORT FIELDS=COPY
//*


_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Oct 25, 2007 6:01 am    Post subject: Reply with quote

nadh,

Thru IDCAMS you can rename.

Code:
//S10    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                             
 ALTER old.file.name -                                     
        NEWNAME(new.file.name)                         
//


Last edited by vkphani on Thu Oct 25, 2007 6:33 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Oct 25, 2007 6:04 am    Post subject: Reply with quote

Using IEBCOPY or ADRDSSU also you can rename.

http://www.mvsforums.com/helpboards/viewtopic.php?t=3183&highlight=adrdssu


Last edited by vkphani on Thu Oct 25, 2007 6:36 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Thu Oct 25, 2007 6:22 am    Post subject: Reply with quote

Hi,

I want to just rename a file. Is there any way to use tso rename command in JCL. for eg. I want to rename sr.* to BT.*.

Cheers!!!
Nadh
Back to top
View user's profile Send private message Send e-mail
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Thu Oct 25, 2007 6:29 am    Post subject: Reply with quote

Nadh,

If you want to use TSO RENAME 'sr.*' 'BT.*' you can use a rexx program. In JCL I don't think you can use this command.
I am not sure why you wanna use only TSO RENAME command. Solutions given by Vivek and myself are nothing but JCL solutions.
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Oct 25, 2007 1:58 pm    Post subject: Reply with quote

To use TSO rename you have to invoke TSO in batch - execute program IKJEFT01. You should find the necessary JCL in one of the TSO manuals or just look at one of your batch jobs that executes a DB2 program.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Mon Oct 29, 2007 10:19 am    Post subject: Reply with quote

Look at utility IEHPROGM to do a rename:
Code:
//RENAME1  EXEC PGM=IEHPROGM                                           
//SYSPRINT DD   SYSOUT=*                                               
//DD4 DD VOL=SER=volume,DISP=OLD,UNIT=3390                             
 RENAME  DSNAME=old.name,VOL=3390=volume,NEWNAME=new.name


IEHPROGM can also do PDS members and catalog/uncatalog files. Include a DD card for each DASD volume affected.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Tue Jan 26, 2010 4:49 pm    Post subject: Reply with quote

vkphani wrote:
nadh,

Thru IDCAMS you can rename.

Code:
//S10    EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                             
 ALTER old.file.name -                                     
        NEWNAME(new.file.name)                         
//
Beware of the ALTER command because the entry stays in the catalog aliased by "old" HLQ. The "new" HLQ may point to a different catalog so this file would NOT be found.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group