BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I use SAS9.2 phase 2.

I have several databases. I did a loop to create enrollment over time using sgplot in a %Macro. Does anybody know what happen? I searched SAS help and can not find a result.


My codes are like:

%macro test;

%do flg = 1 %to 2;

libname t Access .......;

data enroll_3;
set t.demographics;
...
run;

%* create graph;

ods listing gpath = "c:\Temp" (url = none);

ods graphics on/reset
imagefmt = gif
imagemap = on
imagename = "En_&flg."
border = off;

proc sgplot data = enroll_3;
title 'Enrollment over time' ;
step x = newDate y = count / JUSTIFY= right
LINEATTRS = (color = blue)
CURVELABELPOS= end CURVELABEL = 'Observed' ;
XAXIS grid ;
yaxis grid;
run;

ods graphics off;

%mend;

When I run it. The first plot has been created but the second one does not.

LOG:

For the first plot:

NOTE: PROCEDURE SGPLOT used (Total process time):
real time 1.84 seconds
cpu time 0.42 seconds

NOTE: Listing image output written to C:\Temp\En_5.gif.

For second plot:

NOTE: There were 87 observations read from the data set WORK.ENROLL_3.

MPRINT(DICTTOSAS): ods graphics off;
MLOGIC(DICTTOSAS): %DO loop index variable I is now 2; loop will iterate again.


NOTE: The data set WORK.ENROLL_3 has 75 observations and 7 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds


[]ERROR: Read Access Violation In Task [ SGPLOT ]
Exception occurred at (58E2000D)

Task Traceback
Address Frame (DBGHELP API Version 4.0 rev 5)
58E2000D 0F4CD734 sasxml:mcn_main+0x8F00D
58DA7F0D 0F4CD7F0 sasxml:mcn_main+0x16F0D
66F7C1F0 0F4CD96C sasods:mcn_main+0x7B1F0
66F5A53B 0F4CDC90 sasods:mcn_main+0x5953B
66F35327 0F4CDCD0 sasods:mcn_main+0x34327
66F34508 0F4CE0B8 sasods:mcn_main+0x33508
47D20C7A 0F4CFF8C sassgplo:mcn_main+0xFC7A
01572854 0F4CFFA0 sashost:Main+0xC290
0165E038 0F4CFFB4 sashost:Main+0xF7A74
7C80B699 0F4CFFEC kernel32:GetModuleFileNameA+0x1BA
1 REPLY 1
barheat
Fluorite | Level 6
This looks like a problem that should be submitted to tech support.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1514 views
  • 0 likes
  • 2 in conversation