Date: Thu, 26 Jul 2001 11:57:26 -0400
Reply-To: "Brittain, James" <zqr0@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Brittain, James" <zqr0@CDC.GOV>
Subject: Convert characters to ASCII and back?
Content-Type: multipart/alternative;
I am sure there are some formats and informats to do what I am looking for
but I can't seem to find the right ones. I need to take a character
variable, make a new numeric variable, and then convert it back to the
original character.
Here is the real problem:
I have data that is a list of variables that is shown in the range and I
need to create a dataset with all of the variables. We are talking about
multiple datasets with at least 1000 variables each so this has to be
dynamic.
here is a sample of the data:
VARIABLE_RANGE
-----------------------------
A1B1 - A1B5
B354 - B360
I need to get it to look like this:
VARIABLE
----------------
A1B1
A1B2
A1B3
A1B4
A1B5
B354
B355
B356
B357
B358
B359
B360
I have that part taken care of already. I isolated the root and the index
and use a loop to output each variable with the incremented index. My
problem is that sometimes the index is CHARACTER and SAS can't use that as
an index. So I wanted to convert the CHARACTER index to the ASCII form and
then convert it back before outputting it but I can't find the right format
or informats.
Here is an example of the problem data:
VARIABLE_RANGE
------------------------------
A3A - A3E
Which should come out as:
VARIABLE
----------------
A3A
A3B
A3C
A3D
A3E
[text/html]