Previous Page | Next Page

METADATA Procedure

Example 4: Fileref to a Temporary File with the IN= Argument


Procedure features:

IN= argument

Other features:

DATA _NULL_ and DATALINES statements

DATA _NULL_ and PUT statements


You might want to test your code without creating a permanent input XML file. You can use a DATA _NULL_ step to create a temporary input XML file.


Program

 Note about code
filename myinput temp lrecl=256;
filename myoutput "c:\myxml\results\weeklyresults.xml" lrecl=256;
 Note about code
data _null_;
   file myinput;
   input;
   put _infile_ ' ';
   datalines;
<GetMetadataObjects>
   <Reposid>$METAREPOSITORY</Reposid>
   <Type>Column</Type>
   <Objects/>
   <Ns>SAS</Ns>
   <Flags>1</Flags>
   <Options/>
</GetMetadataObjects>
;;
run;
proc metadata
     in=myinput
     out=myoutput;
run;

The following code performs the same task with PUT statements:

 Note about code
data _null_;
   file myinput;
   put "<GetMetadataObjects";
   put "   <Reposid>$METAREPOSITORY</Reposid>";
   put "   <Type>Column</Type>";
   put "   <Objects/>";
   put "   <Ns>SAS</Ns>";
   put "   <Flags>1</Flags>";
   put "   <Options/>";
   put "</GetMetadataObjects>";
run;
proc metadata
     in=myinput
     out=myoutput;
run;

Previous Page | Next Page | Top of Page