Page 1 of 1

Hash File Creation in a different location

Posted: Tue May 01, 2007 8:39 pm
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.

Posted: Tue May 01, 2007 9:05 pm
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:

Posted: Tue May 01, 2007 9:08 pm
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:

Posted: Tue May 01, 2007 9:10 pm
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"

Posted: Tue May 01, 2007 9:14 pm
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:

Posted: Tue May 01, 2007 9:19 pm
by ray.wurlod
:idea: This is a much easier task if your export includes default property values.

Posted: Mon May 21, 2007 1:29 pm
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.

Posted: Wed Jun 06, 2007 1:03 pm
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.