SWITCH Stage - with wild card character

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
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

SWITCH Stage - with wild card character

Post by karthi_gana »

All,

As the switch is not working properly, the lights are not glowing and i am unable to watch TV. i am sitting in the dark now. Can anybody fix the issue and help me to watch TV?

I am just kidding :)

Coming to the issue, I have designed a simple job as below.

Code: Select all


Seq_File --> Switch --> Seq_1
                             --> Seq_2
                             --> Seq_3

my case expression is as below
  • Switch_18: Parse error on case string: isin like 'A%' = 0, isin like 'B%' = 1, isin like 'C%' = 2;
    multiple `=' tokens were seen.

My input file has a column called 'isin'. my requirement is,

A) If the 'isin' starts with 'A' store it in a file (A.txt)
B) If the 'isin' starts with 'B' store it in a file (B.txt)
C) If the 'isin' starts with 'C' store it in a file (C.txt)

Note: I used Filter stage for this and it worked fine. Although i have read about SWITCH in the manual and came to know it works similar to FILTER. Thats why i tried to know what is happening.

simply, will SWITCH stage support WILD CARD condition check? If yes, what i am missing here.
Karthik
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Re: SWITCH Stage - with wild card character

Post by karthi_gana »

any inputs/thoughts pls ?
Karthik
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the manual about what wildcard character is supported. Tip: it's not the percent sign.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

I have searched on the manual (under switch stage). It doesn't say anything about handling wild card character.

Note I have also tried A*. But it didn't worked :(
Karthik
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

Did you just try

Code: Select all

like 'A'
?
Kandy
_________________
Try and Try again…You will succeed atlast!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Asterisk works for me. How are you quoting the literal string?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

Switch_18: Parse error on case string: isin like "A*" = 0, isin like "B*" = 1, isin like "C*" = 2;
multiple `=' tokens were seen.

I tried single quote too.
Karthik
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

FWIW, I checked the 8.5 docs for both the stage and the operator and found no reference to any 'wildcard' character.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

Are you writing all that on one line or creating multiple case statements?

Are you actually stating "isin like" within your case? You may need the like but the isin (which I'm assuming is your input column) should be specified within the selector
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

My bad - I was thinking about the Filter stage.

Here's a rule of thumb: Filter stage filters using expression, Switch stage filters using value. Value does not permit the use of wildcard or, indeed, any comparison other than "equals".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
karthi_gana
Premium Member
Premium Member
Posts: 729
Joined: Tue Apr 28, 2009 10:49 pm

Post by karthi_gana »

yeah..This is what i wanted to know...

Thanks for all :)
Karthik
Post Reply