order a job for each filename inside a directory
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 12
- Joined: Tue May 31, 2005 5:01 am
order a job for each filename inside a directory
i'd want to order a job (using datastage basic) for each file i'd find inside a directory (without knowing the filename or even the number of files inside the directory), how can i do it ?
thank you !
thank you !
Would it be possible to rephrase your question?
A DataStage routine can loop through each file in a given directory, but I am not sure what you then intend to do with the files found.
A DataStage routine can loop through each file in a given directory, but I am not sure what you then intend to do with the files found.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 12
- Joined: Tue May 31, 2005 5:01 am
purpose intended
I will clarify this:
for each filename found in a given directory:
call a datastage job with a parameter = filename
thank you
for each filename found in a given directory:
call a datastage job with a parameter = filename
thank you
jsgoncalves,
I would write a Sequence. use the ExecuteCommand stage to get the "dir...." results of looking into a directory, and then with the Loop (start&end) go through each element in this list and use a JobActivity stage in the middle to call up your job.
I would write a Sequence. use the ExecuteCommand stage to get the "dir...." results of looking into a directory, and then with the Loop (start&end) go through each element in this list and use a JobActivity stage in the middle to call up your job.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 12
- Joined: Tue May 31, 2005 5:01 am
i've tried to write a Sequence:
- i use the a ExecuteCommand activity
- - dir #path#\*.*
- i then use a start loop
- - delimited values = #Execute_Command_0.$CommandOutput#
- - delimiter = CR/LF
- i then use a job (jobA) which receives a parameter parametro
- - in the sequencer i make parametro = Execute_Command_0.$CommandOutput
it fails...
is the delimiter wrong ? how could i get each element thru the parameter of jobA ?
thank you
- i use the a ExecuteCommand activity
- - dir #path#\*.*
- i then use a start loop
- - delimited values = #Execute_Command_0.$CommandOutput#
- - delimiter = CR/LF
- i then use a job (jobA) which receives a parameter parametro
- - in the sequencer i make parametro = Execute_Command_0.$CommandOutput
it fails...
is the delimiter wrong ? how could i get each element thru the parameter of jobA ?
thank you
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 12
- Joined: Tue May 31, 2005 5:01 am
i've solved the problem using job control but i'd much prefer to solve it using the loop (start&end) as it would be a much more clean solution , so i'm trying it very hard ...
i've tried to search for the list of possible delimiters and cannot get one which would work ...
command = dir /B #path#\a*.*
"
- Output from command ====>
alstompis_e.bat
alstompis_e.ds.log
alstompis_e.log
"
then i always get :
- teste3..JobControl (@StartLoop_Activity_1): Loop through list (1 items): iteration 1
- teste3..JobControl (@Job_Activity_5): Controller problem: Error calling DSSetParam(parametro), code=-4
[ParamValue/Limitvalue is not appropriate]
- teste3..JobControl (@Coordinator): Summary of sequence run
18:27:03: Sequence started
18:27:03: Execute_Command_0 (COMMAND dir) started
18:27:03: Execute_Command_0 finished, reply=0
18:27:03: StartLoop_Activity_1 loop iteration 1 started
18:27:03: Job_Activity_5 (JOB teste2) started
18:27:03: Exception raised: @Job_Activity_5, Error calling DSSetParam(parametro), code=-4 [ParamValue/Limitvalue is not appropriate]
18:27:03: Sequence failed
how can i get each result returned by the execute_command ?
thank you
i've tried to search for the list of possible delimiters and cannot get one which would work ...
command = dir /B #path#\a*.*
"
- Output from command ====>
alstompis_e.bat
alstompis_e.ds.log
alstompis_e.log
"
then i always get :
- teste3..JobControl (@StartLoop_Activity_1): Loop through list (1 items): iteration 1
- teste3..JobControl (@Job_Activity_5): Controller problem: Error calling DSSetParam(parametro), code=-4
[ParamValue/Limitvalue is not appropriate]
- teste3..JobControl (@Coordinator): Summary of sequence run
18:27:03: Sequence started
18:27:03: Execute_Command_0 (COMMAND dir) started
18:27:03: Execute_Command_0 finished, reply=0
18:27:03: StartLoop_Activity_1 loop iteration 1 started
18:27:03: Job_Activity_5 (JOB teste2) started
18:27:03: Exception raised: @Job_Activity_5, Error calling DSSetParam(parametro), code=-4 [ParamValue/Limitvalue is not appropriate]
18:27:03: Sequence failed
how can i get each result returned by the execute_command ?
thank you