Problem Note 66807: FCMP procedure code with certain function calls might cause memory errors with the DS2 procedure
PROC FCMP creates custom functions. When the PROC FCMP code includes certain functions such as TRIM, STRIP, and LENGTH, PROC DS2 can produce memory-related errors that are similar to the following after it calls the custom function:
ERROR: Unknown exception
ERROR: Freeing Memory Not Allocated Pool [00000000045A3510] Value
[000000000FDDAF00] tkFnc pool.
Traceback for Thread [00000000045F14E0] tkFnc pool
00000000100191AE 000000002F9AF460 tkmk:tkBoot+0x1745E000000002FA53AF2
000000002F9AF468 cmpext:tkextver+0xEEE12
ERROR: General error
See the Full Code tab for an example of code that encounters this problem.
Click the Hot Fix tab in this note to access the hot fix for this issue for SAS® 9.4M7 (TS1M7).
This issue is also fixed in SAS® Viya® 2020.0.1.
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows 8 Enterprise x64 | 9.4 TS1M5 | Viya |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M5 | |
z/OS | 9.4 TS1M5 | Viya |
z/OS 64-bit | 9.4 TS1M5 | Viya |
Microsoft® Windows® for x64 | 9.4 TS1M5 | Viya |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M5 | Viya |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M5 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M5 | Viya |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M5 | |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M5 | Viya |
Microsoft Windows 10 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2008 | 9.4 TS1M5 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2012 Std | 9.4 TS1M5 | Viya |
Microsoft Windows Server 2016 | 9.4 TS1M5 | Viya |
Windows 7 Enterprise 32 bit | 9.4 TS1M5 | |
Windows 7 Enterprise x64 | 9.4 TS1M5 | Viya |
Windows 7 Home Premium 32 bit | 9.4 TS1M5 | |
Windows 7 Home Premium x64 | 9.4 TS1M5 | Viya |
Windows 7 Professional 32 bit | 9.4 TS1M5 | |
Windows 7 Professional x64 | 9.4 TS1M5 | Viya |
Windows 7 Ultimate 32 bit | 9.4 TS1M5 | |
Windows 7 Ultimate x64 | 9.4 TS1M5 | Viya |
64-bit Enabled AIX | 9.4 TS1M5 | Viya |
64-bit Enabled Solaris | 9.4 TS1M5 | Viya |
HP-UX IPF | 9.4 TS1M5 | Viya |
Linux for x64 | 9.4 TS1M5 | Viya |
Solaris for x64 | 9.4 TS1M5 | Viya |
*
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.
The PROC FCMP code example here contains the TRIM function. The subsequent PROC DS2 code example that calls the newly created function fails with errors.
/* Create a valid path to a directory on your system */
libname sas_ds2 "C:\mydir";
libname base '.';
/* Create the function with_trim that contains the TRIM function */
proc fcmp outlib=base.fcmpsubs.sql_tools ;
function with_trim($ myVal) $ 100;
length outvar $ 100;
outvar =trim(myVal);
return(outvar);
endsub;
run;
/* Create the package myfunc using the DS2-supplied FCMP package */
proc ds2;
package myfunc / overwrite=yes language='fcmp' table='base.fcmpsubs';
run;
/* Call the st.with_trim custom function created with PROC FCMP */
package sas_ds2.dataset_info/overwrite=yes;
dcl package myfunc st();
method getTrimmed() returns char(100);
declare char(100) tempStr;
tempStr = st.with_trim('String to Trim ');
return tempStr;
end;
endpackage;
/* Call the f.getTrimmed method from the previous step */
data _null_ ;
declare package sas_ds2.dataset_info f();
declare char(100) varlistOut;
method init();
f = _new_ sas_ds2.dataset_info();
varlistOut = f.getTrimmed();
end;
enddata;
run;
quit;
Type: | Problem Note |
Priority: | medium |
Topic: | SAS Reference ==> Procedures ==> FCMP SAS Reference ==> Procedures ==> DS2
|
Date Modified: | 2020-12-22 08:57:37 |
Date Created: | 2020-10-19 13:41:47 |