/* Datei-Name:  histrgrf.sas                                    */

/* Autor:       Jörg Michael Müller                             */

/* Gruppe:      Zentrum für Rehabilitationsforschung            */

/* Datum:       30071999                                        */

/* IN-Data:                                                     */

/* Out-Data:                                                    */

/* Inhalt:      Makro zur Histogrammerstellung                  */

/* Bemerkung:                                                   */

*****************************************************************;

 

 

%macro histogrf(datain);

 

data macro.d1; set macro.&datain;

data d1; set macro.&datain;

 

%graf_on

 

goptions rotate=landscape;

 

%content2(d1,1)

 

proc catalog c=work.histos;

run;

 

%axis(d1)

 

%varscor(d1)

 

 

run;

 

data d1; set macro.&datain;

 

%do i=1 %to &vmax;

 

 

    title1 %bquote(Fehlende Werte N= &&i&i);

    footnote1 %bquote(Gesamt N= &obs);

 

    proc gchart gout=work.histos; vbar

    &&v&i

 

        %if &&w&i<6 %then %do;

                /discrete width=8

        %end;

 

        %if &&w&i>5 %then %do;

                /midpoints=&&vmin&i to &&vmax&i by &&vdis&i width=6

        %end;

      ;

 

run;

%end;

;

 

title1;

title2;

footnote1;

goptions reset=all;

 

 

proc catalog c=work.histos et=grseg;

 

        change gchart=&v1;

        %do i=2 %to  %eval(&vmax + 1);

                %let j=%eval(&i-1);

 

                %if &j<100 %then %do;

                change gchart&j=&&v&i;

                %end;

 

                %else;

                change gchar&j=&&v&i;

                %end;

        %end;

 

run;

 

 

proc datasets kill;

run cancel;

 

%mend histogrf;

 

 

run;