How to pass name & Date as invocation Id from file name

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
VijayDS
Participant
Posts: 38
Joined: Thu Jun 18, 2009 3:50 am

How to pass name & Date as invocation Id from file name

Post by VijayDS »

Hi All,

I am getting files with file names consists of fund name and date. I have to pass this fundname and date as invocationId to the application. We are getting dynamic number of source files and the application needs to be executed with DSJobInvocationId.


Eg:F*****-FundTest_Euro-20071115.csv

Here F***** is the fund number and 20071115 is the date.

I need to pass (F*****-20071115) as ds job invocation Id for that particular file execution.


Please give me some inputs for this.
Thanks
Vijay
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Are you calling from the sequencer or shell script.

If it is from the sequencer, you will get an additional text box for invocation id.

If it is from shell script, suffix the invocation id after the jobname seperated by a dot.
VijayDS
Participant
Posts: 38
Joined: Thu Jun 18, 2009 3:50 am

Post by VijayDS »

Hi Sainath,

I know how to specify invocationId in sequence as well as script but how can take this mentioned invocation id from the file name. The file name consists of name and date.


I am getting 100 source files and I have to pass these names as invocation id's.

I hope you understand now.




Sainath.Srinivasan wrote:Are you calling from the sequencer or shell script.

If it is from the sequencer, you will get an additional text box for invocation id.

If it is from shell script, suffix the invocation id after ...
Thanks
Vijay
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I thought this is what you asked in your other post.

Did you try using the cut command ?
ds_ashish
Participant
Posts: 15
Joined: Thu Nov 23, 2006 12:30 am

Post by ds_ashish »

Hi Vijay,

Try the below commands to read all file names from the directory (i hope all files are present at same location)

1) ls -lrt | awk '{ print $9}' :- Using awk
2) ls -lrt | tr -s ' ' | cut -d ' ' -f9 :- Using cut command

You can take the output of the above command to a file and you can easily pass file name one by one to your job.

Hope this will work.
Thanks in Adv.
Ashish
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Post by swades »

VijayDS wrote:I am getting 100 source files and I have to pass these names as invocation id's.
....are you running ALL jobs at the same time?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Conversation started here but not sure that question has been answered.

viewtopic.php?p=347899
-craig

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