Expected identifier; got: "*"

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
irshanuddin
Participant
Posts: 44
Joined: Wed May 27, 2009 3:01 pm

Expected identifier; got: "*"

Post by irshanuddin »

Have a job that is getting a lot of these errors:
APT_CombinedOperatorController(0),1: Expected identifier; got: "*"

The job uses a shared container that is being used to convert Julian Dates to Oracle Dates

The basic transformer has a stage variable that does a NullToValue(Date,'') and passes the StgVar to the following check/conversion:

If IsValidDate(DecimalToDate(StringToDecimal(L_In.ConvDate1)+19000000),"%yyyy%mm%dd")
then DecimalToDate(StringToDecimal(L_In.ConvDate1)+19000000) else setnull()

When the jobs is run, it throws the Expected Identifier, got '*' error.

Any suggestions on how to fix this are appreciated.
Thanks
saiwelcomes
Participant
Posts: 22
Joined: Thu Apr 19, 2012 3:31 am
Location: India

Post by saiwelcomes »

Check the field L_In.ConvDate1 for any special characters like * or blanks.
Regards,
Sai Krishna
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I would suggest you get rid of IsValidDate() and switch to IsValid() with the 'date' type as the former will log an error when a date is invalid while the latter will not. Plus you should also be checking the validity of the string and only converting it to a date if the validity check succeeds.

I'm also curious why you are using a BASIC transformer for this.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Also wondering what your source dates look like as I'm not aware of any 'julian' dates that can be converted by adding 19000000 to them. Can you post some examples including what their corresponding converted value should be, please? I'm guessing they are all normal Gregorian dates in YYMMDD format with the assumption that the century will always be '19':

990316 -> 19990316
140520 -> 19140520

There's a parallel function that will handle the 'year pivot' from 19 to 20 for you automatically if that's what you really need. Don't have the syntax off the top of my head, however.
-craig

"You can never have too many knives" -- Logan Nine Fingers
irshanuddin
Participant
Posts: 44
Joined: Wed May 27, 2009 3:01 pm

Post by irshanuddin »

Thanks for the responses.
I have changed the IsValidDate to IsValid and passing the stage variable as date now.
The Julian date is the date format on the iSeries (AS/400) which is our ERP system. The format you mention is in fact how it is stored, which is
CenturyYYMMDD with 114 representing 2014.
So when you do 1140625 + 19000000 you get 20140625.
You said why am I using a basic transformer, what are my options?


Thanks for all the help guys!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Let's make sure we're on the same page - when you say "basic transformer" do you in fact mean the "BASIC Transformer" in a Server Shared Container as in the one that comes from Server jobs? That was my concern as I didn't see anything Server-like in what you were doing. If you just meant the plain old regular PX transformer then never mind, you're good. Only suggestion would be to not mention the "b word" when next you write about transformers in your Parallel jobs. Unless that's truly what you mean. :wink:

So... working now?
-craig

"You can never have too many knives" -- Logan Nine Fingers
irshanuddin
Participant
Posts: 44
Joined: Wed May 27, 2009 3:01 pm

Post by irshanuddin »

I got it figured out after adding a NullToValue(Date,'') in a stage variable and then passing this to the PARALLEL transformer where I did this:

IF ISVALIDDATE(StringToDate(DecimalToString(StringToDecimal(StageVar1) + 19000000, "suppress_zero"),"%yyyy%mm%dd"))
THEN StringToDate(DecimalToString(StringToDecimal(StageVar1) + 19000000, "suppress_zero"),"%yyyy%mm%dd")
ELSE SETNULL()

This seems to have worked to do what I wanted it to do.

Thanks for all the input!
Post Reply