File properties as source columns

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
chandu123
Premium Member
Premium Member
Posts: 40
Joined: Mon Sep 12, 2016 1:26 pm

File properties as source columns

Post by chandu123 »

I have a requirement where I need to compare the Modified Timestamp or Created Timestamp of the input file and If there is a new file, Job needs to be run, if not another flow.

Can we use the file properties as source columns in the Datastage job or as job parameters so that I can use Nested Condition activity of the sequence to check for the condition and decide the flow?
HB
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry but you need to compare the timestamps to what - each other? A list of filenames you've already processed and their timestamps? Mostly curious what a 'new' file means, exactly. If that also includes a modified version of a file you've already processed, for instance.

There are ways to get just the file properties into a job, UNIX would make it easier than Windows and I can't get to the Windows command line here to play. Blocked by Group Policy. Yay. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

You have MKS tool kit. So you can still run most of the unix commands. One way of doing; get the modified time stamp using command activity stages, cleanse the command output for both files and compare.

In the last project i did the same validation.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not to derail the conversation but I thought I had read that the MKS Toolkit was no longer part of the more recent versions. No?
-craig

"You can never have too many knives" -- Logan Nine Fingers
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

I know it is there in 11.3, but just checked the latest version and it seems still using.


http://www.ibm.com/support/knowledgecen ... rsion.html
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

chulett wrote:MKS Toolkit was no longer ...
This is really a good point. I always use unix commands, but i need to think twice before us it! At some point it may hit me back.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Okay, must have been something about it being re-architected. However, it can still be pretty mysterious if all someone has known is Windows. And that through the mouse-driven GUI without all of that goofy type-y type-y command line DOS stuff old folks like me use to live and die with. :wink:

Still waiting for requirement clarifications from our OP...
-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 »

Hmm - I also saw presentations last year from IBM saying they were removing MKS Toolkit from future versions DataStage. However, it does seem to be there.

Must have reversed course or delayed the change. I do know it would cause problems for several customers that have designs that use certain UNIX commands even when on Windows....
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Create one or more DataStage server routines that you can call from Routine activities in a sequence job.

In these use OPENSEQ to open the file(s), then the STATUS statement to obtain the property values. Don't forget CLOSESEQ before returning from the routine. I suggest that you return all the information you require using a dynamic array (delimited string).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Saved that one for you, Ray. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage itself is no longer relying on MKS Toolkit. All previous "UNIX" calls from DataStage code have now been rewritten to invoke native Windows equivalents (as much as possible, with some custom code to cope the the remainder).

However, MKS Toolkit continues to ship because of all those folks who have chosen to make use of its functionality.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Aha! That was the 're-architected' bit I was trying to recall. 8)
-craig

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