| Date: | Fri, 31 Mar 2006 13:33:29 -0500 |
| Reply-To: | Wendy Branson <sas1974@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Wendy Branson <sas1974@GMAIL.COM> |
| Subject: | PUT() a value into its assigned format |
| Content-Type: | text/plain; charset=ISO-8859-1 |
Hi all,
I feel like this is something I should know, but it's just one of those
days, I guess.
I'm in the midst of converting thousands of questionnaire variables into a
CDISC compliant normalized format and need a way to put each variable's
value into the user-defined format (there are thousands of those too!). I
could do this with a macro, but I'd rather not if there is some other way.
I'm already using arrays to transpose the dataset, so I'd rather just stick
with that.
I'd thought the following would work:
data csq (keep=node site id visitnum studay visdate qstestcd qstest qscat
qsscat qsorres qsstresc qsstresn qsdtc);
length qscat qsscat qsorres qsstresc qsstresn $200 qstest $40 qstestcd
$8;
array qvars(*) q001-q018;
set csq;
do i=1 to dim(qvars);
......
qsstresc=put(qvars(i), vformat(qvars(i)));
......
output;
end;
run;
But it doesn't - SAS apparently doesn't accept the value of vformat() as a
format name. Go figure....
Does someone know how to do this within an array?
Thanks,
Wendy
Oh, and as a reminder to those who refer to "Clinical Trails" (and there has
been more than one), it's "Clinical Trials". "Trails" sounds like fun, like
a camping trip. Think "trying" and "trials and tribulations". </kidding>
|