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

IEHPROGM - HOW TO RENAME A PDS ?


IBM Mainframe Forums -> IBM Tools
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
WagnerBil

New User


Joined: 12 Jul 2007
Posts: 1
Location: Brazil

PostPosted: Wed Aug 12, 2015 6:08 pm
Reply with quote

PLEASE I AM HAVING PROBLEMS WITH PDS RENAME OF THE IEHPROGM AS ATTACHMENTS. COULD HELP ME?

AWAITING...
THANK YOU!

icon_rolleyes.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8570
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 12, 2015 6:31 pm
Reply with quote

The syntax, from the manual, is
Code:
RENAME DSNAME=name,VOL=device=(list),NEWNAME=name
Your utility control statements do not match the manual. Change them to match the manual.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Wed Aug 12, 2015 6:33 pm
Reply with quote

Trusty reference-work wrote:
IEH202I
INVALID KEYWORD OR CONTROL STATEMENT SYNTAX
Explanation

In the utility statement preceding this message, the required keyword is incorrect, or the continuation does not start in column 16.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 883
Location: The Universe

PostPosted: Wed Aug 12, 2015 7:40 pm
Reply with quote

As Mr. Sample says, the syntax of your IEHPROGM control statement does not match the manual. IEHPROGM is extremely picky about this.

Using IEHPROGM to rename a cataloged or SMS managed data set has all sorts of issues that can lead a beginner into trouble. Something like this is much simpler and safer.
Code:
//RENAME  PROC DSN='?',NEWNAME='?'
//TSO     EXEC PGM=IKJEFT01,
//             PARM='RENAME ''&DSN'' ''&NEWNAME'''
//SYSTSPRT DD  SYSOUT=*
//SYSTSIN  DD  DUMMY
//        PEND
//TEST    EXEC RENAME,
//             DSN='xxx',
//             NEWNAME='yyy'
This JCL defines an instream cataloged procedure that executes TSO in batch to run the TSO RENAME command through the EXEC statement PARM parameter.

When I started with System/360 47 years ago uncataloged data sets were much more common than now; using IEHPROGM to manipulate the VTOC was quite common. Now uncataloged data sets are very rare, so using IEHPROGM is very unusual.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 500
Location: London

PostPosted: Wed Sep 09, 2015 12:33 am
Reply with quote

DFDSS (ADRDSSU) is also a more reliable way to rename as it takes care of things like VSAM components and associations.
This example assume the dataset is cataloged and will let SMS decide where the newname version will be allocated.

Code:
//STEP EXEC PGM=ADRDSSU
//SYSPRINT DD SYSOUT=*
//SYSIN       DD *
 COPY ALLE ALLD(*) TGTA(SRC) CAT DEL TGTGDS(ACTIVE) -
  SHR TOL(ENQF) -
  DS(INC( -
               P0BSXH.BXP.FONTES.ADMR.NEW -
               )) -
  RENAMEU( P0BSXH.BXP.FONTES.ADMR.NEW -
                  P0BSXH.BXP.FONTES.ADMR.TESTE )



For uncataloged datasets it becomes a physical copy so extra parameters are required for the volsers, and some like CAT (short for catalog) may be removed

INDYNAM(volser)
OUTDYNAM(volser)
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Sep 09, 2015 7:13 pm
Reply with quote

Also, IDCAMS can be used to rename datasets or PDS(E) files.
Back to top
View user's profile Send private message
Pete Wilson

Active Member


Joined: 31 Dec 2009
Posts: 500
Location: London

PostPosted: Wed Sep 09, 2015 7:52 pm
Reply with quote

anything but IEHPROGM is probably the advice emerging here I suspect!
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 883
Location: The Universe

PostPosted: Wed Sep 09, 2015 9:21 pm
Reply with quote

Pete Wilson wrote:

anything but IEHPROGM is probably the advice emerging here I suspect!


Yes, IEHPROGM is not a good choice to rename a data set. I think all of us white beards will pretty much agree.

Mr. Heize's observation about IDCAMS is pretty much on target, though I think in some respects the TSO RENAME command is safer. RENAME will handle the situation when the data set's high level qualifier moves the data set entry to a different catalog. IDCAMS ALTER NEWNAME will not do this correctly. The effect will be to lose the data set.
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 -> IBM Tools

 


Similar Topics
Topic Forum Replies
No new posts Rename dasd IBM Tools 11
No new posts IEHPROGM ENQUEUE OVERRIDE JCL & VSAM 4
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 How to use REXX to rename list of VSA... CLIST & REXX 10
Search our Forums:

Back to Top