Hash File Creation in a different location

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
bdstage
Charter Member
Charter Member
Posts: 59
Joined: Mon Apr 03, 2006 4:59 pm

Hash File Creation in a different location

Post by bdstage »

Hi all,

We have projects which contain hundreds of jobs which loads the hash files. All these server jobs are created in such a way that they will be creating the hash files in the default location which is the project directory.

We are trying to increase the DR capability of our environment and one obvious task is to create all the hash files for a particular project in one unified location.

I want to find out whether there is any easy way of doing this for example by exporting the entire project into a DSX or XML file and doing a search and replace for a specific pattern.

I used the search utility and did not find any related topics for this.

Thanks in advance for the replies.

Thanks,
Pavan.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I haven't had to do this, but if I did this is the approach I would take:

Export a single job that uses an account based hashed file. Change one hashed file stage to be pathed with your parameter of choice. Export the changed job. Examine the differences. From that, determine the feasibility and level of effort required to do an entire project 'search and replace' operation and how automated that process could be. This could either be something done by hand or you could even write a DataStage job (or awk/perl/whatever script?) to parse the export and apply the changes before writing out a new file.

Not saying it would be easy or even faster than doing the manual monkey work - just saying that's the approach I'd take to scope it. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

nick.bond wrote:From doing a quick test the difference between a hashed file using the account and one using dir path is an additional line

Directory "/mydir/"
It should be parameterized and I assume the parameter won't exist in any of the jobs yet. Keep that in mind as a need for this procedure.

Hmmm... a rouge process, eh? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Further to my previous reply, i could have been more help. you are looking for these records
BEGIN DSRECORD
Identifier "V0S0"
DateModified "1899-12-30"
TimeModified "00.00.01"
OLEType "CHashedFileStage"
Readonly "0"
Name "Hashed_File_0"
NextID "2"
OutputPins "V0S0P1"
Directory "/mydir/"
UVcompatible "0"
SQLNull "0"
StageType "CHashedFileStage"
END DSRECORD
and you need to add the line
Directory "/mydir/"
for DSRECORDs where
OLEType "CHashedFileStage"
Regards,

Nick.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

very good point Craig, that adds a whole nother level......

...also do you not see RED when a ROGUE process kills your project ... :oops:
Regards,

Nick.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: This is a much easier task if your export includes default property values.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bdstage
Charter Member
Charter Member
Posts: 59
Joined: Mon Apr 03, 2006 4:59 pm

Post by bdstage »

Hello All,

Thanks for your valuable inputs.

Ray, I guess I did not understand what you said correctly.

Nick and Craig, I followed what you said and here is what I found out so far.

I picked up a sample job with just one transformer stage and a hashed file stage. I exported the job into a DSX file one time where the hash file will be created in the default project directory. Next time, I exported the job after changing the option so that it will be created in a seperate defined directory.

There is a considerable difference in both the DSX files. The code in the DSX file with directory added increased by 100 lines.

I even tried exporting the job into an XML file and here the difference is only one line which contains the directory where the hashed file will be created.

I will try to parse the XML file and make the necessary changes.

Thanks a lot!!
Pavan.
bdstage
Charter Member
Charter Member
Posts: 59
Joined: Mon Apr 03, 2006 4:59 pm

Post by bdstage »

In the last post I said that I will be doing these changes by means of XML file. But I am finding it difficult to make the necessary changes. :(

The property value that need to be changed here is the Directory option where the property is stage type and the value is CHashedFileStage.

I am trying to do this in Ascential by means of real time XML stages, but could not.

Will this can be done in this way? Or is there any better way of doing this? Please let me know.

Thanks for your replies!!

Thanks,
Pavan.
Post Reply