METADATA Procedure

Example 3: Filerefs with the IN= and OUT= Arguments

Features:

fileref in IN= argument

fileref in OUT= argument

connection arguments

This example shows how filerefs are used with the IN= and OUT= arguments.
Create filerefs. These filerefs specify pathnames to XML files that are stored on a C: drive. If you specify the OUT= argument in the procedure, you must first submit a FILENAME statement, because the OUT= value accepts a fileref only, not a pathname. Record length is specified by the LRECL= argument.
filename myinput "c:\myxml\query\weeklyquery.xml" lrecl=256;
filename myoutput "c:\myxml\results\weeklyresults.xml" lrecl=256;
Submit PROC METADATA. The code specifies metadata server connection arguments, so the defaults are not used. REPOS= is an alias for REPOSITORY=. The procedure submits the contents of weeklyquery.xml (the fileref MYINPUT) to the metadata server, and stores the server's response in weeklyresults.xml (the fileref MYOUTPUT).
proc metadata
     server="myserver.us.company.com"
     port=8561
     repos="My Repository"
     userid="testid"
     password="testpw"
     in=myinput
     out=myoutput;
run;