I got another weird bug, it is pretty long so here it goes -
I am trying to set imputation flags and use the <impute> function all in one line so I am using a numeric function to compress the code.
If I use this line of code -
flag_original_value(tmp) = edit("ZZZZZZZZZZZZZZZ9",getvaluenumeric(name,occNum));
flag_new_value(tmp) = maketext("%d",newVal);
The export data will be something like this -
[116][Q20906][8][1][NOTAPPL][-------]
If I replace the above line of code with this -
flag_original_value(tmp) = maketext("%d",getvaluenumeric(name,occNum));
flag_new_value(tmp) = maketext("%d",newVal);
The export data will be something like this -
[116][Q20906][8][1][-------][1------]
It's not a big deal but I would like to export to specifically show [NOTAPPL] and [1-----], not [-------][1------].
I can always write extra code to force CSPro to write NOTAPPL but I think the biggest concern is the blank values [------] being displayed when there is an actual value.
I can compress the scripts and send the whole package if you want. Thanks.
Thanks,
Pierre
Code: Select all
//Here is the call statement -
impute(Q20906, setNumFlag("Q20906",curocc(),1,getdeck(hd_20906_fr_tenure_expCode)));
//Here is the function -
function setNumFlag(string name, occNum, impType, newVal)
numeric tmp;
tmp = noccurs(FLAGS)+1;
insert(FLAGS_EDT(tmp));
flag_quest_name(tmp) = name;
flag_occ_num(tmp) = occNum;
flag_imputation_type(tmp) = impType;
if occNum = 0 then
flag_original_value(tmp) = edit("ZZZZZZZZZZZZZZZ9",getvaluenumeric(name));
else
//flag_original_value(tmp) = maketext("%d",getvaluenumeric(name,occNum)); // this commented out for a reason.
flag_original_value(tmp) = edit("ZZZZZZZZZZZZZZZ9",getvaluenumeric(name,occNum));
endif;
flag_new_value(tmp) = maketext("%d",newVal);
setNumFlag = newVal;
end;