I am trying to transpose the questions/answers for each ID.
But some how the values of ID Variable question gets truncated. How it can be fixed?
Any help will be highly appreciated.
Below is my sas code:
data have;
infile datalines missover;
input id $2. quest $43. ans $20.;
datalines;
12 HAVE YOU TAKEN THE DOSE IN LAST 2 MONTHS? NO
12 WHICH MEDICATION YOU ARE ON? XYZ
;
proc sort data=have;
by id ;
run;
proc transpose data=have out=want (drop=_name_ );
id quest;
var ans;
by id;
run;
Above Transpose procedure truncates values of quest variable.
SAS variables have a limit of 32 characters for the name. I would highly recommend a different name ie quest1, quest2 and use IDLABEL to apply quest as the label.
SAS variables have a limit of 32 characters for the name. I would highly recommend a different name ie quest1, quest2 and use IDLABEL to apply quest as the label.
Thanks Reeza. I used IDLABEL. It worked...
SAS names can be 32 characters long. That's where this is being truncated.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.