Every Run date and time should change

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
pradeep_nov18
Participant
Posts: 92
Joined: Wed Mar 05, 2008 4:09 am
Location: chennai
Contact:

Every Run date and time should change

Post by pradeep_nov18 »

i have developed parallel job for the replace load where one of the output Archeive filename must have prefix Date and time how to acheieve.So for every run Date and time must change and it must overwrite(For eg:<Path><date&timefilename.dat>) and frequency of load is daily.
pradeep.v
syeed
Participant
Posts: 19
Joined: Fri Jan 19, 2007 12:35 am
Location: bangalore

Re: Every Run date and time should change

Post by syeed »

pradeep_nov18 wrote:i have developed parallel job for the replace load where one of the output Archeive filename must have prefix Date and time how to acheieve.So for every run Date and time must change and it must overwrite(For eg:<Path><date&timefilename.dat>) and frequency of load is daily.
In UNIX:

if you are triggering Job through UNIX, then Add parameter which will have a value as

Var=Path/Time&DateFileName.Dat

Var=/home/Test/`date "+%Y%m%d&%H%M%S"`abc.dat

or

Just Add a Date parameter in UNIX

or

Have a routine and then pass a parameter through it

Equate RoutineName to DateTimeToTimestamp

Ans= oconv(@DATE, "DYMD[4,2,2]":@VM:"MCN"):"_" : oconv(@TIME, "MTS":@VM:"MCN")
Return(Ans)

Hope this will help you.
Syed
---------
Wait and Watch
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or create a static filename in your job and then rename the file 'after job' using your O/S to add the date/time stamp.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pradeep_nov18
Participant
Posts: 92
Joined: Wed Mar 05, 2008 4:09 am
Location: chennai
Contact:

Re: Every Run date and time should change

Post by pradeep_nov18 »

hi Syed,

Thanks for the reply got some idea.

my file name is in ETL server that that is local/data1/edw/temp folder, even i have parameterized this path accordling to my understanding.I have to prefix the date function with file name in that right,I am using parallel job so oconv and iconv is not there please suggest how to do within datastage if possible.
pradeep.v
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The suggestion was to use a BASIC routine in a Sequence job to build the parameter, IConv and OConv would be available there.
-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 »

If you have MKS Toolkit or some other UNIX emulator installed you can also use an mv command to rename the file in an after-job subroutine ExecSH, using backquotes to capture the result of the date command.
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