Problem Note 69899: Calling a user-defined function with the PROC FORMAT OTHER= argument can cause SAS® to stop responding
When you call a user-defined function that was created by the FCMP procedure with the OTHER= argument in the FORMAT procedure, SAS might stop responding. This issue occurs if the variable name in the assignment statement is the same as the argument that is passed to the PROC FCMP function. The following sample code replicates this behavior:
proc format;
value $stlight
'G' = 'Green'
'R' = 'Red'
'Y' = 'Yellow';
run;
data one;
input value $ type $ amount;
datalines;
g min 2
G sec 30
R min 1
y sec 10
Y sec 30
;
run;
proc fcmp outlib=work.funcs.simple;
function stoplight (str $) $;
str=upcase(str);
color=put(str,$stlight.);
return(color);
endfunc;
quit;
options cmplib=work.funcs;
proc format;
value $lightchange other=[stoplight()];
run;
data two;
set one;
length colorname $10;
colorname=put(value, $lightchange10.);
upcolor=stoplight(value);
run;
If you modify the PROC FCMP code to create a new variable name in the assignment statement, SAS does not stop responding. Here is the modified PROC FCMP code:
proc fcmp outlib=work.funcs.simple;
function stoplight (str $) $;
mystr=upcase(str);
color=put(mystr,$stlight.);
return(color);
endfunc;
quit;
Click the Hot Fix tab in this note to access the hot fix for this issue.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 TS1M7 | |
z/OS 64-bit | 9.4 TS1M7 | |
Microsoft® Windows® for x64 | 9.4 TS1M7 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M7 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M7 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M7 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M7 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M7 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M7 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M7 | |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M7 | |
Microsoft Windows 10 | 9.4 TS1M7 | |
Microsoft Windows 11 | 9.4 TS1M7 | |
Microsoft Windows Server 2008 | 9.4 TS1M7 | |
Microsoft Windows Server 2008 R2 | 9.4 TS1M7 | |
Microsoft Windows Server 2008 for x64 | 9.4 TS1M7 | |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M7 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M7 | |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M7 | |
Microsoft Windows Server 2012 Std | 9.4 TS1M7 | |
Microsoft Windows Server 2016 | 9.4 TS1M7 | |
Microsoft Windows Server 2019 | 9.4 TS1M7 | |
Microsoft Windows Server 2022 | 9.4 TS1M7 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M7 | |
Windows 7 Enterprise x64 | 9.4 TS1M7 | |
Windows 7 Home Premium 32 bit | 9.4 TS1M7 | |
Windows 7 Home Premium x64 | 9.4 TS1M7 | |
Windows 7 Professional 32 bit | 9.4 TS1M7 | |
Windows 7 Professional x64 | 9.4 TS1M7 | |
Windows 7 Ultimate 32 bit | 9.4 TS1M7 | |
Windows 7 Ultimate x64 | 9.4 TS1M7 | |
64-bit Enabled AIX | 9.4 TS1M7 | |
64-bit Enabled Solaris | 9.4 TS1M7 | |
HP-UX IPF | 9.4 TS1M7 | |
Linux for x64 | 9.4 TS1M7 | |
Solaris for x64 | 9.4 TS1M7 | |
*
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 SAS Reference ==> Procedures ==> FORMAT
|
Date Modified: | 2023-06-06 14:33:33 |
Date Created: | 2023-02-23 14:57:47 |