Previous Page | Next Page

TEMPLATE Procedure: Creating Markup Language Tagsets

Example 3: Creating a New Tagset


PROC TEMPLATE features:

DEFINE TAGSET statement:

NOTES statement

DEFINE EVENT statement:

NDENT statement

PUT statement

TRIGGER statement

XDENT statement

Tagset Attributes:

DEFAULT_EVENT attribute

INDENT= attribute

OUTPUT_TYPE attribute

MAP= attribute

MAPSUB= attribute

NOBREAKSPACE= attribute

SPLIT= attribute

STACKED_COLUMNS= attribute



Program Description

This example shows a new tagset that does not inherit events from another tagset. This is a customized tagset for specific PROC FREQ output.


Program

 Note about code
proc template;
   define tagset Tagsets.newloc / store = SASUSER.TEMPLAT;
      notes 'This is the Location Report Template';
 Note about code
   define event basic;
   end;

   define event doc;
   start:
      put '' nl nl;
      put '' nl;
      put '' nl;
      put '' nl;
      ndent;
   finish:
      xdent;
      put nl;
      put '';
   end;

   define event system_title;
      put '';
      put VALUE;
      put '';
      put nl nl;
   end;
define event header;
   start:
   trigger country /if cmp(LABEL, 'EmpCountry');
   end;

   define event data;
   start:
   trigger frequency /if cmp(name, 'Frequency');
   end;

   define event country;
      put '' nl ;
      ndent ;
      put '' ;
      put VALUE ;
      put '' nl  ;
   end;

   define event frequency;
      put '' ;
      put VALUE ;
      put '' nl  ;
      xdent ;
      put '' nl ;
   end;

   output_type = 'xml';
   default_event = 'basic';
   indent = 2;
   split = '';
   nobreakspace = ' ';
   mapsub = '/</>/&/';
   map = '<>&';
   stacked_columns=off;
   end;
run;

New Tagsets.newloc Template Source

proc template;                                                                
   define tagset Tagsets.newloc / store = SASUSER.TEMPLAT;                    
      notes 'This is the Location Report Template';                         
      define event basic;                                                     
      end;                                                                    
      define event doc;                                                       
         start:                                                               
            put '' NL NL;                                                     
            put '' NL;                                                        
            put '' NL;                                                        
            put '' NL;                                                        
            ndent;                                                            
         finish:                                                              
            xdent;                                                            
            put NL;                                                           
            put '';                                                           
      end;                                                                    
      define event system_title;                                              
         put '';                                                              
         put VALUE;                                                           
         put '';                                                              
         put NL NL;                                                           
      end;                                                                    
      define event header;                                                    
         start:                                                               
            trigger country /if cmp( LABEL, 'EmpCountry');                    
      end;                                                                    
      define event data;                                                      
         start:                                                               
            trigger frequency /if cmp( name, 'Frequency');                    
      end;                                                                    
      define event country;                                                   
         put '' NL;                                                           
         ndent;                                                               
         put '';                                                              
         put VALUE;                                                           
         put '' NL;                                                           
      end;                                                                    
      define event frequency;                                                 
         put '';                                                              
         put VALUE;                                                           
         put '' NL;                                                           
         xdent;                                                               
         put '' NL;                                                           
      end;                                                                    
      map = %nrstr('<>&');                                                    
      mapsub = %nrstr('//&/');                                             
      nobreakspace = ' ';                                                     
      split = '';                                                             
      indent = 2;                                                             
      default_event = 'basic';                                                
      output_type = 'xml';                                                    
      stacked_columns = OFF;                                                  
   end;                                                                       
run;               

Previous Page | Next Page | Top of Page