PADOH-DHI / SAS-code

1 stars 0 forks source link

hash.clear() method fails to exist sometimes #6

Open WerthPADOH opened 8 years ago

WerthPADOH commented 8 years ago

For at least one configuration (@rwright88 in #5, log here), the array function package fails to build with the following message:

ERROR: Cannot find a library containing subroutine VALUE_HASH.CLEAR.
NOTE: Execution aborted because of errors in program.
      Reenter the corrected program or enter "QUIT;" to exit procedure.

ERROR: Cannot find a library containing subroutine VALUE_HASH.CLEAR.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE FCMP used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds

Details on SAS software used:

NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA.
 NOTE: SAS (r) Proprietary Software 9.3 (TS1M2)
 Licensed to CDC/ATSDR GRANTEE USE FOR SPONSORED PROGRAMS ONLY, Site 70084129.
 NOTE: This session is executing on the W32_7PRO platform.

NOTE: Enhanced analytical products:

SAS/STAT 12.1, SAS/ETS 12.1, SAS/OR 12.2, SAS/IML 12.1, SAS/QC 12.1
Fleegal commented 8 years ago

This error is likely a bug in SAS 9.3, and doesn't seem to affect SAS 9.4. Is there a hot fix from SAS that can be applied?

Are you getting the same error in E.G. SAS?

WerthPADOH commented 8 years ago

I'm assigning this bug to @rwright88 since he's the only one it occurs for. Anyone's free to look into the problem and try to find solutions, but he's the only one who can verify when it's solved.

Also, could you run this minimal test and share the log, Ray?

DATA _NULL_;
    var = 0;
    Declare hash a();
    a.defineKey('var');
    a.defineDone();
    a.add();
    items = a.num_items;
    Put items;
    a.clear();
    items = a.num_items;
    Put items;
Run;

@Fleegal : I haven't found any reports of it being a bug in 9.3. It seems we're building up a list of things to send to SAS customer support.

Fleegal commented 8 years ago

A similar error had a hotfix suggested online: http://support.sas.com/kb/46/702.html

WerthPADOH commented 8 years ago

It may not be too closely related. Chances are this is happening:

  1. The compiler checks if value_hash has a clear() method.
  2. The compiler can't find that method. so it looks if value_hash.clear (the entire name, including the period) is a subroutine.
  3. It can't find a subroutine with that name, so it complains that step 2 failed. It doesn't complain about step 1.
rwright88 commented 8 years ago

Here's the log when I run the data step:

13   DATA _NULL_;
14       var = 0;
15       Declare hash a();
16       a.defineKey('var');
17       a.defineDone();
18       a.add();
19       items = a.num_items;
20       Put items;
21       a.clear();
22       items = a.num_items;
23       Put items;
24   Run;

1
0
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
WerthPADOH commented 8 years ago

Sometimes, success of test code is more worrying than failure.

After more trial and error, it turns out a hash object cannot be cleared while it's being used for a hiter object. Hopefully fixed with c86ec15.