02-26-2016 11:18 AM
I'm attempting to write a macro that gathers data from a text file, graphs it, then saves the graph. My problem is in the saving graph bit. Here the relevant code:
%MACRO rpz2 (fname=, radius=); %let fname_len = %length(&fname); %let subjname = %substr(&fname, 1, &fname_len-3); %let rad_rr = 20; %let rad_z2 = 25; DATA &fname; INFILE "C:\Users\Benjamin\Data\HeatMappers\Txts\&fname..txt" DELIMITER=' ' ; INPUT X Y Recurrence; RUN; DATA &fname; set &fname; if recurrence > &radius THEN delete; RUN; ods printer printer=tiff; ODS GRAPHICS / IMAGENAME = '&fname. Recurrence Plot'; proc sgrender data=&fname template=PlotRadius&radius; dynamic _X='X' _Y='Y' _Z='Recurrence' _T="Plot - &fname"; TITLE "Plot"; RUN; ods printer close; %MEND rpz2 ;
I keep getting a message that reads "WARNING: The IMAGENAME option or the output name contains invalid characters. _fname Recurrence Plot will be used as the image name prefix." Then it saves a file in the right directory, but the problem is that the title of the file is "_fname Plot".
Thanks for the help!
Need further help from the community? Please ask a new question.