Data visualization with SAS programming

How to create values for axis labels for irregular interval data

Reply
New Contributor
Posts: 3

How to create values for axis labels for irregular interval data

sample on PC.gifpc versionsample on zOS.gifzos version

axis1 order=(                                           
   /*01*/     1     60    121    182    244    305     
                                             The SAS Sys
                                                       
   /*02*/   366    425    486    547    609    670     
   /*03*/   731    791    852    913    975   1036     
   /*04*/  1097   1156   1217   1278   1340   1401     
   /*05*/  1462   1521   1582   1643   1705   1766     
   /*06*/  1827   1886   1947   2008   2070   2131     
   /*07*/  2192   2252   2313   2374   2436   2497     
   /*08*/  2558   2617   2678   2739   2801   2862     
   /*09*/  2923   2982   3043   3104   3166   3227     
   /*10*/  3288   3347   3408   3469   3531   3592     
   /*11*/  3653   3713   3774   3835   3897   3958     
   /*12*/  4019   4078   4139   4200   4262   4323     
   /*13*/  4384   4443   4504   4565   4627   4688     
   /*14*/  4749   4808   4869   4930   4992   5053     
   /*15*/  5114   5174   5235   5296   5358   5419     
   /*16*/  5480   5539   5600   5661   5723   5784     
   /*17*/  5845   5904   5965   6026   6088   6149 6210
                                                       
             )    /* end of axis order   */            
   value=(height=2 font=swissl                         
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'        
       'jan'  'mar'  'may'  'jul'  'sep'  'nov'  '   ')
   width=1                                             
   label=none;                                         

The above code works when run on a PC running SAS 9.2,  but gives the following error when run on z/OS running SAS 9.4.   Can anyone tell me why?  my desire is to get a axis label(value) every 2 months based on the number(DDD) of the data input. the input is a single value. I have supplied the values for the axis based on the first day of each month( adjusted for leap year and month lengths via the order= .  The only thing I changed between the PC and z/OS was the device= statement in the go options . On the PC it was device=gif733   and on z/OS it was device=gif      I got errors using device=gif733 in z/OS  

Is there an option that I need to specify or something. there are many points to this graph that gets created. the result on a PC is in "sample on PC.gif "     and the output on z/OS is in "sample on zos.gif " .

 

 

below are the errors I get

 

WARNING: Over 20 axis tick marks were generated with the specified order= option using the default 'by 1'.

Therefore the specified 
         axis order= was ignored, and the default order= algorithm was used.                                 

                     
MPRINT(GENGRH):   axis1 order=( 1 60 121 182 244 305 366 425 486 547 609 670 731 791 852 913 975 1036 1097

1156 1217 1278 1340 1401
1462 1521 1582 1643 1705 1766 1827 1886 1947 2008 2070 2131 2192 2252 2313 2374 2436 2497 2558 2617 2678 2739

2801 2862 2923 2982  
3043 3104 3166 3227 3288 3347 3408 3469 3531 3592 3653 3713 3774 3835 3897 3958 4019 4078 4139 4200 4262 4323

4384 4443 4504 4565  
4627 4688 4749 4808 4869 4930 4992 5053 5114 5174 5235 5296 5358 5419 5480 5539 5600 5661 5723 5784 5845 )

value=(height=1         
font=swissl 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul'

'sep' 'nov' 'jan' 'mar'
'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar'

'may' 'jul' 'sep' 'nov'
'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov'

'jan' 'mar' 'may' 'jul'
'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul'

'sep' 'nov' 'jan' 'mar'
'may' 'jul' 'sep' 'nov' 'jan' 'mar' 'may' 'jul' 'sep' 'nov' '   ') width=1 label=none;                       

                                                                        

Super User
Posts: 13,066

Re: How to create values for axis labels for irregular interval data

Device based graphics are becoming less desirable in general with more options being added to the statistical graphics. Likely the issue partially that with the emphasis on the SG graphics as being more compatible with most needs that the number and flexibility of the devices installed has declined dramatically. I know that the number of devices in my SAS 9.4 for windows is about a third of what I had a few releases ago.

 

Proc Gdevice;

run;

might bring up a window (don't use Z/OS so I'm not sure) of installed devices you may use. If the window comes up and works the way it does in the Windows DMS you have an underline character before each device. You can type an X there an hit enter to get details of the specific device. Critical values are the Xpixel and Ypixels which limit some of the output. You might see if you have the PNG300 device which supports more pixels than the current GIF.

 

You may also have some other default goptions affecting display size that are interacting and making the display area smaller than requested axis fits. Or the Height=2 is a larger size than you expect, you might specify a unit such a height=2PT.

 

Personally anything related to date axis displays I use actual SAS date valued variables with appropriate format such as MONNAME3 and then can use an order like: ORDER = ('01JAN2000'd to '01Jan2010'd by month2).

New Contributor
Posts: 3

Re: How to create values for axis labels for irregular interval data

yes looked at gdevice settings.   tried a few different tests with width and height changes to use the new "gif" setting.    I am still trying to figure out if it made things better or just different.   still running some tests.   I don't want to make more than one change at a time so it is just taking me time.  I will try some of the other things when I get back on Monday.  thanks for these suggestions

 

Super User
Posts: 22,857

Re: How to create values for axis labels for irregular interval data

Can you switch to SGPLOT in general or are you stuck with GPLOT? If you're going to change it may as well migrate to the new procedures at the same time. 

New Contributor
Posts: 3

Re: How to create values for axis labels for irregular interval data

yes I may be forced to use sgplot if the changes ballardw do not result in a better display.   thanks for suggestion.

SAS Employee
Posts: 1,024

Re: How to create values for axis labels for irregular interval data

Rather than hard-coding all the date values, perhaps you could use something more like this, that lets SAS do it for you (SAS has some 'smarts' built-in behind the scenes, that tries very hard to handle the irregular number of days in the months, etc, for you)...

 

symbol1 value=none interpol=join c=blue;

axis1 label=none order=('01jan1987'd to '01jan1989'd by month2) minor=none offset=(0,0);
axis2 label=none order=(0 to 200 by 50) minor=none offset=(0,0);

title "IBM Stock Price, 1987 & 1988";
proc gplot data=sashelp.stocks (where=(stock='IBM'));
format date monname3.;
format close dollar8.0;
plot close*date / haxis=axis1 vaxis=axis2
autovref cvref=graydd
href='01jan1988'd chref=graydd;
run;

 

ibm.png

Ask a Question
Discussion stats
  • 5 replies
  • 166 views
  • 0 likes
  • 4 in conversation