Hi experts,
I run the program in SAS environment against DATAMART IN DATA WAREHOUSE.
For some reason the fragment of code below failed. I have no idea why it generated the error message at the bottom.
What is invalid character in the character string argument of the function?
res_val field is a character type field. I am trying to convet it to numeric and to set 999 to all invalid values.
Could you please give me a hand?
Thank You in advance,
Irin
1391 EXECUTE(
1392 declare global temporary table qsrv
1393 ( Id char (29)
1394 , First_Srv_Dt date
1395 , rslt_cd char (13)
1396 , res_val char (18)
1397 , Num_Res_Val smallint
1398 )
1399 in "&sestblspc"
1400 on commit preserve rows not logged
1401 ) by HDMconnect;
1402
1403 EXECUTE(
1404 insert into session.qsrv
1405 select qu.Id
1406 , qu.dos
1407 , qu.rslt_cd
1408 , qu.res_val,
1409
1410 CASE
1411 WHEN qu.res_val='Invalid' OR
1412
1417 qu.lr_res_val= ' '
1418 THEN 999
1419 ELSE INTEGER(qu.res_val)
1420 END AS Num_Res_Val
1421 from &clmschema..v_l_data qu
1422 join &tmpschema..num np
1423 on qu.Id = np.Id
1424
1425 ) by mYconnect;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/AIX64] SQL0420N Invalid character found in a
character string argument of the function "INTEGER". SQLSTATE=22018
I run the program in SAS environment against DATAMART IN DATA WAREHOUSE.
For some reason the fragment of code below failed. I have no idea why it generated the error message at the bottom.
What is invalid character in the character string argument of the function?
res_val field is a character type field. I am trying to convet it to numeric and to set 999 to all invalid values.
Could you please give me a hand?
Thank You in advance,
Irin
1391 EXECUTE(
1392 declare global temporary table qsrv
1393 ( Id char (29)
1394 , First_Srv_Dt date
1395 , rslt_cd char (13)
1396 , res_val char (18)
1397 , Num_Res_Val smallint
1398 )
1399 in "&sestblspc"
1400 on commit preserve rows not logged
1401 ) by HDMconnect;
1402
1403 EXECUTE(
1404 insert into session.qsrv
1405 select qu.Id
1406 , qu.dos
1407 , qu.rslt_cd
1408 , qu.res_val,
1409
1410 CASE
1411 WHEN qu.res_val='Invalid' OR
1412
1417 qu.lr_res_val= ' '
1418 THEN 999
1419 ELSE INTEGER(qu.res_val)
1420 END AS Num_Res_Val
1421 from &clmschema..v_l_data qu
1422 join &tmpschema..num np
1423 on qu.Id = np.Id
1424
1425 ) by mYconnect;
ERROR: CLI execute error: [IBM][CLI Driver][DB2/AIX64] SQL0420N Invalid character found in a
character string argument of the function "INTEGER". SQLSTATE=22018