I have been using the recode statement and instead of writing a lengthy code to track the number of items that have been recoded and I was wondering if CSPro has a listing file that records the number of recodes just like what is reported when using the impute statement.
Thanks,
Pierre
Is there a report listing when using the RECODE statement?
-
- Posts: 47
- Joined: August 8th, 2012, 5:20 am
- Location: Pohnpei, Federated States of Micronesia
Re: Is there a report listing when using the RECODE statemen
Hey Greg ... can you implement something like this? change two data items on a single recode?
Code: Select all
Format:
recode var-1 [:var-2 [:var-n]] => var-out-1 => var-out-2;
[range-1] [:range-2 [:range-n]] => exp-1 => exp-2;
[range-1] [:range-2 [:range-n]] => exp-1 => exp-2;
: : :
[: [:]] => other-exp-1 => other-exp-2;
endrecode;
-
- Posts: 1796
- Joined: December 5th, 2011, 11:27 pm
- Location: Washington, DC
Re: Is there a report listing when using the RECODE statemen
There's no listing report generated during the recode. The recode is a pretty dumb function, in that it can't do anything clever like you suggest. Can you just recode the value to a temporary variable and then use the impute function to assign it to the desired variable so that you'll get that error report?
Alternatively, you can use the output of a function as the assignment value, so you could log stuff yourself like this:
Alternatively, you can use the output of a function as the assignment value, so you could log stuff yourself like this:
function LogRecode(value)
write("Recoding to %d",value);
LogRecode = value;
end;
// ...
recode XXX => YYY;
1-10 => LogRecode(1);
11-99 => LogRecode(2);
endrecode;
The multiple output recode is an interesting idea. I'll add it to the feature request list as something that we could implement.write("Recoding to %d",value);
LogRecode = value;
end;
// ...
recode XXX => YYY;
1-10 => LogRecode(1);
11-99 => LogRecode(2);
endrecode;
-
- Posts: 47
- Joined: August 8th, 2012, 5:20 am
- Location: Pohnpei, Federated States of Micronesia
Re: Is there a report listing when using the RECODE statemen
Thanks Greg,
I haven't thought about using a function to track data item changes. Excellent.
peace-
I haven't thought about using a function to track data item changes. Excellent.
peace-