TEMPLATE Procedure: Creating Markup Language Tagsets |
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 |
|
This example shows a new tagset that does not inherit
events from another tagset. This is a customized tagset for specific PROC
FREQ output.
![Note about code](../../../../common/61991/HTML/default/images/snbut.gif) |
proc template;
define tagset Tagsets.newloc / store = SASUSER.TEMPLAT;
notes 'This is the Location Report Template'; |
![Note about code](../../../../common/61991/HTML/default/images/snbut.gif) |
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;
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.