$BASE64Xw. Format

Converts character data into ASCII text by using Base 64 encoding.

Category: Character
Alignment: Left

Syntax

$BASE64Xw.

Syntax Description

w

specifies the width of the output field.

You can use the following formula to determine the width:
format-width=(variable-length+2)/3*4
When the variable-length+2 is divided by 3, the results are truncated to an integer and multiplied by 4. For example, if a variable length is 48, the width calculation is (48+2)/3*4=64.
If the format width is too small, the value is not converted. No message is written to the SAS log.
Default 1
Range 1–32767

Details

Base 64 is an industry encoding method whose encoded characters are determined by using a positional scheme that uses only ASCII characters. Several Base 64 encoding schemes have been defined by the industry for specific uses, such as email or content masking. SAS maps positions 0–61 to the characters A–Z, a–z, and 0–9. Position 62 maps to the character +, and position 63 maps to the character /.
The following are some uses of Base 64 encoding:
  • embed binary data in an XML file
  • encode passwords
  • encode URLs
The '=' character in the encoded results indicates that the results have been padded with zero bits. In order for the encoded characters to be decoded, the '=' must be included in the value to be decoded.

Example

put x $base64x64.;
Value of x
Result
"FCA01A7993BC"
RkNBMDFBNzk5M0JD
"MyPassword"
TXlQYXNzd29yZA= =
"www.mydomain.com/myhiddenURL"
d3d3Lm15ZG9tYWluLmNvbi9teWhpZGRlblVSTA= =

See Also

The LIBNAME statement option XMLDOUBLE=DISPLAY | INTERNAL in SAS XML LIBNAME Engine: User's Guide
Informats: