Searching for file name in XML export

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
zulfi123786
Premium Member
Premium Member
Posts: 730
Joined: Tue Nov 04, 2008 10:14 am
Location: Bangalore

Searching for file name in XML export

Post by zulfi123786 »

Hi,

I need to search for list of impacted jobs which are reading/writing a particular file, the file name is hardcoded in filename property.

The DS_JOBOBJECTS search in some cases is not returning complete list hence I have exported 2500+ job in the project into XML format which is around 1.5 GB.

All editors are either crashing or turning very unresponsive when I try opening the file to search for a specific file name

I am sure many here have faced this situation and has someone figured a fast approach to this problem ?

The XML export file is not having and XSD/schema file which I can use to read it in DataStage to search within the huge file.

Any solution to this would help a lot

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

Post by chulett »

One option is to not use XML, a dsx export is perfectly readable and won't be so freaking huge. Second option is to use a better editor like UltraEdit which can handle large files. Third option - go to Chuck Smith's site and from his Tools section grab some of his stuff. Simplest might be "Search a dsx file for a string" but I personally used his "List all files and tables used by jobs in a dsx file" routine as a starting point and sent the output to a database table, then all searches were simple queries.
-craig

"You can never have too many knives" -- Logan Nine Fingers
johnboy3
Premium Member
Premium Member
Posts: 52
Joined: Fri Jun 19, 2015 2:48 pm
Location: Jackson, MS, USA

Wow! Thanks Craig.

Post by johnboy3 »

Thank you Craig! I hope I get some time today to go look for the downloads, and maybe I can follow his "feed" if he has one.
john3
john3
----------------------------------------------------
InfoSphere 8.5.0.2; DataStage 8.5.0.0; OS-RHEL 6.6; DB-Oracle Enterprise Edition 11g (11.2.0.4)
rkashyap
Premium Member
Premium Member
Posts: 532
Joined: Fri Dec 02, 2011 12:02 pm
Location: Richmond VA

Post by rkashyap »

As you are using Unix OS, another option could be to move the large file to the Unix machine and use vi editor. On 32 bit machine, vi editor can open files upto 2 GB and much larger files on 64 bit machine.

If you have operations console configured, then another option is to leverage DSODB database.

Code: Select all

SELECT distinct X.ProjectName, X.JobName, JS.StageName, JL.LinkName, DL.DATASTORENAME, DL.DataCollectionName, JL.IsTarget, DL.DATACOLLECTIONSUBCLASS
     FROM  DSODB.JOBRUN R 
     JOIN  DSODB.JOBEXEC X      ON R.JOBID = X.JOBID 
     JOIN  DSODB.JOBSTAGE JS    ON X.JOBID = JS.JOBID 
     JOIN  DSODB.JOBRUNSTAGE RS ON (JS.STAGEID = RS.STAGEID and R.RUNID = RS.RUNID) 
     JOIN  DSODB.JOBLINK JL     ON (JS.STAGEID = JL.FROMSTAGEID OR JS.STAGEID = JL.TOSTAGEID)
     JOIN  DSODB.JOBRUNLINK RL  ON (R.RUNID = RL.RUNID AND RL.LINKID = JL.LINKID) 
     JOIN  DSODB.DATALOCATOR DL ON RL.LOCATORID = DL.LOCATORID 
       WHERE DL.DATACOLLECTIONNAME LIKE '%YourFileName%'
--     WHERE DL.DATACOLLECTIONSUBCLASS <> 'TABLE' AND
--          AND R.RUNSTARTTIMESTAMP > (SYSDATE - 1) 
     ORDER BY 1, 2, 3
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Wow! Thanks Craig.

Post by chulett »

johnboy3 wrote:maybe I can follow his "feed" if he has one
I don't think the site has had much (if any) activity in recent years but that's doesn't mean the routines there are no longer useful. :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 »

The only caveat with vi on a UNIX machine is the size of tmp, which can be a limiting factor. Plus you have to be conversant in vi which I find more and more to be only something us old folks know and love. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
asorrell
Posts: 1707
Joined: Fri Apr 04, 2003 2:00 pm
Location: Colleyville, Texas

Post by asorrell »

Hey! Watch out. I resemble that remark! :-)
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I have an old .dsx that you can have that is a Job that reads an xml formatted ".dsx". I haven't looked at it in years --- it is possible that it won't even import....but it "might" provide you with a solution, so you are welcome to it. As I recall, I parsed out many of the critical things, and one of them might have been filename properties. I can't make any promises about it and it isn't "ibm supported" code by any means, but if it can help, I will be happy to send it. Send me a pm and I can get it for you.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

An airship called the Hindenburg, a ship called the Titanic, an editor called vi...
:P
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply