As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

Macro Variable for next title line

From sasCommunity
Jump to: navigation, search

Q: How can I add a title to next line without knowing how many titles are already used?

A: use SQL Dictionary.Titles

harvested from SAS-L

Author: Ronald_J._Fehd

 /*    name:
description: return macro variable with next title line number
    purpose: bricolage: use sql dictionary.titles
     author: Ronald J. Fehd 2002
title2 'text';
PROC SQL noprint; 
         select max(Number) +1 
           into :TitleN
           from dictionary.titles
          where Type eq 'T';
          *trim leading blanks;
          %Let  TitleN = &TitleN;
PROC Print data = sashelp.class(obs=1);
           title&TitleN 'next';

Obs     Name     Sex    Age    Height    Weight

  1    Alfred     M      14      69       112.5

Tip: use the same code for footnotes and change Type to 'F'.

--macro maven == the radical programmer 11:42, 17 May 2012 (EDT)