DATA Step, Macro, Functions and more

special characters in SAS

Reply
Frequent Learner
Posts: 1

special characters in SAS

If a value contain special character, can it be a numeric type without the use of INFORMAT/FORMAT statement?

Super User
Posts: 7,854

Re: special characters in SAS

Posted in reply to sandipan1990

"Special" (or any) characters can only be contained in character variables. Numbers are stored in binary 8-byte real format, how the values are displayed is controlled by the display format.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 11,343

Re: special characters in SAS

Posted in reply to sandipan1990

You might think of providing some examples. There are SAS display formats that can display numbers with "special characters" such as currency symbols, commas, () as well as displaying numeric date and time values with / - . Plus it is possible to create custom formats that can do some truly interesting things with values.

 

In some cases there are also matching informats to read values from a text file that include some characters such as $ into a numeric value.

Ask a Question
Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 3 in conversation