Set auto-number limit on graph files created to higher than 9999?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 212
Accepted Solution

Set auto-number limit on graph files created to higher than 9999?

I'm making lots of contour plots.  16,000 per run.

The output plot files have an "auto-number" appended to each file name (though I don't want it).  These numbers count up to 9999, then SAS stops.  In order to get the remaining plots (10,000 - 16,000) I have to restart, with the finished code commands deleted.

Is there a way to:

-- turn off auto-numbering?

-- increase the auto-numbering to, say, 20,000?

Thanks much.

Nicholas Kormanik

nkormanik@gmail.com

Below is the code, with the first two instances of the 16,000 plot requests:

options

validvarname=any

nonotes

errors=0

nomprint

nomlogic

nosymbolgen

nostimer

nofullstimer

nosource2

nosource

;

libname nicholas 'c:\downloads'

;

ods graphics on;

ods html path='c:\downloads' (url=none) file='graphs_.html'

;

proc import out=nicholas.data

datafile="c:\downloads\_2012_06_20_QQQ.xls"

dbms=excel replace;

sheet="sheet1$";

getnames=yes;

mixed=no;

scantext=yes;

usedate=yes;

scantime=yes

;

run;

quit;

goptions reset=global

colors=(steel bip vliv blue vpap magenta bibg vpag vlig bilg lime cyan yellow ywh cream gold lio bio vio lipk red)

device=actximg

xpixels=1600

ypixels=1200

gunit=pct

;

proc g3grid data=nicholas.data out=smoothed; grid '21504'n*'22606a'n='50504'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot '21504'n*'22606a'n='50504'n / smooth nlevels=21 coutline=same ljoin name="_50504_21504_22606a_"; run; quit;

proc g3grid data=nicholas.data out=smoothed; grid '21504'n*'22701'n='50504'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot '21504'n*'22701'n='50504'n / smooth nlevels=21 coutline=same ljoin name="_50504_21504_22701_"; run; quit;


Accepted Solutions
Solution
‎07-13-2012 04:52 PM
Regular Contributor
Posts: 212

Re: Set auto-number limit on graph files created to higher than 9999?

Well, thanks for your sleuthing and helping.  I greatly appreciate it.

Finally a work-around that gets the job done:

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00001_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'High'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'High'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00001_50508_Open_High_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00002_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Low'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Low'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00002_50508_Open_Low_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00003_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Close'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Close'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00003_50508_Open_Close_"; run; quit;

Results in file creation:

_00001_50508_open_high_.png

graphs_00001_.html

_00002_50508_open_low_.png

graphs_00002_.html

_00003_50508_open_close_.png

graphs_00003_.html

And then the first six characters can be deleted subsequently with file-name software.

Hope this thread helps others, too.

Nicholas Kormanik

nkormanik@gmail.com

View solution in original post


All Replies
Respected Advisor
Posts: 4,646

Re: Set auto-number limit on graph files created to higher than 9999?

Just an idea : give a number at the end of the base file name, such as name="_50504_21504_22701_00001"

PG

PG
Regular Contributor
Posts: 212

Re: Set auto-number limit on graph files created to higher than 9999?

Tried that, and no luck.

No option in settings, either, apparently, to set the auto-number higher.

Very frustrating....

Respected Advisor
Posts: 4,646

Re: Set auto-number limit on graph files created to higher than 9999?

Another idea... I don't know if the statement

ODS GRAPHICS / RESET=INDEX;

which reinitializes the file suffix counter in ODS graphics would do the same for SAS/GRAPH output? Worth a try.

PG

PG
Regular Contributor
Posts: 212

Re: Set auto-number limit on graph files created to higher than 9999?

Well, had huge hopes.  But, nope....  Put it between every line.  Result was the same as before.

Experimenting further I was able to take care of the .html portion, by placing in my own numbers:

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00001_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'High'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'High'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_50508_Open_High_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00002_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Low'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Low'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_50508_Open_Low_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00003_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Close'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Close'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_50508_Open_Close_"; run; quit;

But for some crazy reason still have a problem with the names of the graph file output (.png).  Still adding as suffix the unwanted auto-numbers, which, once again, probably won't make it higher than 9999:

graphs_00007_.html

_50508_open_avgvol21_6.png

graphs_00006_.html

_50508_open_avgprc21_5.png

graphs_00005_.html

_50508_open_dayofweek_4.png

graphs_00004_.html

_50508_open_volume_3.png

graphs_00003_.html

_50508_open_close_2.png

graphs_00002_.html

_50508_open_low_1.png

graphs_00001_.html

An added clue might come from the log file.  One line below appeared for each subsequent image file creation:

NOTE: Graph's name, _50508_O, changed to _50508_1. _50508_O is already used or not a valid SAS name.

NOTE: Graph's name, _50508_O, changed to _50508_2. _50508_O is already used or not a valid SAS name.

NOTE: Graph's name, _50508_O, changed to _50508_3. _50508_O is already used or not a valid SAS name.

NOTE: Graph's name, _50508_O, changed to _50508_4. _50508_O is already used or not a valid SAS name.

Why in the world would SAS be appearing to truncate my file names??!!  Are we still back in the days of DOS and 8.3 file name limits?

But the files created do have the full file names.  With the added auto-numbering junk.

If SAS insists on truncating, yes, sure, auto-numbering can be expected.  But if SAS doesn't truncate my file names, they are all unique, and should pose no problem.

Hopefully we'll get to the bottom of this yet.

Respected Advisor
Posts: 4,646

Re: Set auto-number limit on graph files created to higher than 9999?

OK, I just read the doc re the naming of files in SAS/GRAPH. What a mess this feature has evolved into! The DOS-like behaviour comes from the graphics catalog entry names which are limited to 8 characters. And those entries are ALWAYS produced by SAS/GRAPH procedures, even when you don't want them. Graphic catalog entries are never overwritten, thus the auto-numbering scheme. One way out of this would be:

proc catalog catalog=WORK.GRSEG kill; /* Empties the default graphics catalog */

filename xyz "_50508_open_low_.png";

goptions gsfname=xyz;

proc gcontour data=smoothed;

plot 'Open'n*'Low'n='50508'n / smooth nlevels=21 coutline=same ljoin name="x";

run;

If I got this right, these commands would produce the file named in the filename statement and leave the GRSEG catalog with a single entry called 'x' (which you may delete subsequently). The GSFNAME option should work fine for producing .PNG files but it doesn't work for ActiveX output. Nothing is perfect :smileyplain:.

PG

PG
Solution
‎07-13-2012 04:52 PM
Regular Contributor
Posts: 212

Re: Set auto-number limit on graph files created to higher than 9999?

Well, thanks for your sleuthing and helping.  I greatly appreciate it.

Finally a work-around that gets the job done:

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00001_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'High'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'High'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00001_50508_Open_High_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00002_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Low'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Low'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00002_50508_Open_Low_"; run; quit;

ods html close; ods html path='c:\downloads' (url=none) body='graphs_00003_.html'; proc g3grid data=nicholas.data out=smoothed; grid 'Open'n*'Close'n='50508'n / spline smooth=.05 naxis1=121 naxis2=121; run; quit; proc gcontour data=smoothed; plot 'Open'n*'Close'n='50508'n / smooth nlevels=21 coutline=same ljoin name="_00003_50508_Open_Close_"; run; quit;

Results in file creation:

_00001_50508_open_high_.png

graphs_00001_.html

_00002_50508_open_low_.png

graphs_00002_.html

_00003_50508_open_close_.png

graphs_00003_.html

And then the first six characters can be deleted subsequently with file-name software.

Hope this thread helps others, too.

Nicholas Kormanik

nkormanik@gmail.com

☑ This topic is SOLVED.

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

Discussion stats
  • 6 replies
  • 363 views
  • 6 likes
  • 2 in conversation