Problem Note 18075: SAS-supplied format may be used instead of user-defined format without
warning
If you create a user-defined format with PROC FORMAT and the format name
is an internal one that SAS supplies, you may not receive a note or
warning to that effect.
If you later apply the user-defined format to a variable, the SAS
supplied format may be used instead. This occurs for some formats.
For example, the SAS 9.1 log below shows the user-defined WEEK format
successfully created with no note or warning. When the format is later
referenced with the PUT statement, the SAS-supplied format is displayed.
538 proc format;
539 value week
540 low-1 = "0"
541 2-10 = "1";
NOTE: Format WEEK has been output.
543 data _null_;
544 x=1;
545 put x week.;
546 run;
1960-W00-07
The workaround is to change the name of the user-defined format. If you
have the original source code, you can simply change the name and rerun
the code to create the new format. If not, follow the instructions
below, including the final step that shows how to delete the duplicate
format.
To do this, the PROC FORMAT CNTLOUT= option is used to output a data
set. Assign a new value to the variable FMTNAME, then recreate the
format with the PROC FORMAT CNTLIN= option. If you then want to clean up
the format catalog by removing the original format from the FORMAT
catalog, you can use the PROC CATALOG DELETE statement.
See the sample code for the workaround below.
/* output selected entry to data set */
proc format cntlout=newfmt;
select week;
run;
/* Assign new format name */
data newfmt;
set newfmt;
fmtname="SiteSpecificWeek";
run;
/* Create new format */
proc format cntlin=newfmt ;
run;
/* Delete old format */
proc catalog cat=work.formats;
delete week.format;
run;
quit;
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows 95/98 | 8.2 TS2M0 | |
Microsoft Windows NT Workstation | 8.2 TS2M0 | |
Microsoft Windows XP Professional | 8.2 TS2M0 | |
Windows Millennium Edition (Me) | 8.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9 TS M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 8.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 8.2 TS2M0 | |
Microsoft Windows 2000 Professional | 8.2 TS2M0 | |
Microsoft Windows 2000 Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Advanced Server | 8.2 TS2M0 | |
Microsoft Windows 2000 Datacenter Server | 8.2 TS2M0 | |
Solaris | 8.2 TS2M0 | |
OpenVMS VAX | 8.2 TS2M0 | |
IRIX | 8.2 TS2M0 | |
64-bit Enabled Solaris | 8.2 TS2M0 | |
OS/2 | 8.2 TS2M0 | |
Linux | 8.2 TS2M0 | |
z/OS | 8.2 TS2M0 | |
ABI+ for Intel Architecture | 8.2 TS2M0 | |
HP-UX | 8.2 TS2M0 | |
CMS | 8.2 TS2M0 | |
HP-UX IPF | 9 TS M0 | |
64-bit Enabled HP-UX | 8.2 TS2M0 | |
OpenVMS Alpha | 8.2 TS2M0 | |
64-bit Enabled AIX | 8.2 TS2M0 | |
Tru64 UNIX | 8.2 TS2M0 | |
AIX | 8.2 TS2M0 | |
*
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: | medium |
Topic: | SAS Reference ==> Procedures ==> FORMAT
|
Date Modified: | 2006-07-28 14:19:34 |
Date Created: | 2006-07-13 14:36:01 |