Discussion:
SUFFIX needed for PROC TRANSPOSE
(too old to reply)
Nat Wooding
2005-05-12 23:45:23 UTC
Permalink
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.
Gerstle, John
2005-05-13 14:23:02 UTC
Permalink
Nat,
Yes. This would work. I was hoping for a way to do this within PROC
TRANSPOSE. Again, it seems this was discussed on the List some time back
with only work around solutions, such as you pose. Or was this added to
the SAS Ballot already, and voted on? If not, it would be handy to be
able to use a SUFFIX option along side the PREFIX option.
Thanks.

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
-----Original Message-----
Nat
Wooding
Sent: Thursday, May 12, 2005 7:45 PM
Subject: Re: SUFFIX needed for PROC TRANSPOSE
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"
Discussion" Subject: SUFFIX
needed
for PROC TRANSPOSE
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?
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.
Terjeson, Mark (IM&R)
2005-05-13 15:25:27 UTC
Permalink
Hi John,

You are correct. It is not available . . . yet?

Your idea is excellent and a good addition to the
recent discussions of the idea of >1 ID variable
merely concatenated together. see post:
http://listserv.uga.edu/cgi-bin/wa?A2=ind0504C&L=sas-l&P=R42524

e.g.
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4


Adding your idea would yield the same simple concatenations:
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc suffix=Xyz
delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4||SUFFIX


So, GOOD idea, but in the mean time, we gotta
concatenate whatever we want together and then
specify our new concatenated-contents-variable
in the ID statement previous prep'd in an extra
datastep.




Hope this is helpful.


Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group


Russell
Global Leaders in Multi-Manager Investing











-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
Gerstle, John
Sent: Friday, May 13, 2005 7:23 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SUFFIX needed for PROC TRANSPOSE


Nat,
Yes. This would work. I was hoping for a way to do this within PROC
TRANSPOSE. Again, it seems this was discussed on the List some time back
with only work around solutions, such as you pose. Or was this added to
the SAS Ballot already, and voted on? If not, it would be handy to be
able to use a SUFFIX option along side the PREFIX option. Thanks.

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
-----Original Message-----
Nat
Wooding
Sent: Thursday, May 12, 2005 7:45 PM
Subject: Re: SUFFIX needed for PROC TRANSPOSE
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"
Discussion" Subject: SUFFIX
needed
for PROC TRANSPOSE
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?
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.
Terjeson, Mark (IM&R)
2005-05-13 16:29:53 UTC
Permalink
Hi Chang,

Good ideas, don't forget that the PREFIX and ID statement
already have the job of concatenating contents together.
The ID only allows one variable at this time. So maybe
doing some consolidating of the pieces of your idea may
mean we don't need to add any new statements or options
since PROC TRANSPOSE already does concatenating, maybe
the existing ID could just allow more than it's one var?

Just a thought......


Johns idea of adding SUFFIX= along with the existing
PREFIX= also sounds good.

Mark




-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
Chang Chung
Sent: Friday, May 13, 2005 9:18 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SUFFIX needed for PROC TRANSPOSE


On Fri, 13 May 2005 08:25:27 -0700, Terjeson, Mark (IM&R)
Post by Terjeson, Mark (IM&R)
Hi John,
You are correct. It is not available . . . yet?
Your idea is excellent and a good addition to the
recent discussions of the idea of >1 ID variable
http://listserv.uga.edu/cgi-bin/wa?A2=ind0504C&L=sas-l&P=R42524
e.g.
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc suffix=Xyz
delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4||SUFFIX
So, GOOD idea, but in the mean time, we gotta
concatenate whatever we want together and then
specify our new concatenated-contents-variable
in the ID statement previous prep'd in an extra
datastep.
Hi,
Better yet, why don^t we make a new option varName which takes any
string and in it the id variable names are substituted by the actual
values of the id vars. And the special keyword _n_ is substituted by the
column number. For example (this is suggested syntax -- does not work):

proc transpose
data=sashelp.class(obs=3) out=classT
varName= "class_" || name || _N_; /* suggested syntax */
;
var sex;
id name;
run;
proc print data=classT;
run;
/* suggested output
Obs _NAME_ class_Alfred1 class_Alice2 class_Barbara3
1 Sex M F F
*/

It will be nice if the varName= expression takes data step functions
including input() or put(). Well, this may be too cute considering that
we are basically playing with bunch of 32-character long strings... :-)

Cheers,
Chang
Chang Chung
2005-05-13 16:17:48 UTC
Permalink
On Fri, 13 May 2005 08:25:27 -0700, Terjeson, Mark (IM&R)
Post by Terjeson, Mark (IM&R)
Hi John,
You are correct. It is not available . . . yet?
Your idea is excellent and a good addition to the
recent discussions of the idea of >1 ID variable
http://listserv.uga.edu/cgi-bin/wa?A2=ind0504C&L=sas-l&P=R42524
e.g.
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc suffix=Xyz
delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4||SUFFIX
So, GOOD idea, but in the mean time, we gotta
concatenate whatever we want together and then
specify our new concatenated-contents-variable
in the ID statement previous prep'd in an extra
datastep.
Hi,
Better yet, why don^t we make a new option varName which takes any string
and in it the id variable names are substituted by the actual values of the
id vars. And the special keyword _n_ is substituted by the column number.
For example (this is suggested syntax -- does not work):

proc transpose
data=sashelp.class(obs=3) out=classT
varName= "class_" || name || _N_; /* suggested syntax */
;
var sex;
id name;
run;
proc print data=classT;
run;
/* suggested output
Obs _NAME_ class_Alfred1 class_Alice2 class_Barbara3
1 Sex M F F
*/

It will be nice if the varName= expression takes data step functions
including input() or put(). Well, this may be too cute considering that we
are basically playing with bunch of 32-character long strings... :-)

Cheers,
Chang
Nat Wooding
2005-05-13 21:57:13 UTC
Permalink
To take a slightly different viewpoint, while have the ability to add
suffixes would be nice, variables with suffixes are harder to work with in
groups and I am not aware of being able to specify the colon operator as a
leading wildcard as in :abc where you wanted to select or use all of the
variables ending in abc. It does not appear to work in V8. I supose I am
concerned of encouraging novices by making the process easier.

Nat


|---------+---------------------------->
| | "Terjeson, Mark |
| | (IM&R)" |
| | <***@RUSSEL|
| | L.COM> |
| | Sent by: "SAS(r) |
| | Discussion" |
| | <SAS-***@LISTSERV.U|
| | GA.EDU> |
| | |
| | |
| | 05/13/2005 12:29 |
| | PM |
| | Please respond to|
| | "Terjeson, Mark |
| | (IM&R)" |
| | |
|---------+---------------------------->
------------------------------------------------------------------------------------------------------------------------------|
| |
| To: SAS-***@LISTSERV.UGA.EDU |
| cc: |
| Subject: Re: SUFFIX needed for PROC TRANSPOSE |
------------------------------------------------------------------------------------------------------------------------------|
Hi Chang,

Good ideas, don't forget that the PREFIX and ID statement
already have the job of concatenating contents together.
The ID only allows one variable at this time. So maybe
doing some consolidating of the pieces of your idea may
mean we don't need to add any new statements or options
since PROC TRANSPOSE already does concatenating, maybe
the existing ID could just allow more than it's one var?

Just a thought......


Johns idea of adding SUFFIX= along with the existing
PREFIX= also sounds good.

Mark




-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
Chang Chung
Sent: Friday, May 13, 2005 9:18 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SUFFIX needed for PROC TRANSPOSE


On Fri, 13 May 2005 08:25:27 -0700, Terjeson, Mark (IM&R)
Hi John,
You are correct. It is not available . . . yet?
Your idea is excellent and a good addition to the
recent discussions of the idea of >1 ID variable
http://listserv.uga.edu/cgi-bin/wa?A2=ind0504C&L=sas-l&P=R42524
e.g.
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc suffix=Xyz
delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4||SUFFIX
So, GOOD idea, but in the mean time, we gotta
concatenate whatever we want together and then
specify our new concatenated-contents-variable
in the ID statement previous prep'd in an extra
datastep.
Hi,
Better yet, why don^t we make a new option varName which takes any
string and in it the id variable names are substituted by the actual
values of the id vars. And the special keyword _n_ is substituted by the
column number. For example (this is suggested syntax -- does not work):

proc transpose
data=sashelp.class(obs=3) out=classT
varName= "class_" || name || _N_; /* suggested syntax */
;
var sex;
id name;
run;
proc print data=classT;
run;
/* suggested output
Obs _NAME_ class_Alfred1 class_Alice2 class_Barbara3
1 Sex M F F
*/

It will be nice if the varName= expression takes data step functions
including input() or put(). Well, this may be too cute considering that
we are basically playing with bunch of 32-character long strings... :-)

Cheers,
Chang




-----------------------------------------
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.
Terjeson, Mark (IM&R)
2005-05-13 22:50:53 UTC
Permalink
Hi Nat,

It is always good to ask the question such as,
"concerned of encouraging novices by making the process easier".
I think we all agree that if it were to make things more risky
for the general populus, that it would not be a good thing.

On another item, I think I understand what you have written,
but help me if I missed your intent, because I may have missed
a good point regarding "variables with suffixes". When we
suggested that multiple variables be allowed to have "their contents"
concatenated together into a string which will become the column's
variable name, and I'm thinking that "suffixes" on variable names
such as var1 var2 var3 etc. is different than what SUFFIX= and PREFIX=
are. Granted the word SUFFIX=, if that is your concern, merely means
that possibly if SAS were to consider more items concatenated, then
it could be called something not confusing such as PREFIX= and
POSTFIX= or something. I don't think what it is called is important
(other than to avoid possible confusion as you say), but the
important thing is the operation of concatenating:
PREFIX||delim||var1contents||delim||var2contents||...||POSTFIX
instead of the current
PREFIX||var1contents

The above expansion would have met several score of SAS-L posted
situations and desires and allow much more complexity as the user
deemed helpful.

As to more advanced users, if using colon modifiers could
automatically be utilized in the ID statement resolving it's list
of more than one variable name, I would think that would be a
pretty handy thing, and internally would concatenate them all
together no different than listing them out manually one at a
time. At this point having colon or other variable name modifiers
used while the ID statement resolves it's "list of variable names",
should not interfere with the "concatenation of list of var's-contents"
wrapped with the PREFIX and POSTFIX concatenation.

Just as the INPUT and INFILE are very simple in default rule. We
humans can combine together one-to-scores of options/flags/etc.
to add the alterations of behavior until we get messed up or
confused (when first learning) so the:
list of var names
and set of concatenations
could verywell meet the many different combinations mentioned
over the years on SAS-L with the combinations of those two tasks.

Did I catch your concern accurately? Let me know if not. I liked
your concern but was hoping to separate the preverbial baby from
the bath water and lose a possible good quality improvement to
a slight labeling foopah.

Did we combine the best of all the ideas so far? Anyway, just
brainstorming and if additional comments refine a proposal into
a sound one someday then we all did good. I did take on helping
to champion this possibility and have no ownership whatsoever,
it belongs indeed to all of us.

(but sure would be cool having the proposed capability!)

Mark



-----Original Message-----
From: ***@dom.com [mailto:***@dom.com]
Sent: Friday, May 13, 2005 2:57 PM
To: Terjeson, Mark (IM&R)
Cc: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SUFFIX needed for PROC TRANSPOSE


To take a slightly different viewpoint, while have the ability to add
suffixes would be nice, variables with suffixes are harder to work with
in groups and I am not aware of being able to specify the colon operator
as a leading wildcard as in :abc where you wanted to select or use all
of the variables ending in abc. It does not appear to work in V8. I
supose I am concerned of encouraging novices by making the process
easier.

Nat


|---------+---------------------------->
| | "Terjeson, Mark |
| | (IM&R)" |
| | <***@RUSSEL|
| | L.COM> |
| | Sent by: "SAS(r) |
| | Discussion" |
| | <SAS-***@LISTSERV.U|
| | GA.EDU> |
| | |
| | |
| | 05/13/2005 12:29 |
| | PM |
| | Please respond to|
| | "Terjeson, Mark |
| | (IM&R)" |
| | |
|---------+---------------------------->
-----------------------------------------------------------------------
-------------------------------------------------------|
|
|
| To: SAS-***@LISTSERV.UGA.EDU
|
| cc:
|
| Subject: Re: SUFFIX needed for PROC TRANSPOSE
|
-----------------------------------------------------------------------
-------------------------------------------------------|




Hi Chang,

Good ideas, don't forget that the PREFIX and ID statement already have
the job of concatenating contents together. The ID only allows one
variable at this time. So maybe doing some consolidating of the pieces
of your idea may mean we don't need to add any new statements or options
since PROC TRANSPOSE already does concatenating, maybe the existing ID
could just allow more than it's one var?

Just a thought......


Johns idea of adding SUFFIX= along with the existing
PREFIX= also sounds good.

Mark




-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of
Chang Chung
Sent: Friday, May 13, 2005 9:18 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Re: SUFFIX needed for PROC TRANSPOSE


On Fri, 13 May 2005 08:25:27 -0700, Terjeson, Mark (IM&R)
Hi John,
You are correct. It is not available . . . yet?
Your idea is excellent and a good addition to the
recent discussions of the idea of >1 ID variable
http://listserv.uga.edu/cgi-bin/wa?A2=ind0504C&L=sas-l&P=R42524
e.g.
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4
* user specified alternate delimiter string ;
proc transpose data=sample out=proposed_result prefix=Abc suffix=Xyz
delimiter=_;
by the_BY_var;
id Zone Units Var3 Var4; * NEW PROPOSED SYNTAX - allowing >1 var ;
run;
PREFIX||Zone||'_'||Units||'_'||Var3||'_'||Var4||SUFFIX
So, GOOD idea, but in the mean time, we gotta
concatenate whatever we want together and then
specify our new concatenated-contents-variable
in the ID statement previous prep'd in an extra
datastep.
Hi,
Better yet, why don^t we make a new option varName which takes any
string and in it the id variable names are substituted by the actual
values of the id vars. And the special keyword _n_ is substituted by the
column number. For example (this is suggested syntax -- does not work):

proc transpose
data=sashelp.class(obs=3) out=classT
varName= "class_" || name || _N_; /* suggested syntax */
;
var sex;
id name;
run;
proc print data=classT;
run;
/* suggested output
Obs _NAME_ class_Alfred1 class_Alice2 class_Barbara3
1 Sex M F F
*/

It will be nice if the varName= expression takes data step functions
including input() or put(). Well, this may be too cute considering that
we are basically playing with bunch of 32-character long strings... :-)

Cheers,
Chang




-----------------------------------------
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.
Richard A. DeVenezia
2005-05-14 10:49:08 UTC
Permalink
Post by Terjeson, Mark (IM&R)
Did we combine the best of all the ideas so far? Anyway, just
brainstorming and if additional comments refine a proposal into
a sound one someday then we all did good. I did take on helping
to champion this possibility and have no ownership whatsoever,
it belongs indeed to all of us.
Ideawise, I would rank my TRANSPOSE priorities as:
- Option VIEW=
- Option BYROW
- Option SUFFIX= / Statement OUTPUT COLUMNAME=expression
--
Richard A. DeVenezia
Chang Chung
2005-05-14 14:58:26 UTC
Permalink
On Sat, 14 May 2005 06:49:08 -0400, Richard A. DeVenezia
Post by Richard A. DeVenezia
Post by Terjeson, Mark (IM&R)
Did we combine the best of all the ideas so far? Anyway, just
brainstorming and if additional comments refine a proposal into
a sound one someday then we all did good. I did take on helping
to champion this possibility and have no ownership whatsoever,
it belongs indeed to all of us.
- Option VIEW=
- Option BYROW
- Option SUFFIX= / Statement OUTPUT COLUMNAME=expression
Hi,

Oh, I love the idea of the view= option. It will be very, very handy!! I
guess this means that the actual transposition occurs as we use the
view... Hmmm... what should happen when we have a data step that modifies
the underlying table using the transpose view? The view should be a
snapshot of the underlying table just before the step?

I also love the name of the option (I think you meant "columnName" with
two 'n's). (C has a function creat() -- without "e," that is. and that
was ... how can I put it gently... not a good idea. When Mr. Ritchie was
asked in an interview what he would do differently, he told the
interviewer that he would change the name of the function spelled
correctly!)

An alternative is "colName," since we are so used to proc transpose
generating variables named: col1, col2,.... Another remote possibility
is "TPVarName", since the documentation calls the new variables
as "transpose variables." I think adding the "output" statement, and move
those options about the new variable name to the output statement makes so
much sense.

I probably missed the discussion. I have no idea about what "byrow" option
should do. Could you explain or point me to the discussion about this? If
you mean the reversing the transposing direction: from variables to
observations, then I have some reservations. I think at that point, it
might be better to have a new proc, say proc reshape, with a different and
more general syntax and option names that are not tied to specific
direction of transposition.

Well, it is so much fun to play a software application architect or a
specification expert. Have a nice weekend! :-)

Cheers,
Chang

Loading...