Previous Page | Next Page

Functions and CALL Routines

URLENCODE Function



Returns a string that was encoded using the URL escape syntax.
Category: Web Tools
Restriction: I18N Level 2

Syntax
Arguments
Details
Length of Returned Variable in a DATA Step
The Basics
Examples
See Also

Syntax

URLENCODE(argument)


Arguments

argument

specifies a character constant, variable, or expression.


Details


Length of Returned Variable in a DATA Step

If the URLDECODE function returns a value to a variable that has not previously been assigned a length, then that variable is given a length of 200 bytes.


The Basics

The URLENCODE function encodes characters that might otherwise be significant when used in a URL. This function encodes all characters except for the following:

Note:   The encoded string might be longer than the original string. Ensure that you consider the additional length when you use this function.   [cautionend]


Examples

SAS Statements Results
x1=urlencode ('abc def');
put x1;
  
abc%20def
x2=urlencode ('why?');
put x2;
  
why%3F
x3=urlencode ('ABC#1');
put x3;
  
ABC%231


See Also

Function:

URLDECODE Function

Previous Page | Next Page | Top of Page