Page 1 of 1

Mass update for all stage names - Crazy or possible?

Posted: Tue Aug 04, 2015 12:57 pm
by Tampa_Indy
Is it possible to complete a mass update of stage type objects names for all our DataStage jobs?

For example, if we wish to update all the CDC names from different names we currently have listed (e.g. CDC_Q, cdcNow, RT_CDC, etc.) to just CDC. How can we accomplish this versus going into each job and updating the text? We have a few thousand jobs, so updating the names for each stage would be very time intensive.

Many thanks in advance!

Posted: Tue Aug 04, 2015 2:28 pm
by priyadarshikunal
Welcome aboard.

Have you ever tried editing dsx files?

Posted: Tue Aug 04, 2015 3:42 pm
by chulett
Yah, that seems like the only possibly viable approach. Meaning you export the entire project and then make passes through the export doing pattern matching / updating strings for all of the names you noted. Then re-import the edited export and cross your fingers. Or better yet import into a new project to see what damage you have done.

Of course, make sure you have plenty of backups on hand.

Posted: Wed Aug 05, 2015 6:52 am
by priyadarshikunal
Yeah, the reason to ask whether OP has prior experience is because possibility to do damage to the project grows higher.

As already noted, have a backup in safe place before you start with editing. Its a good idea to import it in a fresh project and compile all objects to see if it was done correctly.

Posted: Wed Aug 05, 2015 3:41 pm
by rkashyap
If this helps OP in planning ... StageName and StageType present in the job can extracted from

Code: Select all

Select J.DSNAMESPACE_XMETA Server_DSProject,
       J.CATEGORY_XMETA Category,
       J.NAME_XMETA JobName,
       S.STAGETYPE_XMETA StageType,
       S.NAME_XMETA StageName,
       S.STAGETYPECLASSNAME_XMETA
 From XMETA.DATASTAGEX_DSSTAGExxxxxxxx S,
      XMETA.DATASTAGEX_DSJOBDEFxxxxxxxx J
Where S.CONTAINER_RID = J.XMETA_REPOS_OBJECT_ID_XMETA
Or if needed, more metadata (including stage-name, stage-type, associated links etc) can be parsed from column LAZYLOADINFO_XMETA of following query

Code: Select all

Select J.DSNAMESPACE_XMETA Server_DSProject,
       J.CATEGORY_XMETA Category,
       J.NAME_XMETA JobName,
       D.LAZYLOADINFO_XMETA
 From XMETA.DATASTAGEX_DSJOBDEFxxxxxxxx J,
      XMETA.DATASTAGEXDSDESIGNVIEWxxxxxxxx D
Where J.XMETA_REPOS_OBJECT_ID_XMETA = D.XMETA_LOCKINGROOT_XMETA ;

Posted: Tue Sep 01, 2015 1:56 pm
by Tampa_Indy
priyadarshikunal wrote:Have you ever tried editing dsx files?
Never, would not know how to even begin doing so. Would that adjust the files and all dependencies across the DataStage environment?

Posted: Tue Sep 01, 2015 2:27 pm
by qt_ky
From a Designer menu, you can export DataStage components. It creates a DSX file on your Windows client. Export each whole project. Select the export option to exclude executables.

Save all those DSX files as backups. Now you're dangerous, because you know how to begin.

Then you can very carefully find and replace all occurrences of old names to new names in each copy of each DSX file. This can be done outside of DataStage by using any decent text editor.

Then back in Designer, you can import the modified DSX files into new, empty projects (so that you don't accidentally damage any jobs in the existing projects), run the multi-job compile utility to compile all jobs, and test them out.

This is all at your own risk. I would recommend finding someone who has done it before rather than having someone brand new to the tool.

Posted: Wed Sep 02, 2015 10:39 am
by FranklinE
I've done it. Some randomly generated thoughts...

My naming discipline is very strict. All names, sequences and parallel jobs, follow a repeating (and sub-repeating) pattern that made editing very straightforward.

I have a job activity stage in every sequence that runs a parallel job. If that's true in your design, you must export sequences with parallel jobs or your activity stage will break.

I keep a "master inventory" design document (Excel document), with an accurate listing of all job names. It became my handy checklist to make sure the edits were complete.

Review the changes, review them again, and get two or more people to review it as well. No matter how careful I was, others found "misses" for me.

Regardless of the size of the project, keep everything in one .dsx file. You avoid duplication of effort and have everything in one place to keep your edits "honest".

Exclude executables. I can't emphasize that too much. That also means you will take advantage of the multi-job compile wizard, which is also your final check for missed edits.

Edit: I used SlickEdit. It's powerful and somewhat intuitive to use.

Posted: Tue Sep 08, 2015 7:59 am
by Tampa_Indy
Finally figured out this dsx file creation process. Thank you all for the help and suggestions!

Posted: Tue Sep 08, 2015 10:09 am
by vamsi_4a6
I have similar requirement but not sure how to edit dsx file.could you please help on this

Posted: Tue Sep 08, 2015 10:57 am
by chulett
:!: Start your own topic.