BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Chuck_White
Obsidian | Level 7

For one of my programs, SGPLOT is naming the first created path as SGPLOT#1\ByGroup21#1. Output looks fine in HTML but the files saved by ODS DOCUMENT crash when they are replayed. The first path created by SGPLOT should by SGPLOT#1\ByGroup1#1. Help would be appreciated. I'm using SAS 9.4 (TS1M4) The general form of my codes is as follows:

 

ods document name=work.temp(write);

 

proc sgplot data=display dattrmap=attr;

by var1 var2 var3 var4 var5;

loess x=x y=y / group=group attrid=attrid

jitter clm NOLEGCLM

TRANSPARENCY=.5 CLMTRANSPARENCY=.5

name="loess" legendlabel="Treatment Group";

run;

 

ods document close;

 

ods tagsets.rtf file=rtfout style=MyRTF

options (contents="yes" toc_data="yes" toc_level="2");

 

proc document name=doclib.temp;

replay ^(where=(_path_ ? "\sgplot"));

run;

quit;

run;

ods _all_ close;

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenKuhfeld
Rhodochrosite | Level 12

David Kelley confirms that you have found a bug in the BY group numbering that appears in the ODS document.  I have entered this issue into our defect tracking system.  Thanks for pointing this out.  Sorry for any inconvenience.  Please let me know if there is an actual crash or if you have additional questions.

View solution in original post

7 REPLIES 7
WarrenKuhfeld
Rhodochrosite | Level 12

I can't comment on everything you have done, but two things look suspect.  You changed the name of your document.  I changed the library back to work.  You did not specify SGPlot in the right case or use functions to convert to all upper or lower case.  I changed a number of other things because I did not have your data, etc.  I always list the contents of the document before replaying it.  In SAS/STAT R&D we heavily rely on the ODS document and SGPLOT to make our documentation, and it works great.  I hope this helps.

 

ods document name=work.temp(write);
 
proc sgplot data=sashelp.class;
  loess x=weight y=height;
run;
 
ods document close;
 
ods listing;
proc document name=work.temp;
   list / levels=all;
   quit;

ods rtf file='C:\temp.rtf';
 
proc document name=work.temp;
   replay ^(where=(_path_ ? "\SGPlot"));
run;
quit;
run;
ods _all_ close;
Chuck_White
Obsidian | Level 7

It wouldn't surprise me if my problem is specific to my installation but thank you very much for suggesting a demo dataset. If you look at the ByGroup numbers produced when I use by group processsing, you will see that they are nonstandard. As to my previous mistakes in the code, I had stripped out a lot of my original code and anonymized my variables. Sorry I didn't check further....

 

My code and proc document listing are provided below my signature.

 

Thanks again!

 

Chuck

 

ods document name=work.temp(write);

 

proc sort data=sashelp.class out=class;

by sex;

proc sgplot data=class;

by sex;

loess x=weight y=height;

run;

 

ods document close;

 

ods listing;

proc document name=work.temp;

list / levels=all;

quit;

ods rtf file='!TEMP\SAS Temporary Files\temp.rtf';

 

proc document name=work.temp;

replay ^(where=(_path_ ? "\SGPlot"));

run;

quit;

run;

ods _all_ close;

 

The SAS System 1

15:05 Thursday, July 6, 2017

Listing of: \Work.Temp\

Order by: Insertion

Number of levels: All

Obs Path Type

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

1 \SGPlot#1 Dir

2 \SGPlot#1\ByGroup3#1 Dir

3 \SGPlot#1\ByGroup3#1\SGPlot#1 Graph

4 \SGPlot#1\ByGroup4#1 Dir

5 \SGPlot#1\ByGroup4#1\SGPlot#1 Graph

 

WarrenKuhfeld
Rhodochrosite | Level 12

Hi Chuck,

It runs for me.  I have no explanation for why the by groups are 3 and 4.  It does not seem to be due to multiple destinations being open.  I tried procs that I know do multiple data passes, and I get groups 1 and 2.  I have never noticed this before.  However, I don't try to figure out the path the document uses.  I just specify it.  Most of the time the way I use it in our documentation system, I can just specify the last level and the macros I wrote take care of the rest, so I don't have to notice the full path.  I never try to anticipate the path.  I just use it.

 

Does the document really crash?  Please elaborate or provide error messages.

 

FWIW, Here is one of my blogs on the ods document.  It is not your context, but it shows one way to process files in a document without having to actually know what they are.  Scroll down to the last example.

http://blogs.sas.com/content/graphicallyspeaking/2016/11/23/advanced-ods-graphics-remove-ods-subtitl...

 

I hope this helps.

Warren

WarrenKuhfeld
Rhodochrosite | Level 12

loess, reg, and pbspline all have the same unexpected numbering. Scatter does not. I am guessing that it has something to do with the graphics engine computations.  I suppose the BY counter gets incremented for each by group for all of the computations before it goes through another set of increments for the actual graphs?  I am speculating here.  I will see if I can ask the document expert today at work and find out.

WarrenKuhfeld
Rhodochrosite | Level 12

David Kelley confirms that you have found a bug in the BY group numbering that appears in the ODS document.  I have entered this issue into our defect tracking system.  Thanks for pointing this out.  Sorry for any inconvenience.  Please let me know if there is an actual crash or if you have additional questions.

Chuck_White
Obsidian | Level 7

I haven't been able to reproduce the error with the sashelp.class dataset but what it's doing to my project code is a hard crash with the following error message in the log window:


Invalid free() attempt to deleted pool

 

Invalid free() attempt to deleted pool

 

Invalid free() attempt to deleted pool

WARNING: No Close statement was given for the TAGSETS.RTF
WARNING: destination. This SAS session is ending.  The output
WARNING: file will be incomplete.

 

Thanks for your help!

DavidK_SAS
SAS Employee

I can fix the BY group numbering issue in a future SAS release.

 

I recommend opening a track with Tech Support for the crash: http://support.sas.com/ctx/supportform/createForm .

 

-- David Kelley

   Output Delivery and Reporting

   SAS

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1979 views
  • 5 likes
  • 3 in conversation