Mass update for all stage names - Crazy or possible?

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
Tampa_Indy
Participant
Posts: 23
Joined: Tue Aug 04, 2015 12:45 pm

Mass update for all stage names - Crazy or possible?

Post 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!
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Welcome aboard.

Have you ever tried editing dsx files?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post 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.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post 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 ;
Tampa_Indy
Participant
Posts: 23
Joined: Tue Aug 04, 2015 12:45 pm

Post 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?
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post 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.
Choose a job you love, and you will never have to work a day in your life. - Confucius
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post 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.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
Tampa_Indy
Participant
Posts: 23
Joined: Tue Aug 04, 2015 12:45 pm

Post by Tampa_Indy »

Finally figured out this dsx file creation process. Thank you all for the help and suggestions!
vamsi_4a6
Participant
Posts: 95
Joined: Wed Jun 04, 2014 12:06 am

Post by vamsi_4a6 »

I have similar requirement but not sure how to edit dsx file.could you please help on this
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Start your own topic.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply