SAS® Social Network Analysis uses SAS/ACCESS® software to generate XML files. If you import a character column that contains only numeric values, then the XML access engine makes the column numeric. (Alternatively, you can use an XML map to declare the column as character.) However, SAS Social Network Analysis expects the ID column to be character, so an error is displayed when reading the XML. An example of such a type-mismatch error is the following:
ERROR: Expression using equals (=) has components that are of different data types.
WARNING: Output column <column name> datatype does not match XMLMap definition of table <table name>
To avoid this problem, use one of the following workarounds:
Add a DATA step in the stored processes getActionableEntities, and processAlertResponse. Convert each affected field back to character.
Example: converting actionableentityid values to character
DATA work.entities(drop=temp FORMAT_ID CORRECT_ID N);
set entities.entities (rename=(actionableentityid=temp));
length ACTIONABLEENTITYID FORMAT_ID CORRECT_ID $64;
if vtype(temp) = "C" then actionableentityid = temp;
else do;
correct_id = compress(put(month(temp), best.)!! "." !! put(day(temp), z2.) !! "." !!
put(year(temp), z6.));
/* The value is displayed with a mm.dd.yyyyyy format. You can use whatever format
you want to use to display your data.*/
actionableentityid = correct_id;
end;
run;
Add a DATA step near the top of the stored processes getActionableEntities, and processAlertResponse. Convert each affected field back to character.
Example:
In this code, if the QUERYVALUE column contains only numeric inputs, then the QUERYVALUE column is reformatted as character:
data _null_;
set &query_dsn;
if vtype(queryvalue)="C" then call symputx(queryparameter,upcase(queryvalue));
else if queryparameter="maxRows" then call symputx(queryparameter,put(queryvalue,8.));
else if queryvalue ne . then call symputx(queryparameter,put(queryvalue,20.));
else if queryvalue = . then call symputx(queryparameter, '');
put _all_;
run;