File creation date = Current Date then start DS Sequence

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
Dodge
Participant
Posts: 4
Joined: Sun Apr 18, 2010 4:59 pm

File creation date = Current Date then start DS Sequence

Post by Dodge »

Hi all,

I have to implement a logic in a Sequence Job

Everyday in the morining files will be created on the Server.
My DS job will extract data from files and loads into Oracle table.

I need to put a condition.. that if the file created date = Current date then DS Sequence needs to start else fail and send a warning message ....

Thanks in advance....
KoolKid
max.madsen
Premium Member
Premium Member
Posts: 62
Joined: Tue Dec 07, 2004 7:41 am
Location: Brasil
Contact:

Re: File creation date = Current Date then start DS Sequence

Post by max.madsen »

I'm busy now, but ..
This logic can be extensive, full of details but it is simple.
The first step is to list the files and their dates:

Code: Select all

 - ls $arq -lt --time-style=long-iso | cut -d" " -f6,7 
With this command you can pick the date.
The rest believe you can.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Otherwise you can use the STATUS statement in a Routine activity to return the modification date (and lots of other information about the file).
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 »

And I would suggest you always start the Sequence job and then, depending on the date check, decide if the rest of it can run or if you need to send your warning out.
-craig

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