Usage Note 23961: How do I remove unwanted spaces in the URLs that I have dynamically created?
If you use the PUT statement in a DATA step to generate
URLs, you might get unexpected spaces in your output. URLs should never contain spaces, but the PUT statement always includes a space after it writes the contents of a DATA step variable. For example, the code
url=symget('_URL');
put '<A HREF="' url '?
_service=default&_program=...';
produces
<A HREF="/cgi-bin/broker ?
_service=default&_program=...
The best way to overcome this problem is to construct the entire line of HTML code in a character string DATA step variable and write it with a PUT statement. For example,
url=symget('_URL');
line='<A HREF="'||trim(left(url))||
'?_service=default&_program=...';
put line;
This code produces the line correctly because nothing follows the variable in the PUT statement. A space is still produced, but it is at the end of the line. It is also possible to use formatted output or pointer control syntax to eliminate unwanted spaces. For more details, see SAS documentation about the PUT statement.
Operating System and Release Information
| SAS System | SAS/IntrNet | Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
| OpenVMS VAX | | |
| Microsoft Windows XP 64-bit Edition | | |
| z/OS | | |
| Microsoft® Windows® for x64 | | |
| Windows | | |
| Microsoft Windows 95/98 | | |
| Microsoft Windows 2000 Advanced Server | | |
| Microsoft Windows 2000 Datacenter Server | | |
| Microsoft Windows 2000 Server | | |
| Microsoft Windows 2000 Professional | | |
| Microsoft Windows NT Workstation | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows XP Professional | | |
| WINDOWS/NTSV | | |
| Windows Millennium Edition (Me) | | |
| Windows Vista | | |
| 64-bit Enabled AIX | | |
| 64-bit Enabled HP-UX | | |
| 64-bit Enabled Solaris | | |
| ABI+ for Intel Architecture | | |
| AIX | | |
| HP-UX | | |
| HP-UX IPF | | |
| IRIX | | |
| Linux | | |
| Linux on Itanium | | |
| OpenVMS Alpha | | |
| Solaris | | |
| Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | Software Components ==> Application Dispatcher
|
| Date Modified: | 2004-06-16 13:26:59 |
| Date Created: | 2004-04-28 16:48:57 |