Page 1 of 1

how can i get the received file timestamp in datastage

Posted: Wed Feb 23, 2011 12:02 am
by hemanthakumar
  • Hi,
    Iam getting daily many files in unix (source directory).
    My requirement is to get the file received timestamp from unix and need to load in one of the db2 (target) table at column RCVD_TS.

    Currently we are handling the basic- routine but going forward we wont use server jobs and basic routines.

    I have cross checked in the forums, tried with many options but did not get the time stamp.

    Any help greatly appreciated

    Thanks

Re: how can i get the received file timestamp in datastage

Posted: Tue Mar 15, 2011 5:39 pm
by LS
Hi hemanthakumar.

If I understand you want the OS file timestamp of the files.

You can use the External Source stage and issue the command:
ls -lisa your_directory

Configure this stage with one column like varchar(200) and then pick up the portion where you have the date and time to build the timestamp in your format.

You can use less options for the ls command but I don't have access now to linux to see the one that gives you the date/time.

A fish is happy because it has nothing.

Have fun,
me.

Re: how can i get the received file timestamp in datastage

Posted: Tue Mar 15, 2011 6:41 pm
by ray.wurlod
hemanthakumar wrote:Currently we are handling the basic- routine but going forward we wont use server jobs and basic routines.
Why ever not? BASIC routines are going to be around for sequences (the routine called from a Routine activity is a BASIC routine). And that makes it really easy to obtain the file timestamps (created, modified and accessed).