I have a macro variable named $varTRN$ and is set as integer data type. I created an Extract action and extract a value into $varTRN$, this value is then compared inside an Evaluate If action ($varTRN$ == $varPromptTRN$).
If the field I am extracting (single row, length 3) is empty (no data or ' ' if you prefer) the evaluate action completes correctly and I see a result but from that step onwards the macro is in "frozen" state, even after the designated timeout the macro still hangs. In Host Terminal preview window the macro never stops (Stop Macro button is lit).
Why does this happen? I tired checking in another Evaluate If action if $varTRN$ != null but it doesn't work, the result is same as above.
Pinned topic Extract integer fails if extract region is empty
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-03-27T17:38:18Z at 2013-03-27T17:38:18Z by SystemAdmin
tmparker 120000EHB3521 Posts
Re: Extract integer fails if extract region is empty2013-03-26T04:31:36ZThis is the accepted answer. This is the accepted answer.The problem you are describing sounds like you are most likely hitting an error or exception in the macro when it's running. What you need to do is run the studio with the console showing so you can see the output and determine what the error is. I wrote another entry on this other thread describing how to show the studio console, https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14821005�. Once you have the console displayed, run your macro in the studio and then you will know what is failing.
SystemAdmin 110000D4XK1192 Posts
Re: Extract integer fails if extract region is empty2013-03-27T17:38:18ZThis is the accepted answer. This is the accepted answer.
- tmparker 120000EHB3
This is the error:
com.ibm.eNetwork.ECL.VariableException A type mismatch occurred while updating variable $varTRN$
I found a link with the error description Variables and imported Java classes (search for: 'A type mismatch occurred while updating variable $intLength$')
I solved the issue by first extracting this region as a String, compare if this string is not empty and then extract into $varTRN$ (integer type), if the region is indeed empty then update $varTRN$ to 0. The only minor this is I am comparing $varTRNString$ != ' ' with three spaces. Are there any trim() method or similar available for variable formatting?