SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 66121: The items in a multiple-item list do not maintain the same order in which you inserted them when using ordered DATA step hashes

DetailsHotfixAboutRate It

The items in a multiple-item list do not maintain the same order in which you inserted them when using ordered DATA step hashes. 

This problem occurs when the MULTIDATA:'YES' argument is specified in the DECLARE HASH statement.

The following code example illustrates the problem, and there is also a line in the comments that provides a workaround:

data _null_;
   length state $ 2 city $ 32;

   dcl hash h(multidata:'y');
   h.definekey('state');
   h.definedata('city');
   h.definedone();
/* Uncomment the next line for the workaround */
/* if 0 then h.find_prev(); */
   state = 'NC'; city = 'Raleigh'; h.add();
   state = 'NC'; city = 'Cary'; h.add();
   state = 'NC'; city = 'Wilson'; h.add();
   state = 'NC'; city = 'Spruce Pine'; h.add();

   state = 'NC';
      do while (h.do_over() = 0);
      put state= city=;
   end;
run;

When the code above is run without the workaround, the city names are listed in the output as “Raleigh, Spruce Pine, Wilson, Cary.” You would expect the output to list the items as “Raleigh, Cary, Wilson, Spruce Pine,” which is how you ordered them in the code.

Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.



Operating System and Release Information

Product FamilyProductSystemProduct ReleaseSAS Release
ReportedFixed*ReportedFixed*
SAS SystemSAS ViyaLinux for x643.43.5ViyaViya
Windows Vista3.4Viya
Windows Millennium Edition (Me)3.4Viya
Windows 7 Ultimate x643.43.5ViyaViya
Windows 7 Ultimate 32 bit3.4Viya
Windows 7 Professional x643.43.5ViyaViya
Windows 7 Home Premium x643.43.5ViyaViya
Windows 7 Home Premium 32 bit3.4Viya
Windows 7 Enterprise x643.43.5ViyaViya
Windows 7 Enterprise 32 bit3.4Viya
Microsoft Windows XP Professional3.4Viya
Microsoft Windows Server 20163.43.5ViyaViya
Microsoft Windows Server 2012 Std3.43.5ViyaViya
Microsoft Windows Server 2012 R2 Std3.43.5ViyaViya
Microsoft Windows Server 2012 R2 Datacenter3.43.5ViyaViya
Microsoft Windows Server 2012 Datacenter3.43.5ViyaViya
Microsoft Windows Server 2008 for x643.43.5ViyaViya
Microsoft Windows Server 2008 R23.43.5ViyaViya
Windows 7 Professional 32 bit3.4Viya
Windows Vista for x643.43.5ViyaViya
Microsoft Windows Server 20193.4Viya
Microsoft® Windows® for x643.43.5ViyaViya
Microsoft Windows 8 Enterprise 32-bit3.4Viya
Microsoft Windows 8 Enterprise x643.43.5ViyaViya
Microsoft Windows 8 Pro 32-bit3.4Viya
Microsoft Windows 8 Pro x643.43.5ViyaViya
Microsoft Windows 8.1 Enterprise 32-bit3.4Viya
Microsoft Windows 8.1 Enterprise x643.43.5ViyaViya
Microsoft Windows 8.1 Pro 32-bit3.4Viya
Microsoft Windows 8.1 Pro x643.43.5ViyaViya
Microsoft Windows 103.43.5ViyaViya
Microsoft Windows 95/983.4Viya
Microsoft Windows 2000 Advanced Server3.4Viya
Microsoft Windows 2000 Datacenter Server3.4Viya
Microsoft Windows 2000 Server3.4Viya
Microsoft Windows 2000 Professional3.4Viya
Microsoft Windows NT Workstation3.4Viya
Microsoft Windows Server 2003 Datacenter Edition3.4Viya
Microsoft Windows Server 2003 Enterprise Edition3.4Viya
Microsoft Windows Server 2003 Standard Edition3.4Viya
Microsoft Windows Server 2003 for x643.43.5ViyaViya
Microsoft Windows Server 20083.4Viya
* 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.