Automation of daily file load into Oracle table.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Virupan
Participant
Posts: 5
Joined: Fri Jan 11, 2008 4:18 am

Automation of daily file load into Oracle table.

Post by Virupan »

Hi All,

I am loading one dat file to oracle table daily.The dat file name is in the format 'filename_yyyymmdd'. I have parameterized the file name and file path.At run time I am passing the current file name and loading the data.Now I have to automate this process of daily file load to oracle table.I have to capture the date at which file is loaded.I created a sequence with 'wait_for _file activity'stage and a 'job activity'stage with all the parameters passed.
Can any body please let me know how can I completely automate this process without passing the file name at run time.

Many thanks in advance
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You won't be able to use the WFF stage with wildcards, only a static filename. You may need to build a loop to check, possibly in conjuntion with the Folder stage which does support wildcards or a script you leverage from the Sequence.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Convert sysdate (@DATE) to yyyymmdd format in a user variable stage and then pass the same to your job as the 'file name' parameter

Code: Select all

e.g filename:'_':UserVariable:'.dat'
If you are not sure that you would load filename_20081010.dat on 20081010 then you may want to maintain the date in a table and keep on incrementing by 1 after successful load of the file. Whenever the load starts on any day, you need to get the date from this table and pass to the job which reads the dat file.
Last edited by kandyshandy on Thu Jan 22, 2009 10:25 am, edited 1 time in total.
Kandy
_________________
Try and Try again…You will succeed atlast!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I prefer simply looking for whatever files are there on any given day and moving / archiving them elsewhere when complete. That way you don't have to worry about your date getting out of sync and you can process multiple files on any given day if need be. You may only need to track what days you've processed if that is one of your requirements or the possibility exists of receiving the same file multiple times where that would be a Bad Thing.

We do this on a regular basis, typically one file delivered daily but we only process them on the weekdays, so need to pick up three files on Monday.
-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 »

One of the recent webinars ("Files and DataStage Job Sequences") at the DSXchange Learning Center shows precisely how to do this with a loop in a job sequence.
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