Problem Note 41912: PROC FCMP returns incorrect value with character value defined with a length of 32767
PROC FCMP allows a function to be defined with a character return value length of 32767 characters. Currently the resulting value is truncated to a value less than 32767 characters when the function created in PROC FCMP is called in the DATA Step. If you define the variable in PROC FCMP with the character return value of 32766 characters, the resulting value is correct when the function is called in the DATA Step. Also you may receive the following ERROR message in the SAS log when the function created by PROC FCMP is called in the DATA step:
Internal ERROR: Character Temporary size not set
Here is an example to illustrate the problem:
proc fcmp outlib = work.functions.string;
function r32767(str $) $ 32767;
String = "abcdefghijklmnopqrstuvwxyz" ;
return(String);
endsub;
run;
options cmplib=(work.functions);
data work.test1 ;
r3 = r32767('r3') ;
run;
By changing the length on the FUNCTIONS statement after the $ in PROC FCMP from 32767 to 32766, you will receive the entire string.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft® Windows® for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2008 | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Microsoft Windows XP Professional | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Enterprise 32 bit | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Enterprise x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Home Premium 32 bit | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Home Premium x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Professional 32 bit | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Professional x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Ultimate 32 bit | 9.2 TS2M2 | 9.3 TS1M0 |
Windows 7 Ultimate x64 | 9.2 TS2M2 | 9.3 TS1M0 |
Windows Vista | 9.2 TS2M2 | 9.3 TS1M0 |
Windows Vista for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
64-bit Enabled AIX | 9.2 TS2M2 | 9.3 TS1M0 |
64-bit Enabled HP-UX | 9.2 TS2M2 | 9.3 TS1M0 |
64-bit Enabled Solaris | 9.2 TS2M2 | 9.3 TS1M0 |
HP-UX IPF | 9.2 TS2M2 | 9.3 TS1M0 |
Linux | 9.2 TS2M2 | 9.3 TS1M0 |
Linux for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
OpenVMS on HP Integrity | 9.2 TS2M2 | 9.3 TS1M0 |
Solaris for x64 | 9.2 TS2M2 | 9.3 TS1M0 |
*
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: | Problem Note |
Priority: | high |
Topic: | SAS Reference ==> Procedures ==> FCMP
|
Date Modified: | 2010-12-24 10:39:19 |
Date Created: | 2010-12-17 15:24:04 |