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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.