how can i Rename the 200+ jobs.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
him121
Premium Member
Premium Member
Posts: 55
Joined: Sat Aug 07, 2004 1:50 am

how can i Rename the 200+ jobs.

Post by him121 »

hi..
all
i have to rename some 200+ jobs..
can any one know any shortcut method.

thanx in advance..but this is very urgent for me.

him
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

Rename them using the DataStage Manager. I know this seems slow but if it takes 10 seconds per job then you will be done in about half an hour.

There is a fast way of doing it by exporting to a flat file, doing a search and replace to add/change/remove common text in job names such as suffixes and prefixes, and importing it again. With import and export times this will probably take at least 30 minutes and then debugging and fixing the problems it causes could take hours.

So we end up back at the manual job rename.
rasi
Participant
Posts: 464
Joined: Fri Oct 25, 2002 1:33 am
Location: Australia, Sydney

Post by rasi »

Hi

You can also update the job name in Universe by saying the following commands.

UPDATE DS_JOBS SET NAME = 'NEWNAME' WHERE NAME = 'OLDJOBNAME';

UPDATE DS_JOBOBJECTS SET NAME = 'NEWNAME' WHERE NAME = 'OLDJOBNAME';

If you have your 200 jobs then create the dynamic script by using editor and paste the script in the universe and run. Make sure you taken the backup of your project before trying this

Thanks
Siva
Regards
Siva

Listening to the Learned

"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Changes to DS_JOBOBJECTS are not required.

Siva is showing you the form of the 200+ update statements you could use in place of the 200+ changes using Manager or Designer! :lol:

If there is a systematic change to be made (as a silly example you might want to name your jobs JOB0001, JOB0002, and so on), you could create a DataStage job that would do it. Otherwise, you're up for 200+ manual changes: no short cut.

Make very sure you have a backup before you muck about with DS_JOBS because absolutely everything in the Run Time part of the Repository depends on the name to number mapping in the DS_JOBS table.

Code: Select all

CREATE.FILE DS_JOBS_COPY DYNAMIC
COPY FROM DS_JOBS TO DS_JOBS_COPY ALL OVERWRITING
A less silly example might be to replace one string with another in all job names. For example all your jobs are named Load... and you wanted them to be renamed Transfer... - in this case you could use the Ereplace function in the DataStage job.

Or, in SQL:

Code: Select all

UPDATE DS_JOBS SET NAME = 'Transfer' || SUBSTRING(NAME FROM 5) WHERE NAME LIKE 'Load%';
At this point, none of your job sequences work any more, and none of your job control code works any more, and none of your calls to functions like UtilityRunJob work any more.

Effecting the same changes within the design time objects for these is a far more difficult proposition, and relies on knowledge about how design time objects are stored in the DataStage Repository that is not in the public domain. Of course, if you have no job sequences, job control routines or calls to UtilityRunJob, you're laughing (but are probably in the early phases of development or using third party scheduling tools).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply