Previous Page | Next Page

TEMPLATE Procedure: Creating Markup Language Tagsets

Example 5: Indenting Output


PROC TEMPLATE features:

DEFINE TAGSET statement:

DEFINE EVENT statement:

PUT statement

NDENT statement

TRIGGER statement

XDENT statement

TAGSET attributes:

INDENT= attribute

Other ODS features:

ODS directory.tagset-name statement



Program Description

This example illustrates how to indent the output using a tagset.

Note:   When you view a file with an extension of .xml in an XML-compliant browser, the browser ignores any indention in the file in favor of its own indention algorithm.  [cautionend]


Program

 Note about code
proc template;
   define tagset tagsets.mytagset2;
   indent = 4;

      define event doc;
      start:
         put 'start of doc' nl;
         ndent;
         trigger mytest;
         trigger otherevent;
      finish:
         trigger mytest;
         xdent;
         put 'finish of doc' nl;
         trigger mytest start;
         trigger otherevent;
         trigger mytest finish;
      end;

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

      define event otherevent;
         put 'This is my other event' nl;
      end;
   end;
run;
ods tagsets.mytagset2 file='custom-tagset-filename2.txt';
ods tagsets.mytagset2 close;

Output Created from Events and Using Tagsets.mytagset2 Template Source

[Output Created from Events and Using Tagsets.mytagset2  Template Source]

Previous Page | Next Page | Top of Page