Help using Base SAS procedures

Proc report: Weird Error Message

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 142
Accepted Solution

Proc report: Weird Error Message

Hi all--

I am doing the spreadsheet reformatting via tagsets.excelxpand proc Report. Everything was going fine until I started to get a weird error message. I have looked through all the documentation and I can’t find it. Does anyone know what this means? 

Thanks!

ERROR:  Read Access Violation In Task [ REPORT ]

Exception occurred at (4FD0788C)

Task Traceback

Address   Frame     (DBGHELP API Version 4.0 rev 5)

4FD0788C  0AC6DEA4  tkmk:tkBoot+0x6868

017ACCEB  0AC6DEB4  sashost:Main+0x16727

66FDD075  0AC6DED8  sasods:mcn_main+0xDC075

66FDACE4  0AC6E038  sasods:mcn_main+0xD9CE4

66FDF8E7  0AC6E5C8  sasods:mcn_main+0xDE8E7

58DAF291  0AC6E6A0  sasxml:mcn_main+0x1E291

08786C80  0AC6E7D4  sasrep7:mcn_main+0x5C80

0878CA96  0AC6E990  sasrep7:mcn_main+0xBA96

0878BE0A  0AC6EA00  sasrep7:mcn_main+0xAE0A

66F2B4E1  0AC6EB48  sasods:mcn_main+0x2A4E1

66F2A17D  0AC6EC6C  sasods:mcn_main+0x2917D

64C14CF7  0AC6FBA0  sasrepmn:mcn_main+0x3CF7

64BF1090  0AC6FF90  sasrepor:mcn_main+0x90

017A2854  0AC6FFA4  sashost:Main+0xC290

0188E038  0AC6FFB8  sashost:Main+0xF7A74

77E64829  0AC6FFEC  kernel32:GetModuleHandleA+0xDF


Accepted Solutions
Solution
‎02-01-2012 05:08 PM
PROC Star
Posts: 7,363

Proc report: Weird Error Message


All Replies
Solution
‎02-01-2012 05:08 PM
PROC Star
Posts: 7,363

Proc report: Weird Error Message

The following may or may not apply: http://support.sas.com/kb/39/506.html

Frequent Contributor
Posts: 142

Proc report: Weird Error Message

Perfect, yes.  I think the ":" in my proc report, code is the problem (as the the description of the error message indicated) . I am trying to pull in a list of variables using the wildcard : and when i remove the variables in the columns statement that have : at the end, the program works. Thanks!

SAS Super FREQ
Posts: 8,743

Proc report: Weird Error Message

This would be an scenario where you need to work with Tech Support. If the problem is a bad TAGATTR specification, then they can help you figure out what the right TAGATTR value should be.

cynthia

Frequent Contributor
Posts: 142

Proc report: Weird Error Message

I am writing a description of the problem to Tech Support now. Thanks! I think the ":" in my proc report, code is the problem (as the the description of the error message indicated) . I am trying to pull in a list of variables using the wildcard : and when i remove the variables in the columns statement that have : at the end, the program works.

SAS Super FREQ
Posts: 8,743

Re: Proc report: Weird Error Message

Hi:

  Since you didn't post your code, I don't know what you tried. I hope you didn't try this:

DEFINE var: / display;

and try to use the variable list in the DEFINE statement. I would NOT expect that to work. A DEFINE statement only references 1 report item.

  I tried using a varlist only in the COLUMN statement and didn't have an issue (see screenshot), even with a mix of numeric and character variables in the numbered variables in my list. So, it's probably a good thing that you're working with Tech Support.

cynthia

data testlist(keep=name restSmiley Happy;

  set  sashelp.class;

  length rest1 8 rest2 $1 rest3 rest4 8;

  rest1 = age;

  rest2 = sex;

  rest3 = height;

  rest4 = weight;

run;

    

ods listing close;

ods tagsets.excelxp file='c:\temp\varlist.xls'

    style=sasweb;

  

proc report data=testlist nowd;

  column name rest:;

  define name / order;

  define rest1 / display;

  define rest2 / display;

  define rest3/ sum

         style(column)={tagattr="format:##0.00"};

  define rest4 /sum

         style(column)={tagattr="format:##0.0"};

run;

 

ods tagsets.excelxp close;


using_varlist_xp.jpg
Respected Advisor
Posts: 3,777

Re: Proc report: Weird Error Message

Cynthia@sas wrote:

Hi:

  Since you didn't post your code, I don't know what you tried. I hope you didn't try this:

DEFINE var: / display;


Actually PROC REPORT is fine with a "SAS Variable List" in DEFINE and COLUMN statements and perhpaps other places too.  It is NOT fine with a list of variables in a DEFINE statement.  Sometimes using "SAS Variable Lists" like _ALL_ will cause the message

WARNING: Name is not in the report definition.

As _ALL_ refers to all variables in the input data set where the COLUMN statement may not include of those all variables.

12   proc report nowd list data=sashelp.class;

13      column sex age--weight name;

14      define _all_ / display;

15      define sex / order;

16      define Height--Weight / format=8.2;

17      run;

PROC REPORT DATA=SASHELP.CLASS LS=123 PS=63  SPLIT="/" CENTER ;

COLUMN  ( Sex Age Height Weight Name );

DEFINE  Sex / ORDER FORMAT= $1. WIDTH=1     SPACING=2   LEFT "Sex" ;

DEFINE  Age / DISPLAY FORMAT= BEST9. WIDTH=9     SPACING=2   RIGHT "Age" ;

DEFINE  Height / DISPLAY FORMAT= 8.2 WIDTH=8     SPACING=2   RIGHT "Height" ;

DEFINE  Weight / DISPLAY FORMAT= 8.2 WIDTH=8     SPACING=2   RIGHT "Weight" ;

DEFINE  Name / DISPLAY FORMAT= $8. WIDTH=8     SPACING=2   LEFT "Name" ;

RUN;

SAS Super FREQ
Posts: 8,743

Re: Proc report: Weird Error Message

Hi:

  Thanks for making me test my code. I should have tested before I posted. You are right. I stand corrected. (and all the more reason for the OP to work with Tech Support)

  The interesting thing is that with SAS 9.3, ALL of the code below (including _ALL_ and the double hyphen list) worked for me. What version of SAS did you use for your test?

cynthia


ods listing;
** make sure I know the order of variables;
** to use the double hyphen list;

** name is in pos1, with sex--weight in pos 2 through 5;


proc contents data=sashelp.class;
run;
 
ods listing close;

** use double hyphen;
ods tagsets.excelxp file='c:\temp\use_double_hyphen_list.xls'
    style=sasweb;
  
proc report data=sashelp.class nowd;
  column sex--weight name;
  define name / order;
  define sex--weight / display;
run;
 
ods tagsets.excelxp close;

** use colon;
ods tagsets.excelxp file='c:\temp\use_colon.xls'
    style=sasweb;
    
proc report data=testlist nowd;
  column name rest:;
  define name / order;
  define rest: / display;
run;
   
ods tagsets.excelxp close;
 
** use _all_;
ods tagsets.excelxp file='c:\temp\use_all.xls'
    style=sasweb;
    
proc report data=sashelp.class nowd;
  column  _all_;
  define _all_ / display;
run;
   
ods tagsets.excelxp close;

  

** use _character_ and _numeric_;
ods tagsets.excelxp file='c:\temp\use_char_num.xls'
    style=sasweb;
  
proc report data=sashelp.class nowd;
  column _character_ _numeric_;
  define _character_ / display;
  define _numeric_ / f=best8.2;
run;
 
ods tagsets.excelxp close;
 

Respected Advisor
Posts: 3,777

Re: Proc report: Weird Error Message

Cynthia@sas wrote:

What version of SAS did you use for your test?

cynthia

NOTE: SAS (r) Proprietary Software 9.2 (TS2M0)


SAS Super FREQ
Posts: 8,743

Proc report: Weird Error Message

Hmmm...curiouser and curiouser. And in the REPORT doc, it refers to the DEFINE statement as being used for a report-item (singular) and there's nothing in the doc about the ability to use the variable lists or referencing techniques. So, this is an instance where it seems like the colon technique,and some of the other techniques might work with SAS 9.3, at least and possibly 9.2, but they are probably not the cause of the READ ACCESS VIOLATION. So, we have now wandered far afield of the original question and issue. It'll be interesting to see what the problem really was/is.

cynthia

Super Contributor
Posts: 394

Proc report: Weird Error Message

Cynthia@sas wrote:

And in the REPORT doc, it refers to the DEFINE statement as being used for a report-item (singular) and there's nothing in the doc about the ability to use the variable lists or referencing techniques.

PROC REPORT will accept a variable name list as a report-item in a DEFINE statement, but curiously this has never been documented. Our documentation people assure me that this will be rectified in the next edition of the PROC REPORT documentation.

SAS Super FREQ
Posts: 8,743

Proc report: Weird Error Message

Cool, Tim! Thanks for clarifying that!

cynthia

Respected Advisor
Posts: 3,777

Proc report: Weird Error Message

I've seen READ ACCESS VIOLATION from PROC REPORT many times.  Usually involving FLOW (don't use that much any more) or COMPUTE as I recall.  I usually just start factoring out bits until I find the point were it works again and then think about it some more.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 12 replies
  • 1100 views
  • 3 likes
  • 5 in conversation