ERROR: The request ? is missing required parameter Function Name.

I had this head scratcher today, when submitting some XML to SAS via proc metadata:

ERROR: The request ? is missing required parameter Function Name.

Turns out this was a simple fix - the input fileref simply wasn’t large enough.  It needed the lrecl option (note, this can be larger than 32,767):

filename in '/tmp/meta.txt' lrecl=1000000 ;
proc metadata in=in out=outmeta verbose;run;

Tip - whatever you do, don’t try adding the recfm=n option!!  This will send your proc metadata into an infinite loop.  Killing your session from SAS Studio (or Enterprise Guide) may not prevent the session from remaining on the remote SAS application server and maxing out CPU indefinitely.

Safe coding!  If you are working a lot with metadata management, you may want to check out the macros in the SASjs/core library.