Page 1 of 1

Creating categories

Posted: Tue Nov 08, 2005 4:27 am
by PhilHibbs
Is there a quick way to create a bunch of categories? Using the interface, I have to wait for DS to read the entire hierarchy every time I create a new category, and I regularly create a similar hierarchy of about 8 all at once. This is very tedious. Is there an Administrator command to create a category?

This is the kind of structure I use:

1.Site Name/1.Vendors/1.Extract
1.Site Name/1.Vendors/2.Transform\010
1.Site Name/1.Vendors/2.Transform\020
1.Site Name/1.Vendors/2.Transform\030
1.Site Name/1.Vendors/2.Transform\040
1.Site Name/1.Vendors/3.Load
1.Site Name/1.Vendors/4.Reports

I no longer use the _J01_, _J02_ job naming convention, but use the categories above to indicate execution sequence.

I'm thinking of creating a dummy job and exporting it, editing the exported file to change the category, and importing it again. I could even automate it, with a script that takes the category name, stuffs it into the export file, and then runs dsimport.exe.

Posted: Tue Nov 08, 2005 4:54 am
by kduke
Can you use a period or a backslash?

Well, anyway the categories are stored in DS_JOBS. You would need to hack one to figure out what it needs.

Posted: Tue Nov 08, 2005 4:54 am
by loveojha2
Hey may be its risky, use it at your own risk

If you want to create a parent directory named ABCD use:

INSERT INTO DS_JOBS(NAME,READONLY,CATEGORY) VALUES ('\\\ABCD','NRO','ABCD')

If a sub directory named ABC under ABCD use:

INSERT INTO DS_JOBS(NAME,READONLY,CATEGORY) VALUES ('\\\ABCD\ABC','NRO','ABCD\ABC')

Similarly you can build other Hierarchies.

You can write this within Administrator or with a Routine/Job Control also.

Hope this will help you. Remember its Hacking Only. :twisted:

Re: Creating categories

Posted: Tue Nov 08, 2005 5:44 am
by PhilHibbs
Rather than hacking DS_JOBS, I have created a batch file solution that works very nicely. It is available here. You need to download pslist.exe from sysinternals.com as well, because the dscat batch file uses it to wait for dsimport.exe to finish executing. This way you can create a whole bunch of dscat commands in notepad and paste them all into the command prompt window.

The batch file expects category1.dsx and category2.dsx to be in the current directory, it concatenates them to create a category.dsx, and imports this file creating a job called "category". This dummy job can be deleted. Edit the category1.dsx file to change the name of the job in the unlikely event that you have a job called "category" in your project already!

The server, username, password and project are all hard-coded so you will need to insert these details. It is up to you whether this represents a security problem, if so then remember to remove the password after you have used the utility.

Posted: Tue Nov 08, 2005 8:10 am
by kduke
You hacked the DSX instead of hacking the repository directly. Nice. 8)

Posted: Mon Feb 25, 2008 7:30 am
by PhilHibbs
I have updated my dscat.cmd script in dscategory.zip and now it does not need any additional files - it just creates a .dsx file with a dummy job in the desired category, imports the dsx, then quits. It leaves the .dsx file in the current directory, and it leaves the job called "dummy" in the newly created category (so if you create a load of categories, it just leaves it in the last one created). As it uses Perl, it no longer needs to scan the process list for the dsimport process as Perl can wait for the process to finish natively. It also restores the last-logged-on user in the registry afterwards.

You will need to edit the script to use it - on line 27 the server, user, password, and project are hard-coded.

Is there a file upload area on DSXchange? Or on IBM's web site? I can't find the new equivalent of ADN anywhere, is there one?

Posted: Mon Feb 25, 2008 3:35 pm
by ray.wurlod
You can use attachments (up to 5MB, if my memory serves) at IBM DeveloperWorks.

Both sites are planning upload/download capability. Issues relating to viruses, spam and the like are still being worked through: probably some form of moderated area will be implemented.

Posted: Wed Feb 27, 2008 5:46 am
by ray.wurlod
:idea:
Use DataStage/SQL to insert new category records in DS_JOBS. From the operating system use the dssh command, and enclose the SQL in double quotes.

Category records have a key of \\\category, have NRO in the READONLY column and the category in the CATEGORY column. Some examples, for the categories DWH and DWH\Dimensions

Code: Select all

$DSHOME\bin\dssh "INSERT INTO DS_JOBS(NAME,READONLY,CATEGORY) VALUES ('\\\DWH','NRO','DWH');"
$DSHOME\bin\dssh "INSERT INTO DS_JOBS(NAME,READONLY,CATEGORY) VALUES ('\\\DWH\Dimensions','NRO','DWH\Dimensions');"