Learning SAS? Welcome to the exclusive online community for all SAS learners.

Only took 44 years but, finally, found an irrefutable bug in SAS

Reply
Super User
Posts: 8,220

Only took 44 years but, finally, found an irrefutable bug in SAS

I don't know if this bug is limited to SAS UE, SAS Studio or 9.4 M5, but I was surprised to find the following message in my log: ERROR: A bug in SAS has been encountered. Please call your SAS representative and report the following message: SQL detected an internal consistency. Of course, only being a UniversityEdition user these days, I'm not familiar with whomever might be 'my' SAS representative, thus don't know who to call. I had run the following code:

data have; informat date date9.; informat datetime datetime.; format date mmddyy10.; format datetime datetime.; format number best32.; input name $ year date datetime number; cards; John 2018 12May2018 12May2018:14:39:00 12557 Mary 2017 6Jun2017 6Jun2017:14:39:00 20192 ; data test; set sashelp.vcolumn (keep=libname memname name format type where=(libname eq 'WORK' and memname='HAVE' and (type eq 'char' or format eq '' or format ^in: ('$N8601B','$N8601BA','$N8601E', '$N8601EA','$N8601EH','$N8601EX','$N8601H', '$N8601X','B8601DA','B8601DN','B8601DT', 'B8601DZ','B8601LZ','B8601TM','B8601TZ', 'DATE','DATEAMPM','DATETIME','DAY','DDMMYY', 'DOWNAME','DTDATE','DTMONYY','DTWKDAT','DTYEAR', 'DTYYQC','E8601DA','E8601DN','E8601DT','E8601DZ', 'E8601LZ','E8601TM','E8601TZ','HHMM','HOUR', 'JULDAY','JULIAN','MMDDYY','MMSS','MMYY', 'MONNAME','MONTH','MONYY','PDJULG','PDJULI', 'QTR','QTRR','TIME','TIMEAMPM','TOD','WEEKDATE', 'WEEKDATX','WEEKDAY','WEEKU','WEEKV','WEEKW', 'WORDDAT','YEAR','YYMM','YYMMDD','YYMON', 'YYQ','YYQR','$N8601BA','$N8601E','$N8601EA', '$N8601EH','$N8601EX','$N8601H','$N8601X', 'B8601DA','B8601DN','B8601DT','B8601DZ', 'B8601LZ','B8601TM','B8601TZ','E8601DA', 'E8601DN','E8601DT','E8601DZ','E8601LZ', 'E8601TM','E8601TZ')))); run; data_null_ ran the code on 9.4 M3 and didn't receive the error. Art, CEO, AnalystFinder.com
Trusted Advisor
Posts: 1,849

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

[ Edited ]

The code you posted is not a PROC SQL code.

Your code is  probably larger. Search for proc sql and post its code or

better post the full code you have submitted.

Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Shmuel: The code I posted was the exact code I ran (sorry, couldn't post it in a SAS code box as that option isn't available in this particular community). No, while the error was definitely a SQL error, the code was simply a datastep that used the sashelp.vcolumn view. That is what brought on the sql related error message. Before trying that code, I had tried proc sql directly (using dictionary.columns) and including a statement like: where format ^in: ('$N8601B','$N8601BA','$N8601E') but that simply produced an error regarding the colon, thus I tried a datastep to see if the error was just in proc sql. That's when I received the bug error I mentioned in my post. If you run the code I posted, and are using SAS UE, you should get the same error. If you're not using SAS UE, but are using 9.4 M5, I'd be interested to know whether you get the error there as well. It doesn't occur in SAS 9.4 M3. Art, CEO, AnalystFinder.com
Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

BTW: I don't know if I'm the only one affected but, starting this morning, the Rich Text editor no longer works for me. I can only see what I type if I switch to the HTML editor but, upon doing so, don't get any of the usual options (e.g., insert SAS code). Art, CEO, AnalystFinder.com
Trusted Advisor
Posts: 1,849

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Hi @art297, I have copied your code adding identation.

I also got that error but one more precedes.

Attached is the full log of my run in SAD UE.

 

Pay attention to the 1st error: Error: sqxexpr: opcode 252 not implemented.

Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

@Shmuel: Yes, I saw that too! But, since I don't know who to report it to (other than here), I didn't bother to save the log. However, it's easy to reproduce.

 

@ChrisHemedinger: Do UE users have an administrator to whom we can report such problems?

 

As for my community forum problem, I cleared my cache and browser history and the Rich Text Editor's functionality returned.

 

Art, CEO, AnalystFinder.com

 

 

Community Manager
Posts: 706

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Hi @art297, I'll alert the folks who look after University Edition.

Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Posted in reply to BeverlyBrown

@BeverlyBrown: Turns out it's a problem with 9.4 M5, on all platforms, and not specific to SAS UE. Vince Delgado submitted it to Tech Support for me. However, I think it would benefit SAS if we (SAS UE users) were able to submit such observed problems on our own. However, currently we can't as we can't supply the customer information needed to complete the form.

 

Art, CEO, AnalystFinder.com

 

Community Manager
Posts: 706

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

@art297, submit that sort of thing to support@sas.com. 'Preciate you!

Super User
Posts: 10,623

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

This is your code visually formatted:

data have;
informat date date9.;
informat datetime datetime.;
format date mmddyy10.;
format datetime datetime.;
format number best32.;
input name $ year date datetime number;
cards;
John 2018 12May2018 12May2018:14:39:00 12557
Mary 2017 6Jun2017 6Jun2017:14:39:00 20192
;

data test;
set sashelp.vcolumn (
  keep=libname memname name format type
  where=(
    libname eq 'WORK' and memname='HAVE' and (
      type eq 'char' or format eq '' or format ^in: (
        '$N8601B','$N8601BA','$N8601E','$N8601EA','$N8601EH',
        '$N8601EX','$N8601H', '$N8601X','B8601DA','B8601DN','B8601DT', 
        'B8601DZ','B8601LZ','B8601TM','B8601TZ', 
        'DATE','DATEAMPM','DATETIME','DAY','DDMMYY', 
        'DOWNAME','DTDATE','DTMONYY','DTWKDAT','DTYEAR', 
        'DTYYQC','E8601DA','E8601DN','E8601DT','E8601DZ', 
        'E8601LZ','E8601TM','E8601TZ','HHMM','HOUR', 
        'JULDAY','JULIAN','MMDDYY','MMSS','MMYY', 
        'MONNAME','MONTH','MONYY','PDJULG','PDJULI', 
        'QTR','QTRR','TIME','TIMEAMPM','TOD','WEEKDATE', 
        'WEEKDATX','WEEKDAY','WEEKU','WEEKV','WEEKW', 
        'WORDDAT','YEAR','YYMM','YYMMDD','YYMON', 
        'YYQ','YYQR','$N8601BA','$N8601E','$N8601EA', 
        '$N8601EH','$N8601EX','$N8601H','$N8601X', 
        'B8601DA','B8601DN','B8601DT','B8601DZ', 
        'B8601LZ','B8601TM','B8601TZ','E8601DA', 
        'E8601DN','E8601DT','E8601DZ','E8601LZ', 'E8601TM','E8601TZ'
      )
    )
  )
);
run;
---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Posted in reply to KurtBremser

@KurtBremser: Other than the formatting of the parentheses at the end, that is how the code looked that I posted. For some reason, until I cleared my browser's cache and history, the forum only let me post it as text, and lost all formatting. What I saw on screen, and what everyone else saw, was definitely not WYSIWYG.

 

Regardless, of course I liked the way that you formatted the code. Now it would be nice to know why the error occurred, whether it only affects 9.4 M5 on UE, and when it will be fixed.

 

Art, CEO, AnalystFinder.com

 

Super User
Posts: 10,623

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

The complete log of your code on 9.4M5 on AIX is this:

27         data have;
28         informat date date9.;
29         informat datetime datetime.;
30         format date mmddyy10.;
31         format datetime datetime.;
32         format number best32.;
33         input name $ year date datetime number;
34         cards;

NOTE: The data set WORK.HAVE has 2 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.02 seconds
      
37         ;

38         
39         data test;
40         set sashelp.vcolumn (
41           keep=libname memname name format type
42           where=(
43             libname eq 'WORK' and memname='HAVE' and (
44               type eq 'char' or format eq '' or format ^in: (
45                 '$N8601B','$N8601BA','$N8601E','$N8601EA','$N8601EH',
46                 '$N8601EX','$N8601H', '$N8601X','B8601DA','B8601DN','B8601DT',
47                 'B8601DZ','B8601LZ','B8601TM','B8601TZ',
48                 'DATE','DATEAMPM','DATETIME','DAY','DDMMYY',
49                 'DOWNAME','DTDATE','DTMONYY','DTWKDAT','DTYEAR',
50                 'DTYYQC','E8601DA','E8601DN','E8601DT','E8601DZ',
51                 'E8601LZ','E8601TM','E8601TZ','HHMM','HOUR',
52                 'JULDAY','JULIAN','MMDDYY','MMSS','MMYY',
2                                                          The SAS System                                 09:27 Monday, May 14, 2018

53                 'MONNAME','MONTH','MONYY','PDJULG','PDJULI',
54                 'QTR','QTRR','TIME','TIMEAMPM','TOD','WEEKDATE',
55                 'WEEKDATX','WEEKDAY','WEEKU','WEEKV','WEEKW',
56                 'WORDDAT','YEAR','YYMM','YYMMDD','YYMON',
57                 'YYQ','YYQR','$N8601BA','$N8601E','$N8601EA',
58                 '$N8601EH','$N8601EX','$N8601H','$N8601X',
59                 'B8601DA','B8601DN','B8601DT','B8601DZ',
60                 'B8601LZ','B8601TM','B8601TZ','E8601DA',
61                 'E8601DN','E8601DT','E8601DZ','E8601LZ', 'E8601TM','E8601TZ'
62               )
63             )
64           )
65         );
66         run;

Error: sqxexpr: opcode 252 not implemented.
ERROR: A bug in SAS has been encountered. Please call your SAS representative and report the following message:
SQL detected an internal inconsistency.

ERROR: SQL View SASHELP.VCOLUMN could not be processed.
NOTE: The DATA step has been abnormally terminated.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEST may be incomplete.  When this step was stopped there were 0 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.00 seconds

I take it that a very important part is the first Error with the

opcode 252 not implemented

which should be included in the track opened with SAS TS.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Trusted Advisor
Posts: 1,849

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

Posted in reply to KurtBremser

I have marked several parts of the WHERE statement and found that:

 

where ... format not in (...)  results into error code 252

Error: sqxexpr: opcode 252 not implemented.

 change to where ... format in (...) results into error 251.

 

but when I replace WHERE into IF then there is no error.

 

Of course SAS should fix it.

Meanwhile you can replace the WHERE with IF.

Super User
Super User
Posts: 8,289

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

[ Edited ]

The colon modifier on conditions can not be used with PROC SQL. And so it cannot be used with WHERE statements either.

I am surprised that it causes such an unusual error message instead of a more meaningful message.

2693  proc sql ;
2694  select *
2695  from sashelp.class
2696  where name ^in: ('A','B')
                    -
                    22
                    200
ERROR 22-322: Syntax error, expecting one of the following: (, SELECT.

ERROR 200-322: The symbol is not recognized and will be ignored.

2697  ;
2698  quit;

 

Super User
Posts: 8,220

Re: Only took 44 years but, finally, found an irrefutable bug in SAS

@Tom: I don't know if the where statement with ^in: worked in sql's previous versions, but appears to have worked in 9.4 M3 (see: https://listserv.uga.edu/cgi-bin/wa?A2=ind1805b&L=SAS-L&O=D&F=P&X=32D91614047A785758&Y=art%40analyst...)

 

The documentation indicates that it should work in both places.

 

Art, CEO, AnalystFinder.com

 

Ask a Question
Discussion stats
  • 21 replies
  • 587 views
  • 3 likes
  • 6 in conversation