title: Naming exported files with variable in SAS
body: <p>I am looking to export data from SAS to .csv with PROC EXPORT. I would like the name of the file to change based on the value of a variable. Is that possible?</p>
  
  <pre><code>PROC EXPORT DATA= WORK.A 
  OUTFILE= "c:\folders\filenameVAR1.csv" 
  DBMS=CSV LABEL REPLACE;
  PUTNAMES=YES;
  RUN;
  </code></pre>
  
  <p>I would like to add the value of a variable (eg. VAR1) at the end of my file name as shown above. I would like a file named filenameVAR1.csv and then when I change the variable it would be called filenameVAR2.csv.
  Thanks</p>