Filter Stage parameterization

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
aditya
Charter Member
Charter Member
Posts: 41
Joined: Sat May 28, 2005 7:32 am

Filter Stage parameterization

Post by aditya »

Hi All,

I have a job which uses the filter stage to impose conditions on specific column data.

I had parameterized this condition and could test the same successfully when I ran the job in datastage.

However while designing the sequence I had intended to pass the value by reading a file in UNIX which stores the condition.

My sequence was designed as follows

Execute Command Stage -----> Job Activity


Execute Command Stage ===> cat test.txt

Job Activity ===> pass the command output of the Execute command stage to the filter parameter of job1

The file test.txt had the condition: MODIFIED_USER = "ABC"

MODIFIED_USER denotes the column name

The sequence continued to throw errors regarding invalid parameter value/limit value.

I tried to trim the command output but the same error persisted.

I tried to use some or the String funtions hoping that I could pass the value but looks like everytime the sequence just aborted.

Any ideas about how this could be solved.

Thanks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I am confused as to whether your problem is in the Job Sequence and getting the 2 values or whether it is in the PX job after passing those two values?
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

I had exactly the same issue, fixed as follows:

I think the problem is that DataStage will treat the output from the cat command as separate records - each line (or record) will be suffixed with a field marker @FM.

Use the following syntax to extract your value:

Trim(Field(ExecCmdStage.$CommandOutput,@FM,1))

The Trim makes sure the single field has no spaces and may be surplus to your requirements. The Field part is what's important here.
aditya
Charter Member
Charter Member
Posts: 41
Joined: Sat May 28, 2005 7:32 am

Post by aditya »

Thanks OddJob! Your solution was a beauty.
Post Reply