Skip to Content
0

is_valid_int - if not stop process

May 10, 2017 at 07:26 AM

132

avatar image
Former Member

Hi,

I'd like to built DF which in Query will be check if field A is int (use function is_valid_int), and if yes - then process go on, if not process will stop and then send mail to me with information about this fact - field A isn't int.

Or maybe do you know another way to use valid function and inform me about fact - field A isn't int and then stop process

My BODS version: SAP DS 4.2 SP02,

MS SQL 2014

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Dirk Venken
May 10, 2017 at 07:40 AM
0

DS is an ETL tool, not a programming language. That means it doesn't treat data sequentially, but in batches. In general, you don't have control in which order table records are treated.

That said, there's a way to simulate what you want. Add a column to the output schema of your query transform that contains the result of the is_valid_int(A) function. Add a script following the data flow:

  1. Use the sql function to retrieve the minimum value of that extra column.
  2. If that value is zero (that means there's at least one failing record)
  • send a mail (with smtp_to function)
  • terminate the job (with raise_exception function)

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 12, 2017 at 03:09 PM
0

Hi Dirk,

thank you for your answer, I did as you wrote - create variable to check min value etc.
Variable works, raise_exception also but I don't know how can I use it together in script.
I tried use ifthenelse in script: ifthenelse($MinValue = 0, raise_exception('check'), 0) but it doesn't work. Error says - find enormous expression. Can you tell me where is the problem?

Regards

Share
10 |10000 characters needed characters left characters exceeded