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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

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