Announcement

Collapse
No announcement yet.

How to use a format to get indentation?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use a format to get indentation?

    There is a way to use a format to get indentation when you have a down frequency table. Suppose you wanted the following table where the first frequency stood out and all frequencies under it were indented by two spaces:

    Click image for larger version

Name:	picformat.jpg
Views:	1
Size:	18.8 KB
ID:	463

    You might consider formatting it as follows:
    proc format;
    value heatf
    100 = 'PATIENTS WITH AT LEAST ONE HEAT INTOLERANCE SYMPTOM'
    101 = ' WORSENING OF MS SYMPTOMS ON HOT, HUMID DAYS'
    102 = ' WORSENING OF MS SYMPTOMS WITH FEVER OR INFECTION';
    However the leading blanks will be eliminated so this method will NOT work.

    You can use a macro variable with the value of %nrstr( ). The following code example shows how to use a macro variable to put in two leading blanks. Note that the space in the parenthesis is only one because there is automatically one space after the macro variable is inserted in the format.

    value heatff
    100 = 'PATIENTS WITH AT LEAST ONE HEAT INTOLERANCE SYMPTOM'
    101 = '&blnk WORSENING OF MS SYMPTOMS ON HOT, HUMID DAYS'
    102 = '&blnk WORSENING OF MS SYMPTOMS WITH FEVER OR INFECTION';
    run;
    %let blnk=%nrstr( );
    data test;
    do i=0 to 2; pat=10+1; heat=100+i; output; end;
    format heat heatff.;
    run;
    %dzstable(titles=test picture format,
    display=freq nextto percent <heat>,
    options=freqdown center);
    Last edited by Stella Scafidi; 03-31-2010, 11:37 AM.
Working...
X