Page 1 of 1

Expected identifier; got: "*"

Posted: Wed Jun 25, 2014 1:35 pm
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

Posted: Wed Jun 25, 2014 3:16 pm
by saiwelcomes
Check the field L_In.ConvDate1 for any special characters like * or blanks.

Posted: Wed Jun 25, 2014 3:35 pm
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.

Posted: Wed Jun 25, 2014 3:55 pm
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.

Posted: Thu Jun 26, 2014 12:36 pm
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!

Posted: Thu Jun 26, 2014 2:30 pm
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?

Posted: Thu Jul 03, 2014 9:23 am
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!