FTP a file with TIMESTAMP in name

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
Raamc
Premium Member
Premium Member
Posts: 87
Joined: Mon Aug 20, 2007 9:08 am

FTP a file with TIMESTAMP in name

Post by Raamc »

Hi All,

I need to FTP a file to remote server by using the FTP stage in Server jobs. While FTPing, I need to append the current timestamp to the name of the file.
If I look at FTP stage properties, only way to give names at runtime is through JOB-LEVEL-parameter.

Now, How can I assign a value to a JOB-LEVEL parameter at runtime?

We are not using sequences in the project so I have no chance to write a routine to append timestamp to file name and call routine at sequence level to assign dynamic value to JOB-LEVEL parameter.
We are on Windows machine so I can't write a script to do this.

Can any one help to code this?

--Raam Ch.
Thanks,
Raamc
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Windows has scripts, they're called batches, you just have to learn that DOS style of scripting with ERRORLEVELs and all that jazz.

So, you aren't using sequences or you can't use sequences, it would be pretty simple to get a timestamp there (in a routine or execute command stage) and then to pass it along to your FTP job as a parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Raamc
Premium Member
Premium Member
Posts: 87
Joined: Mon Aug 20, 2007 9:08 am

Post by Raamc »

I got a work around for this. I am addding the current timestamp in the name of the file, FTPing through the .bat script in windows.

I am dropping the Datastage job which is doing FTP as there is no way to pass dynamic timestamp to the file name in FTP stage.
Thanks,
Raamc
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sure there is, you just need to do the 'dynamic' part outside of the job (for example, leveraging a Sequence) and then pass it in as a Job Parameter. That parameter can then be used in the FTP stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply