BookmarkSubscribeRSS Feed
Sudhakar_A
Calcite | Level 5
Hi ,

I want to put a Alpha symbol in dataset how to present , i tried using the Byte(224) , but i am not getting the alpha symbol.

How to store the alpha symbol in character variable?

Thanks

Sudhakar
11 REPLIES 11
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Hello Sudhakar_A,

What are you trying to accomplish? I used BYTE(224) and got the following result:
[pre]
data a;
x=BYTE(224);
y=BYTE(65);
put x= y=;
run;
[/pre]
In the LOG:
[pre]
x=à y=A
[/pre]
Is this what you need?
Sincerely,
SPR
Sudhakar_A
Calcite | Level 5
Hi SPR,

I want alpha symbol should be presented as it is in the dataset.

Thanks

Sudhakar
SPR
Quartz | Level 8 SPR
Quartz | Level 8
The following program outputs all available letters, digits ans symbols:
[pre]
data a;
do i=0 to 255;
s=BYTE(i);
output;
end;
run;
[/pre]
I ran it om my computer. the output does not contain the alpha character. Your result could be different because characters 127-255 depend on character set used.
SPR
Sudhakar_A
Calcite | Level 5
Hi SPR,

Forgot about my way of approach, can please you tell me how to bring the alpha symbol in the dataset?

Thanks

Sudhakar
SPR
Quartz | Level 8 SPR
Quartz | Level 8
How are you going to use a variable contaning greek letters? May be you need them only for titles, axis , etc? For example, for Title you can use the following code:
[pre]
ods escapechar="^";
title "Greek letter ^{unicode 03B1}";
data a;
a=1;
run;
proc print data=a;
run;
[/pre]
that prints greek alpha in the title;
SPR
Sudhakar_A
Calcite | Level 5
Hello,

I dont want to print but to store the symbol in the dataset.

Thanks

Sudhakar
raveena
Obsidian | Level 7
Hi Sudhakar,

Can you please provide us an example how your dataset needs to generate?

Thanks
Sudhakar_A
Calcite | Level 5
Hi Raveena,

Any way is ok, Datalines, infile, or import, anything is ok for me, but i want the alpha character in the dataset, and i want to submit the dataset with alpha symbol to client.

I want to create a text variable in the dataset with alpha character

Thanks

Sudhakar Message was edited by: Sudhakar_A
raveena
Obsidian | Level 7
Hi Sudhakar,

I am not sure what exactly you are expecting in the dataset.If you need to create a
new variable with alpha characters then you can use the below code,

data test;
input name $ age ;
datalines;
abc 23
fgh 6
;
run;

data test1;
set test;
alpha ="A";
run;

The example above illustrates creating a new character variable named “alpha” which contains the letter “A” for all observations in the dataset. Note that the value must be enclosed either in single or double-quotes, because this is a character variable. (alpha ="A";)


Thanks
Sudhakar_A
Calcite | Level 5
Hi Raveena,

Thanks for that. I dont want a variable name as alpha in the dataset but, i want a variable which holds the greek alpha character symbol as a value in the observation.

Thanks

Sudhakar
RickM
Fluorite | Level 6
It is possible to use UTF-16 encoding and the hexadecimal code ( var='03b1'x; ) but there is no way to ensure that it will appear correctly for someone else. I would suggest contacting tech support to see if they have a solution.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 11 replies
  • 7058 views
  • 0 likes
  • 4 in conversation