Page 1 of 1

how can i Rename the 200+ jobs.

Posted: Wed Nov 10, 2004 5:46 pm
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

Posted: Wed Nov 10, 2004 7:09 pm
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.

Posted: Wed Nov 10, 2004 7:49 pm
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

Posted: Wed Nov 10, 2004 8:20 pm
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).