Page 1 of 1

How to rename and run daily basis jobs?

Posted: Wed Apr 03, 2013 6:35 am
by pkll
Hi,

I have one file:201304040048.SDP101.00011.7190054(Today file)
tomorrow may be i will get same file like
201304050048.SDP101.00011.8040073 and dayafter tomorrow i will get like 201304060048.SDP101.00011.8140813....

In the above example 2013(Year),04(month),04(day),0048( time),SDP101.00011(Filename)7190054(No.of Records).

In the above example year,month,day,time and number of records will change daily.I don't want to change paramer file and aut
omatically it has to pick latest file.

In which basis i have to take file and run the same job daily?(means daily file name is changing.so,How can i take file)

Please suggest me how can i rename and run jobs daily?.....

Posted: Wed Apr 03, 2013 6:57 am
by chulett
A script or routine can be used to detect the current name of the file and then you can either update your values file or pass it as a parameter to the processing job.

Posted: Wed Apr 03, 2013 7:38 am
by pkll
I have not yet work on script and routines.Can any one help me how to write script or routines about this senario?

Posted: Wed Apr 03, 2013 7:54 am
by priyadarshikunal
I think you know the commands to check the files in directory or other unix commands by now.

Start writing them in a sequence. For a starter i would say you can use

ls -1 or ls -lt to list the files/files in order. If you are using ls -lt you need awk command to get just the file name.

Take the first file name using head -1. And you have the file name.

Now run dsjob command and use -param and assign the value of file name to file name parameter.

Once the job is complete move that file already processed to some other directory as archive.

and you are done. Check for syntax using man page in UNIX. You can run this in loop if you expect multiple file.

If you do not care which file is processed first, just you file pattern in the sequential file stage. Be sure to move the files to another folder once the job is done. So that its ready for next day.

Posted: Wed Apr 03, 2013 8:28 am
by chulett
Clarify something for us - is the 'filename' a standalone parameter to be passed to the job or is it part of a parameter set with a values file that needs to be updated?

Posted: Wed Apr 03, 2013 12:15 pm
by pkll
Hi Chulett,
Filename is a standalone parameter(in my example file is SDP101.00011)daily the filename will be change(means date or month and records also).

Code: Select all

Ex:today file is=201304040048.SDP101.00011.7190054
tomorrow file is like=201304050048.SDP101.00011.8040073
In the above example date has been changed(04 to 05) and record count is also incremented 7190054 to 8040073).
And latest data need to store one folder and remaing data(old data) need to move another folder).

Posted: Wed Apr 03, 2013 1:16 pm
by chulett
That makes it something that can be done rather easily in a Sequence job. An Execute Command stage can get the filename and the result can go to the Job Activity stage's filename parameter.

Posted: Fri Apr 05, 2013 4:57 am
by Neha_DS
Or what can be done is move all the processed file into a separate folder, by using "Execute Command" activity in sequencer. By doing so, fo a given day, you would have a single file and can be processed without checking for date time etc.