Date after File Name

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
madhav_1981
Participant
Posts: 1
Joined: Fri Feb 09, 2007 5:00 am
Location: chennai

Date after File Name

Post by madhav_1981 »

Hi ALL,
I am rejecting the data in a sequential file. My requirement goes like this.

I need to append the date at the end of the file name. so when users wish they can able to see the rejected data on a particular day.

Please let me know how to do that?

Thanks,
Madhavan.S

The job is invoked via a shell script and running on OS: UNIX.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Have a job parameter for date and append the file name with the job parameter.

Code: Select all

FileName_#date#
where date is the job parameter.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's certainly the easiest way, if you can pass the date in. You can also (script or routine) write to a fixed name and rename it 'after job'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Somthing like

Code: Select all

mv myfixednamefile.txt filewithdateandtime`date +"%Y%m%d_%H%M%S"`.txt 
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
tmcnicol
Premium Member
Premium Member
Posts: 4
Joined: Tue Jan 23, 2007 1:01 pm
Location: HCL

Date after File Name

Post by tmcnicol »

This can be done from the Sequencer in the parameters section. This statement will format a date as such: 'FILENAME'_YYYYMMDD.TXT

"FILENAME" :"_": Convert("-","", DSJobStartDate):".":".txt"
Post Reply