Nat Wooding
2005-05-12 23:45:23 UTC
John
A hair-brained, after 7pm suggestion that assumes that you are using a
character value for you ID variable and it is called CVAR, then
in the data step preceeding the Transpose, add
CVAR=compress(cvar||'abc');
where abc is the string that you want to stick on the end of the new
variables. This could, of course, be a variable value.
eg
Data a;
length idvar $ 5;
input idvar $ 1-3 cvar $ 5 numid y ;
idvar=compress(idvar||'_'||cvar);
cards;
abc X 1 5
def Y 1 6
abc X 2 11
ghi Z 2 12
proc transpose out=b;
id idvar;
by numid ;
var y;
Proc print;run;
Nat Wooding
"Gerstle, John"
<***@CDC.GOV> To: SAS-***@LISTSERV.UGA.EDU
Sent by: "SAS(r) cc:
Discussion" Subject: SUFFIX needed for PROC TRANSPOSE
<SAS-***@LISTSERV.U
GA.EDU>
05/12/05 06:15 PM
Please respond to
"Gerstle, John"
I have some memory that this isn't possible (yet)...but...
Does anyone know how you can assign a suffix to variable names in PROC
TRANSPOSE, in place of the PREFIX option?
Theoretically, I'd like to do something like this:
Proc transpose data=in out=outagain suffix=_value;
Id class;
By sex;
Var value;
Run;
Any ideas?
John Gerstle, MS
Biostatistician
CDC Information Technological Support Contract (CITS)
NCHSTP \DHAP \HICSB \Research, Analysis, and Evaluation Section
Phone: 404-639-3980
Fax: 404-639-2980
-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains information which
may be legally confidential and/or privileged and does not in any case
represent a firm ENERGY COMMODITY bid or offer relating thereto which binds
the sender without an additional express written confirmation to that
effect. The information is intended solely for the individual or entity
named above and access by anyone else is unauthorized. If you are not the
intended recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If you
have received this electronic transmission in error, please reply
immediately to the sender that you have received the message in error, and
delete it. Thank you.
A hair-brained, after 7pm suggestion that assumes that you are using a
character value for you ID variable and it is called CVAR, then
in the data step preceeding the Transpose, add
CVAR=compress(cvar||'abc');
where abc is the string that you want to stick on the end of the new
variables. This could, of course, be a variable value.
eg
Data a;
length idvar $ 5;
input idvar $ 1-3 cvar $ 5 numid y ;
idvar=compress(idvar||'_'||cvar);
cards;
abc X 1 5
def Y 1 6
abc X 2 11
ghi Z 2 12
proc transpose out=b;
id idvar;
by numid ;
var y;
Proc print;run;
Nat Wooding
"Gerstle, John"
<***@CDC.GOV> To: SAS-***@LISTSERV.UGA.EDU
Sent by: "SAS(r) cc:
Discussion" Subject: SUFFIX needed for PROC TRANSPOSE
<SAS-***@LISTSERV.U
GA.EDU>
05/12/05 06:15 PM
Please respond to
"Gerstle, John"
I have some memory that this isn't possible (yet)...but...
Does anyone know how you can assign a suffix to variable names in PROC
TRANSPOSE, in place of the PREFIX option?
Theoretically, I'd like to do something like this:
Proc transpose data=in out=outagain suffix=_value;
Id class;
By sex;
Var value;
Run;
Any ideas?
John Gerstle, MS
Biostatistician
CDC Information Technological Support Contract (CITS)
NCHSTP \DHAP \HICSB \Research, Analysis, and Evaluation Section
Phone: 404-639-3980
Fax: 404-639-2980
-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains information which
may be legally confidential and/or privileged and does not in any case
represent a firm ENERGY COMMODITY bid or offer relating thereto which binds
the sender without an additional express written confirmation to that
effect. The information is intended solely for the individual or entity
named above and access by anyone else is unauthorized. If you are not the
intended recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If you
have received this electronic transmission in error, please reply
immediately to the sender that you have received the message in error, and
delete it. Thank you.