September Nyang oro seppy at tanzatech.com
Fri Jan 17 11:02:47 CST 2003


I got a job in DataStage that runs once per day. It basically gets raw 
data from DB2, transforms it ( we do some calculations and other stuff 
here), and then dumps the data into an Oracle. So that part works 

We need to be able to archive this raw data from the DB2 source for 14 
days just incase something happens to our jobs, so we could go back and 
get that raw data from the archive and run it again. We're trying to 
archive this data in a flat file in Windows NT. Right now when we run 
the process we could only archive the raw data for 1 day. DataStage 
could only 'overwrite' or 'append' to an existing file. But we want 
separate files everyday.

The challenge: I need to write a script in Basic / DOS that would put a 
timestamp in my jobs. Before it 'overwrites' yesterday's job in the 
system when it writes today's job, it should move 'yesterday's job into 
another directory/folder. And then keep that old job in the new folder 
for 14 days. After 14 days that job should be deleted. So a script that 
can perform those functions is something that would be useful to me.

So ideally, I'll need to have a script that runs first on the system, 
moves the old file into the new directory, checks whether that new 
directory has files older than 14 days, if so then delete the older-
than-14-days file(s). If no older than 14 days files are available, 
then just finish.

Ideas are welcome.




More information about the spug-list mailing list