Page 1 of 1

Start loop and End Loop in sequencer

Posted: Tue Jun 26, 2007 9:26 am
by meena
Hi All,
I have to handle multiple files to be loaded into an oracle.Has there is job dependencies , I designed a sequencer to handle multiple files. But for some reason the designed sequencer is not working for multiple files.

Files Type: YUR30120070607.001, YUR30120070619.003 etc.

Sequencer design::

1) Execute Command stage:
Command: cd
parameter: /path/ && ls -1m YUR301*
Trigger: len(EX1.$CommandOutput) > 1

2) Start loop:
Delimiter value: #EX1.$CommandOutput#
Delimiter: Comma.
Trigger: Unconditional.
3) DS job to execute : JOB1
4) Stop loop:
Trigger: Unconditional.

Sequencer error:
Error calling DSSetParam(FILE), code=-4
[ParamValue/Limitvalue is not appropriate]
The sequencer is able to handle only one file and when the job runs for second file I am getting the above error.

Job error:
Failed to open YUR30120070619.003 in directory
STATUS = -1.|
I am not understanding where exactly I am doing wrong.

Thanks in advance....

Posted: Tue Jun 26, 2007 9:51 am
by DSguru2B
I believe there is a new line character at the end of the list. I tried doing this for a fellow collegue but removing the @FM character at the end does not work while specifying it in the list.
You will have to preprocess the list, remove the @FM character and send it as a job parameter to be supplied to the list.

Posted: Tue Jun 26, 2007 10:40 am
by chulett
You really shouldn't have to "pre-process" the list but can do the removal as you use them. This an example from one of my jobs, directly in the "filename" parameter in the Job Activity that the Loop drives:

Code: Select all

Trim(EReplace(Start_File_Loop.$Counter,@FM,''))

Posted: Tue Jun 26, 2007 11:43 am
by DSguru2B
Craig, are you using a counter or a list? I tried with list but for some reason its not accepting any functions like Field() or Convert() etc; in the list specification.

Posted: Tue Jun 26, 2007 11:44 am
by meena
Thank you DSGuru2B and Craig..

I used the expression given by Craig and it is working.

Posted: Tue Jun 26, 2007 11:50 am
by DSguru2B
It worked for list huh? Boy, I have to try that again at my end.

Posted: Tue Jun 26, 2007 12:14 pm
by chulett
As noted, I'm not using this expression in the Loop stage itself but rather in the Job Activity stage that receives the parameters from the Loop / User Variables stages.

Posted: Tue Jun 26, 2007 12:19 pm
by DSguru2B
Ok now thats what I was doing wrong. Bummer. Thanks Craig.

Posted: Wed Jun 27, 2007 6:20 am
by klsrao
Hi, It may look silly question but... Why not we use folder stage
Lakshmi Srinivas

Posted: Wed Jun 27, 2007 6:40 am
by chulett
The Folder stage is great for bringing in multiple XML files or anything else where you need the entire contents of the file in a single record.

When you need to process multiple 'normal' files, then you need to either concatenate them all together, do something similar in the Filter option of the Sequential File stage or build an iterative loop in a Sequence job. The latter tends to happen when, due to the business rules in effect, each file must be processed separately.