View previous topic :: View next topic |
Author |
Message |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Oct 25, 2007 5:35 am Post subject: Rename a PS file in JCL |
|
|
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 |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Thu Oct 25, 2007 5:40 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu Oct 25, 2007 6:01 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
 |
nadh Intermediate
Joined: 08 Oct 2004 Posts: 192 Topics: 89
|
Posted: Thu Oct 25, 2007 6:22 am Post subject: |
|
|
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 |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Thu Oct 25, 2007 6:29 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Oct 25, 2007 1:58 pm Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Mon Oct 29, 2007 10:19 am Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Tue Jan 26, 2010 4:49 pm Post subject: |
|
|
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 |
|
 |
|
|