Hi all,
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!
Ben
Use double quotes if you want to substitute the value of a macro variable into a string. For example
IMAGENAME = "&fname. Recurrence Plot";
Use double quotes if you want to substitute the value of a macro variable into a string. For example
IMAGENAME = "&fname. Recurrence Plot";
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.