Referencing a Macro from a Snippet

The Macro Repository contains only one snippet. To view the Generate QR Code snippet, open the Snippets section in the navigation pane.
Generate QR Code Snippet
Because this repository contains only one snippet, the code in the snippets.xml is pretty simple.
<?xml version="1.0" encoding="UTF-8"?>
<Snippets>
	<Snippet>
		<Name label="Generate QR Code"/>
		<Documentation uri="http://support.sas.com/kb/45/594.html" 
         label="Generating a QR Code using PROC HTTP"/>
		<Template uri="./qr.sas"/>
		<Icon uri="https://cdn2.iconfinder.com/data/icons/
         windows-8-metro-style/512/qr_code.png"/>
	</Snippet>
	
</Snippets>
As shown by the reference in the Template element, the snippet is created using code in the qr.sas file (which is saved in the repository).
Here is the content of the qr.sas file:
filename url url "{baseURL}/qr_macros.sas";
%include url;


filename code temp;
data _null_;
	file code;
	put "proc print data=sashelp.fish;run;";
	output;
run;

%generate_qr_code(code,_dataout);

%let _DATAOUT_MIME_TYPE=image/png;
%let _DATAOUT_NAME=qrcode.png;
In qr.sas, the FILENAME statement uses the URL Access Method to point to the qr_macros.sas file, which contains the macro code. When you run the snippet, {baseURL} resolves to the repository URL.