Problem Note 64450: The HASHING_FILE function returns different results if one file is referenced by the file path and the other file is referenced by a fileref
The HASHING_FILE function is used to hash files so that the files can be compared easily. If the second argument in one function is a file path for one file and the second argument in another function is a fileref for the same file, the functions return different results.
Here is an example from a SAS® log that illustrates the problem. The HASHING_FILE functions return different results even though they are referring to the same file.
124 filename myfile 'c:\dstep\hash2.txt';
125 data a;
126 rc=put(hashing_file('sha256', 'myfile',4),$hex64.);
127 put rc=;
128 rc=put(hashing_file('sha256', 'c:\dstep\hash2.txt'),$hex64.);
129 put rc=;
130 run;
rc=4246463344394642333132343834304341363142444631463346384136454339
rc=3033413542413532363046424331423042373836433641414136363546433037
The circumvention to this problem is to point to the files either by using the file path in both functions or by using a fileref in both functions.
Operating System and Release Information
SAS System | Base SAS | z/OS | 9.4 TS1M6 | |
z/OS 64-bit | 9.4 TS1M6 | |
Microsoft® Windows® for x64 | 9.4 TS1M6 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4 TS1M6 | |
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M6 | |
Microsoft Windows 8 Pro 32-bit | 9.4 TS1M6 | |
Microsoft Windows 8 Pro x64 | 9.4 TS1M6 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M6 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M6 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M6 | |
Microsoft Windows 8.1 Pro x64 | 9.4 TS1M6 | |
Microsoft Windows 10 | 9.4 TS1M6 | |
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M6 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M6 | |
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M6 | |
Microsoft Windows Server 2012 Std | 9.4 TS1M6 | |
Microsoft Windows Server 2016 | 9.4 TS1M6 | |
Microsoft Windows Server 2019 | 9.4 TS1M6 | |
Windows 7 Enterprise 32 bit | 9.4 TS1M6 | |
Windows 7 Enterprise x64 | 9.4 TS1M6 | |
Windows 7 Home Premium 32 bit | 9.4 TS1M6 | |
Windows 7 Home Premium x64 | 9.4 TS1M6 | |
Windows 7 Professional 32 bit | 9.4 TS1M6 | |
Windows 7 Professional x64 | 9.4 TS1M6 | |
Windows 7 Ultimate 32 bit | 9.4 TS1M6 | |
Windows 7 Ultimate x64 | 9.4 TS1M6 | |
64-bit Enabled AIX | 9.4 TS1M6 | |
64-bit Enabled Solaris | 9.4 TS1M6 | |
HP-UX IPF | 9.4 TS1M6 | |
Linux for x64 | 9.4 TS1M6 | |
Solaris for x64 | 9.4 TS1M6 | |
*
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 HASHING_FILE function is used to hash files so that the files can be compared easily. If the second argument to the function is a file path for one file and a fileref for the second file, then the functions return different results.
Type: | Problem Note |
Priority: | medium |
Date Modified: | 2019-07-10 16:27:15 |
Date Created: | 2019-07-10 09:29:09 |