METADATA Procedure

Example 5: HEADER= Argument

Features:

HEADER= argument

This example shows how the HEADER=SIMPLE and HEADER=FULL arguments can be used to specify a header and encoding for the output XML file. For a listing of encoding values that can be used with HEADER=FULL, see the SAS National Language Support (NLS): Reference Guide.
Example of HEADER=SIMPLEThis code inserts the static header <?xml version="1.0" ?> in the output XML file that is identified by the fileref MYOUTPUT. A sample of the content of the output file, opened in a browser, follows.
filename myoutput "u:\out1.xml";
proc metadata
     header=simple
     out=myoutput
     in="<GetTypes>
         <Types/>
         <Ns>SAS</Ns>
         <Flags/>
         <Options/>
         </GetTypes>";
run;
Here is a display of the top portion of the output file:
Display of the output file created with HEADER=SIMPLE
Example of HEADER=FULLWhen you specify HEADER=FULL, but do not specify an encoding value in the FILENAME statement, PROC METADATA includes a header with the encoding that is active in your SAS session. A sample of the output follows.
filename myoutput "u:\out2.xml";
proc metadata
     header=full
     out=myoutput
     in="<GetTypes>
         <Types/>
         <Ns>SAS</Ns>
         <Flags/>
         <Options/>
         </GetTypes>";
run;
Here is a display of the top portion of the output file:
Display of output file created with HEADER=FULL
Example of HEADER=FULL with an Encoding ValueThis example creates the output file with an ASCII encoding. The encoding is specified in the FILENAME statement. An example of the output follows.
filename myoutput "u:\out3.xml" encoding=ascii;
proc metadata
     header=full
     out=myoutput
     in="<GetTypes>
         <Types/>
         <Ns>SAS</Ns>
         <Flags/>
         <Options/>
         </GetTypes>";
run;
Here is a display of the top portion of the output file:
Display of output file created with HEADER=FULL and a specified encoding value